-
Notifications
You must be signed in to change notification settings - Fork 1k
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
GridSearch feature #7
Conversation
- Import itertools - Add an __init__ function that initializes class instance - Add evaluate method that evaluates the parameters on a dataset
- tests on correct algorithm instance
-Added a function to make sure the combinations returned are correct by testing its length
- Added best score, best parameters and best index attributes - Removed 1 attribute and added cv_results_ attribute analogous to sklearn implementation - Added tests for best attributes for RMSE and FCP measures
- Default to True - Added some local variables needed for verbose messages - Change the loop to enumerate to follow similar code structure
- Best attributes are now dicts with measures as keys - Change the test to adapt to the new parameters of evaluate - Add absolute value to tests
…dSearch parameters - Added parameters documenation - Renamed algo parameter to algo_class - Changed default measures from ['RMSE'] to become similar to evaluate ['rmse','mae']
- Removed duplicate definition of attributes - Changed definition from dict to Case insensitive dict - Added a test to make sure input parameters and output attributes are not case sensitive
- 0: Do not print anything - 1: Print params when combination starts and Mean scores when it finishes - 2: Print same info as 2 plus the score on each fold
- Best algorithm instance with certain measure - Gives the ability for the user to use like any other algorithm class instance - Add test for this attribute
- Import itertools - Add an __init__ function that initializes class instance - Add evaluate method that evaluates the parameters on a dataset
- tests on correct algorithm instance
-Added a function to make sure the combinations returned are correct by testing its length
- Added best score, best parameters and best index attributes - Removed 1 attribute and added cv_results_ attribute analogous to sklearn implementation - Added tests for best attributes for RMSE and FCP measures
- Default to True - Added some local variables needed for verbose messages - Change the loop to enumerate to follow similar code structure
- Best attributes are now dicts with measures as keys - Change the test to adapt to the new parameters of evaluate - Add absolute value to tests
…dSearch parameters - Added parameters documenation - Renamed algo parameter to algo_class - Changed default measures from ['RMSE'] to become similar to evaluate ['rmse','mae']
- Removed duplicate definition of attributes - Changed definition from dict to Case insensitive dict - Added a test to make sure input parameters and output attributes are not case sensitive
- 0: Do not print anything - 1: Print params when combination starts and Mean scores when it finishes - 2: Print same info as 2 plus the score on each fold
- Best algorithm instance with certain measure - Gives the ability for the user to use like any other algorithm class instance - Add test for this attribute
Correct test cases. old evaluate method and grid search evaluate gives the best results
- It is a clone of CaseInsensitiveDefaultDict but without overriding __str__ method - Users can now print the dict output normally for the best - Replaced the usage of the CaseInsensitiveDefaultDict to CaseInsensitiveDefaultDictForBestResults inGridSearch class
- Added an example file that contains the code of the user-guide - Edited the getting started .rst file to add the guide
- Used enumerate instead of index to count in loop - changes cv_results_ to defaultdict(list) - Reduced the populating of scores and parameters for 1 block
- No need to manually iterate over folds - Some verbose print statements avoided
- Reduced the number of iterations in some test functions to reduce testing time - Added reference to GridSearchCV from sklearn - fixed test_measure_is_not_case_sensitive to actually fail if we have a bad key - Added few comments - Change verbose method of GridSearch evaluate - Reduced line sizes to less than 80 chars
Hi Maher, This is looking good :) ! A few remarks still:
We're getting closer :) Nicolas |
- One import in example file is left at the end of the file on purpose
- Renamed GridSearch attribute by removig the underscore from the end. Solved Errors - Gave different names for code blocks. Solved warnings
Hi again, The docs are now building with no warning or errors. Unicode character 'u' is removed. What is left is the following:
Maher |
Hey! What version of flake8 are you using? Mine is 3.2.1 and I still get many warnings on the example and the tests:
Also, the sphinx (1.4.9) still gives me warnings:
I've updated the CONTRIBUTING.md file, if you want to take a look. You did well with the pandas import. You can disable the flake8 warning by commenting with For the print results I was just thinking to put the output of the program as comments below the code (inside the the
I'm sorry I know this is a bit tedious... Next one will be the right one ;) ! Nicolas |
Duuuuh I just realized that I hadn't pulled your changes, hence I still got old warnings... >< It's all fine there are no more warning, really sorry about that! I'll squash and merge and avoid the Thanks a lot again for this nice feature! :) Nicolas |
Awesome! I reviewed the changes you did on top of my code and documentation and indeed they make this feature look better. I might be coming back with new pull requests :) once I finish a Udacity's machine learning nano-degree. I used Surprise for the capstone project and got wonderful feedback. Thanks! |
I'm very glad it's helped you! I made a reference to your github profile on the project page (acknowledgements section), if you want it to link elsewhere (or nowhere) tell me. Looking forward your next pull requests :) |
This pull request implements #6.