Questions tagged [scikit-learn]

A machine-learning library for Python. Use this tag for any on-topic question that (a) involves scikit-learn either as a critical part of the question or expected answer, & (b) is not just about how to use scikit-learn.

Filter by
Sorted by
Tagged with
23
votes
2answers
43k views

Random forest is overfitting?

I'm experimenting with random forests with scikit-learn and I'm getting great results of my training set, but relatively poor results on my test set... Here is the problem (inspired from poker) which ...
22
votes
2answers
30k views

How to use scikit-learn's cross validation functions on multi-label classifiers

I'm testing different classifiers on a data set where there are 5 classes and each instance can belong to one or more of these classes, so I'm using scikit-learn's multi-label classifiers, ...
3
votes
2answers
688 views

Learning from one positive

Say that in a binary classification problem you have several negatives and only one positive. What types of models are good to learn from this data, and predict the label for a new instance? ...
8
votes
2answers
13k views

By using SMOTE the classification of the validation set is bad

I want to do classification with 2 classes. When I classify without smote I get: ...
5
votes
3answers
12k views

Having trouble understanding cross-validation results from scikit-learn

Actually, my question may just be about cross-validation in general. Here's what I'm doing: I'm trying to come up with a model using scikit-learn to learn on some data I've got. I've decided to use an ...
6
votes
3answers
248 views

Sharing a model trained on confidential data

I have a regularized logistic regression model using scikit-learn and would like to share it with others, however the data it is trained on is confidential and must remain protected. The model uses ...
5
votes
0answers
13k views

Scikit-learn reports memory error when fitting Gaussian process model [closed]

I want to fit a Gaussian Process with about 50,000 training examples and 130 features using Scikit-learn. Right now, I only have 1 theta hyperparameters as I run the process with all defaults. But I ...
36
votes
3answers
102k views

Polynomial regression using scikit-learn

I am trying to use scikit-learn for polynomial regression. From what I read polynomial regression is a special case of linear regression. I was hopping that maybe one of scikit's generalized linear ...
7
votes
1answer
6k views

What is the way to represent factor variables in scikit-learn while using Random Forests?

I am solving a classification problem using Random Forests. For that I have decided to use Python library scikit-learn. But I am new to both Random Forest algorithm and this tool. My data contains ...
42
votes
2answers
151k views

Mean absolute percentage error (MAPE) in Scikit-learn [closed]

How can we calculate the Mean absolute percentage error (MAPE) of our predictions using Python and scikit-learn? From the docs, we have only these 4 metric functions for Regressions: metrics....
6
votes
2answers
2k views

Why do categorical predictor variables in regression need to be recoded as multiple predictors?

I'm learning about machine learning using Python's library scikit learn, and in their tutorial here they mentioned about a categorical variable color which can have ...
12
votes
4answers
26k views

Why is svm not so good as decision tree on the same data?

I am new to machine learning and try to use scikit-learn(sklearn) to deal with a classification problem. Both DecisionTree and SVM can train a classifier for this problem. I use ...
0
votes
2answers
563 views

In SVM, what are the labels and how do you get them from the data?

I'm working on a school project and have decided to use SVM for stock market prediction. I have a 1000x5 matrix of stock quotes containg data for open, close, high, low, volume data. From what I know,...
6
votes
1answer
5k views

How are categorical variables used when fitting a decision tree in scikit-learn?

I am used to R, in which you can use factor(variable) to indicate a categorical variable. However, in scikit-learn, trying to pass a variable of strings causes the DecisionTreeClassifier to give an ...
3
votes
1answer
1k views

Simple text classifier: classification taking forever?

I work for a small tech startup, and I want to classify our users into demographics based on the domain of their email address. When users sign up to our site, they can enter a job category or pick "...
53
votes
2answers
31k views

Pandas / Statsmodel / Scikit-learn

Are Pandas, Statsmodels and Scikit-learn different implementations of machine learning/statistical operations, or are these complementary to one another? Which of these has the most comprehensive ...
15
votes
7answers
9k views

Random forest is overfitting

I am trying to use Random Forest Regression in scikits-learn. The problem is I am getting a really high test error: train MSE, 4.64, test MSE: 252.25. This is how ...
1
vote
0answers
2k views

Feature importance

The extremely randomized trees classifier (scikitlearn) provides a (multivariate) feature importance measurement Ensemble methods/feature importance evaluation. For each feature, the classifier ...
58
votes
5answers
104k views

How does one interpret SVM feature weights?

I am trying to interpret the variable weights given by fitting a linear SVM. (I'm using scikit-learn): ...
1
vote
1answer
2k views

Real values in Multinomial Naive Bayes classifier [duplicate]

Possible Duplicate: Naive Bayes for two continuous features I've seen that Multinomial Naive Bayes classifier in Sklearn accepts real valued feature vectors. I previously assumed that ...
3
votes
1answer
371 views

Strange definition of RSS for elastic net in scikit-learn (Python)

I've been reading the manual about GLM, specifically the one on the elastic net in this link, and they come up with the following function to minimize: $$\frac{1}{2n}||Xw-y||^2_{2}+\alpha \rho ||w||_1+...
19
votes
3answers
35k views

Collinear variables in Multiclass LDA training

I'm training a Multi-class LDA classifier with 8 classes of data. While performing training, I get a warning of: "Variables are collinear" I'm getting a training accuracy of over 90%. I'm using ...
7
votes
3answers
2k views

Bayesion priors in ridge regression with scikit learn's linear model

I'm using scikit learn's linear model to do ridge regression. Ridge regression penalizes parameters for moving away from zero. I want to penalize for moving away from a certain prior, with each ...
5
votes
2answers
3k views

SVM options in scikit-learn

Just curious about two options in the scikits SVM class. Does anyone know what scale_C and shrinking do? Not much in the ...
16
votes
6answers
22k views

Fastest SVM implementation

More of a general question. I'm running an rbf SVM for predictive modeling. I think my current program definitely needs a bit of a speed up. I use scikit learn with a coarse to fine grid search + ...

1
28 29 30 31
32