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.

UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples

I'm getting this weird error: classification.py:1113: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted …

python scikit-learn
How to split data into 3 sets (train, validation and test)?

I have a pandas dataframe and I wish to divide it to 3 separate sets. I know that using train_test_…

pandas numpy dataframe machine-learning scikit-learn
How to convert a pandas DataFrame subset of columns AND rows into a numpy array?

I'm wondering if there is a simpler, memory efficient way to select a subset of rows and columns from a …

python arrays numpy pandas scikit-learn
How to extract the decision rules from scikit-learn decision-tree?

Can I extract the underlying decision-rules (or 'decision paths') from a trained tree in a decision tree as a textual …

python machine-learning scikit-learn decision-tree random-forest
Scikit-learn train_test_split with indices

How do I get the original indices of the data when using train_test_split()? What I have is the …

python scipy scikit-learn classification
How to convert a Scikit-learn dataset to a Pandas dataset?

How do I convert data from a Scikit-learn Bunch object to a Pandas DataFrame? from sklearn.datasets import load_iris …

dataset scikit-learn pandas
RandomForestClassfier.fit(): ValueError: could not convert string to float

Given is a simple CSV file: A,B,C Hello,Hi,0 Hola,Bueno,1 Obviously the real dataset is far more …

python scikit-learn random-forest
sklearn classifier get ValueError: bad input shape

I have a csv, struct is CAT1,CAT2,TITLE,URL,CONTENT, CAT1, CAT2, TITLE ,CONTENT are in chinese. I want …

python scikit-learn classification text-classification
How does the class_weight parameter in scikit-learn work?

I am having a lot of trouble understanding how the class_weight parameter in scikit-learn's Logistic Regression operates. The Situation …

python scikit-learn