PythonDataScienceHandbook icon indicating copy to clipboard operation
PythonDataScienceHandbook copied to clipboard

Errors in 05.14-Image-Features

Open Erotemic opened this issue 5 years ago • 0 comments

In https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/05.14-Image-Features.ipynb

visualise keyword doesn't exist

hog_vec, hog_vis = feature.hog(image, visualise=True) 

does not seem to work: TypeError: hog() got an unexpected keyword argument 'visualise'.

It looks like the visualise is spelled incorrectly or the api changed. The following line does work:

hog_vec, hog_vis = feature.hog(image, visualize=True) 

sklearn.cross_validation doesn't exist anymore

Also from sklearn.cross_validation import cross_val_score should change to from sklearn.model_selection import import cross_val_score

sklearn.grid_search doesn't exist anymore

Should change from sklearn.grid_search import GridSearchCV to from sklearn.model_selection import GridSearchCV

also

Note, that in the grid search, I get a lot of Liblinear failed to converge, increase warnings, which may indicate that default hyperparams have changed. The best C returned as 1.0 for me instead of 4.0 as noted in the notebook. Not sure if this is an issue, the finalized model does work on the astronaut image.

Erotemic avatar Jul 09 '20 16:07 Erotemic