Top "Scikit-learn" questions

scikit-learn is a machine-learning library for Python that provides simple and efficient tools for data analysis and data mining, with a focus on machine learning.

TypeError: cannot perform reduce with flexible type

I have been using the scikit-learn library. I'm trying to use the Gaussian Naive Bayes Module under the scikit-learn library …

python python-2.7 scikit-learn
A column-vector y was passed when a 1d array was expected

I need to fit RandomForestRegressor from sklearn.ensemble. forest = ensemble.RandomForestRegressor(**RF_tuned_parameters) model = forest.fit(train_fold, train_…

python pandas numpy scikit-learn
Stratified Train/Test-split in scikit-learn

I need to split my data into a training set (75%) and test set (25%). I currently do that with the code …

python scikit-learn
Principal Component Analysis (PCA) in Python

I have a (26424 x 144) array and I want to perform PCA over it using Python. However, there is no particular …

python scikit-learn pca
Parameter "stratify" from method "train_test_split" (scikit Learn)

I am trying to use train_test_split from package scikit Learn, but I am having trouble with parameter stratify. …

split scikit-learn training-data test-data
Accuracy Score ValueError: Can't Handle mix of binary and continuous target

I'm using linear_model.LinearRegression from scikit-learn as a predictive model. It works and it's perfect. I have a problem …

python machine-learning scikit-learn linear-regression prediction
Save classifier to disk in scikit-learn

How do I save a trained Naive Bayes classifier to disk and use it to predict data? I have the …

python machine-learning scikit-learn classification
LabelEncoder: TypeError: '>' not supported between instances of 'float' and 'str'

I'm facing this error for multiple variables even treating missing values. For example: le = preprocessing.LabelEncoder() categorical = list(df.select_…

python pandas scikit-learn
Visualizing decision tree in scikit-learn

I am trying to design a simple Decision Tree using scikit-learn in Python (I am using Anaconda's Ipython Notebook with …

python scikit-learn visualization decision-tree
scikit-learn random state in splitting dataset

Can anyone tell me why we set random state to zero in splitting train and test set. X_train, X_…

python random machine-learning scikit-learn