1
votes

Problem with scikit learn: I can't use learning_curve of sklearn.

When I do: import sklearn (it works), from sklearn.cluster import bicluster (it works), from sklearn import cross_validation (it works)... and so on. The only file that doesn't work is learning_curve,namely from sklearn.learning_curve import learning_curve (doesn't work).

Two types of error to consider:

  1. from sklearn import learning_curve

    Traceback (most recent call last): File "", line 1, in ImportError: cannot import name learning_curve

  2. from sklearn.learning_curve import learning_curve

    Traceback (most recent call last): File "", line 1, in ImportError: No module named learning_curve

Any clue?

2
Perhaps this might help? stackoverflow.com/questions/338768/… (In my installation of Anaconda, the import works fine.) - Ram Narasimhan
thanks yes it helps me - vincet
@vincet how finally it worked for you, could you please also post solution, I'm facing same issue. - Hrishikesh Mishra

2 Answers

0
votes

the learning_curve in scikit learn is under model_selection So try,

from sklearn.model_selection import learning_curve    

This works fine!

0
votes
# will work 👌
from sklearn.model_selection import validation_curve

# won't work 😞
from sklearn.learning_curve import validation_curve