Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple_trick #12

Open
daijob00 opened this issue Aug 17, 2021 · 9 comments
Open

simple_trick #12

daijob00 opened this issue Aug 17, 2021 · 9 comments

Comments

@daijob00
Copy link

Simple_trick is not offered as an option in the first linear regression function. In the second linear regression function, it is called, but the arguments is incorrect (no learning rate).

@dhern023
Copy link
Contributor

Hi @daijob00. The main difference between the two is the presence of the error collection, but you can call the simple_trick function in the first one (see how below).

If you want to use simple_trick in the second linear_regression function, you'll need to comment out the learning_rate argument as well and adjust the parenthesis like so because the simple_trick only takes four arguments.

        # Uncomment one of the following 3 lines to use the simple, the absolute, or the square trick
        price_per_room, base_price = simple_trick(base_price,
        # price_per_room, base_price = absolute_trick(base_price,
        # price_per_room, base_price = square_trick(base_price,
                                                  price_per_room,
                                                  num_rooms,
                                                  price,
                                                  #learning_rate=learning_rate)
                                                  )

Also, feel free to try the refactored version as well. I did my best to make switching between the different functions a bit more intuitive.

@vilas273
Copy link

vilas273 commented Jul 3, 2022

Hello,
I am getting an error of attribute name, even after installing the utils (pip install python-utils) package
utils.plot_points(features, labels)

AttributeError: module 'utils' has no attribute 'plot_points'
may i know how to fix this.?

@dhern023
Copy link
Contributor

dhern023 commented Jul 3, 2022

@vilas273 Don't confuse python-utils with utils.py provided with the code.

How are you running it? Can you check the refactored version to see if you're getting the same issue?

@ArmanbekAlkin
Copy link

ArmanbekAlkin commented Feb 16, 2024

Hello @dhern023 Can you advise what Python software to use with your book (Grokking Machine Learning)? PyCharm or VS Code. I tried to use your coding in Jupyter, or Google Colab, but with files you provided I guess it's better to use an installed software.

@dhern023
Copy link
Contributor

@ArmanbekAlkin What breaks for you?
Did you install the requirements.txt in your conda environment before you ran the code on juptyer? You can also to the same thing on Google Collab.
Afterwards, did you try the refactored version(s)?

@ArmanbekAlkin
Copy link

@dhern023 Hi Luis. Thank you for the reply. I haven't seen the requirements.txt file. Let me check your repository for this file, and look at the requirements. I am reading your book (Grokking Machine Learning), and trying to use your codes examples in PyCharm software application. I haven't used Refactored versions, as I noticed the difference with the book and didn't know if they are working. I will try them. My problem was, that for example, I use linear regression coding file from Chapter 3 and trying to execute code line by line and haven't seen the graphs you showed in the book. Now I see that you in refactored version of the file you have plt.show() functions. Let me play with refactored files and see how it goes. I like to use PyCharm to keep all my files and projects in one folder and track the difference with GIT.

@ArmanbekAlkin
Copy link

@dhern023 Hi Luis. I tried non-refactored version and it worked just fine, looks like I just didn't install some libraries. Although Turicreate is not working (I realized it's not working on Win10 OS), but it's OK. I am able to move forward to next topic. Thank you!

@dhern023
Copy link
Contributor

dhern023 commented Feb 19, 2024 via email

@ArmanbekAlkin
Copy link

@dhern023 Oh, my apoloigies! I thought this is the Author's repository and that he is replying to me )) I'm sorry my friend. I will play with refactored versions then as well to understand the concept. Thank you one more time for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants