I'm trying to use a svm function from the scikit learn package for python but I get the error message:
from sklearn.utils.validation import check_arrays
ImportError: cannot import name 'check_arrays'
I'm using python 3.4. Can anyone give me an advice? Thanks in advance.
BaseEstimator provides among other things a default implementation for the get_params and set_params methods, see [the source code]. This is useful to make the model grid search-able with GridSearchCV for automated parameters tuning and behave well with others when combined in a Pipeline .
The scikit learn 'fit' method is one of those tools. The 'fit' method trains the algorithm on the training data, after the model is initialized. That's really all it does. So the sklearn fit method uses the training data as an input to train the machine learning model.
Input validation on an array, list, sparse matrix or similar. By default, the input is checked to be a non-empty 2D array containing only finite values. If the dtype of the array is object, attempt converting to float, raising on failure.
Use sklearn. __version__ to display the installed version of scikit-learn. Call sklearn. __version__ to return the current version of scikit-learn .
This method was removed in 0.16, replaced by a (very different) check_array
function.
You are likely getting this error because you didn't upgrade from 0.15 to 0.16 properly. [Or because you relied on a not-really-public function in sklearn]. See http://scikit-learn.org/dev/install.html#canopy-and-anaconda-for-all-supported-platforms .
If you installed using anaconda / conda, you should use the conda mechanism to upgrade, not pip. Otherwise old .pyc files might remain in your folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With