People who code: we want your input. Take the Survey

Questions tagged [scikit-learn]

scikit-learn is a popular machine learning package for Python that has simple and efficient tools for predictive data analysis. Topics include classification, regression, clustering, dimensionality reduction, model selection, and preprocessing.

Filter by
Sorted by
Tagged with
0
votes
1answer
211 views

Running sklearn trained classifier in a windows machine without Python

I have a classifier (and vectorizer) that I can export as a pickled model. I am using Python. This is on my local machine. Now, in order to perform the classifications in "production" I need to be ...
6
votes
2answers
10k views

Is there a R implementation of isolation forest for anomaly detection?

Is there a R implementation of isolation forest for anomaly detection? Similar to the implementation from sklearn.
1
vote
1answer
110 views

Preparing data, choosing algorithm

First off, I am new to machine learning, so these questions may be trivial. Basically I am trying to tune an object with numeric knobs and numeric outputs. By doing a brute force tuning (permutations)...
1
vote
1answer
1k views

How to detect the match precision of OneVsRestClassifier

I've improved my text classification to topic module, from simple word2vec to piped tfidf and OneVsRestClassifier (using sklearn). It does improve the classification but with word2vec I was able to ...
1
vote
2answers
8k views

How can I know how to interpret the output coefficients (`coefs_`) from the model sklearn.svm.LinearSVC()?

I'm following Introduction to Machine Learning with Python: A Guide for Data Scientists by Andreas C. Müller and Sarah Guido, and in Chapter 2 a demonstration of applying ...
0
votes
1answer
3k views

Predict the date an item will be sold using machine learning [closed]

I would like to predict the date a item will be sold using features such as: ...
-1
votes
1answer
177 views

Sklearn regression problem

I try to fit a data matrix X to an output vector y with a regression model in sklearn. I have some training data and some test data, where the score is the RMSE. So my best score I achieved with SVR, ...
0
votes
1answer
3k views

RandomForestClassifier : binary classification scores

I am using sklearn's RandomForestClassifier to build a binary prediction model. As expected, I am getting an array of predictions, consisting of 0's and 1's. However I was wondering if it is possible ...
3
votes
1answer
3k views

Pandas categorical variables encoding for regression (one-hot encoding vs dummy encoding)

Pandas has a method called get_dummies() that creates a dummy encoding of a categorical variable. Scikit-learn also has a OneHotEncoder that needs to be used along with a LabelEncoder. What are the ...
1
vote
1answer
414 views

Which type of regression has the best predictive power for extrapolating for smaller values?

I have a data set which deals with response variable in the order of 10-20. The scatter plot for such a regression appears linear, but the problem being when I predict for test cases using values very ...
7
votes
1answer
2k views

Reproducing randomForest Proximity Matrix from R package in Python

I am trying to port this little piece of R code to python: ...
1
vote
1answer
1k views

scoring argument in scikit-learn LassoCV, LassoLarsCV, ElasticNetCV

I was looking at the arguments in the linear regularization methods with cross validation within scikit-learn. RidgeCV has an argument scoring which is None by default but one can use a custom scorer (...
3
votes
1answer
510 views

Adding more features in SVC leading to worse performance, even w/ regularization

I have a relatively small dataset of 30 samples with binary labels (16 positive and 14 negative). I also have five continuous features for each these samples. I'm trying to use the support-vector ...
25
votes
3answers
32k views

How to deal with string labels in multi-class classification with keras?

I am newbie on machine learning and keras and now working a multi-class image classification problem using keras. The input is tagged image. After some pre-processing, the training data is represented ...
1
vote
0answers
215 views

Scikit Learn Latent Dirichlet Allocation overload my SWAP and/or RAM

1) After using LDA of scikit learn I realized it overloads the swap, but never reach more than 20% of the RAM. Do you have any idea why ? I can't really see if this is a problem, but still I would ...
4
votes
1answer
622 views

Implementing PatterNet in Python as it is in MATLAB

NOTE: This question was first posted in Cross Validated Stack Exchange but I was instructed to move it off that website as it was not a good fit. I am new in implementation of machine learning, neural ...
3
votes
2answers
4k views

Outlier detection by unsupervised algorithm: Fraud Detection

I have set of 300,000 set of rows with credit card transactions and my job is to find outliers (suspicious transactions) in those dataset. I have created around 5 features (All continuous data, with ...
4
votes
2answers
527 views

Can I do incremental learning with the sklearn implementation of Linear Discriminant Analysis

I have a large number of pictures that I would like to use LDA on. However, it requires too much memory, so I was wondering if it would be possible to make the learning incremental, using a sklearn ...
1
vote
0answers
627 views

Consistently inconsistent cross-validation results that are wildly different from original model accuracy

I have a question about cross-validation using sklearn in Python (2.7). I have updated this to include the code I use prior to cross-validation. I import a csv into a dataframe. Some of these ...
3
votes
3answers
9k views

PCA before K-mean clustering

If I applied PCA on feature vectors and then I do clustering, such like following: ...
4
votes
1answer
1k views

Why the estimated Lasso coefficients of almost all variables are equal to zero?

I would greatly appreciate if you could guide me. In fact, I used "Bayesian Optimization " to tune hyper-parameters of Lasso but the estimated Lasso coefficients of almost all variables are equal to ...
1
vote
1answer
839 views

Format for X_train in keras using theano

I want to try out Keras (Theano backend) for regressions after already using sklearn. For this I uses this nice tutorial http://machinelearningmastery.com/regression-tutorial-keras-deep-learning-...
5
votes
2answers
2k views

How can I use variable length inputs to train a regression model?

I'm working predicting a value $y \in \mathbb{R}$ from the value of $x_{n+1}$, where $n$ is the number of samples ($x_{i \in [1,n]}$) used for training. Each training sample $x_{i}$ is a time series ...
1
vote
0answers
166 views

predict rank from physical measurements with various lengths

I have physical measurements with length 2*n, where the first vector represents a charge or a capacity (in Coulomb) $C$ and the second one is a voltage $V$. Let's call this measurement "forming". A ...
0
votes
1answer
46 views

Scikit-Learn - Learned model description?

Is there a way I can "look inside" a model once it's trained? For example, if I train a spam filter with a multinomialNB, is there a way I can extract which words ...
1
vote
2answers
280 views

Weights in scikit-learn metric functions

Most of the scikit-learn metric functions have an option to take into account sample weights. What is the purpose or use case to use this options? Unbalanced ...
0
votes
1answer
649 views

Back propagation and Structure of a Neural Network in scikit-neuralnetwork

I am trying to learn Neural Networks using scikit-neuralnetwork framework and I know basics about Neural Networks and now trying to implement it with scikit-learn. but I am confused on 2 points. 1- ...
4
votes
2answers
10k views

Learning rate in logistic regression with sklearn

In sklearn, for logistic regression, you can define the penalty, the regularization rate and other variables. Is there a way to set the learning rate?
3
votes
2answers
43k views

Could not convert string to float error on KDDCup99 dataset

I am trying to perform a comparison between 5 algorithms against the KDD Cup 99 dataset and the NSL-KDD datasets using Python and I am having an issue when trying to build and evaluate the models ...
0
votes
2answers
3k views

Is standardization needed before using scikit-learn SVM?

I am using the SVM function provided by scikit-learn. I would like to know whether I need to perform standardization before fitting the model. As I know, LibSVM ...
12
votes
4answers
17k views

Interpreting Decision Tree in context of feature importances

I'm trying to understand how to fully understand the decision process of a decision tree classification model built with sklearn. The 2 main aspect I'm looking at are a graphviz representation of the ...
4
votes
2answers
21k views

Found input variables with inconsistent numbers of samples

I would appreciate if you could let me know how to resolve this error: Code: ...
3
votes
1answer
14k views

MinMaxScaler broadcast shapes

I use a neural network with 3 inputs and 1 output with Keras. I'm using MinMaxScaler from sklearn to normalize my inputs in the range [0,1] my input shape is (XX,3) my output shape is (XX,1) I don't ...
1
vote
3answers
3k views

What should I use if I have millions of possible values for a feature in a sklearn predictive model?

I am trying to create a large model. One of the features is categorical, and it has almost 100 million entries. I have looked at sklearn LabelEncoder, but I am concerned that it will still create an ...
4
votes
2answers
921 views

Performance difference between decision trees and logistic regression when one of the features is a string

I have a set of features, one of which is a string. I convert the string to an integer by treating the string as a base 36 number (I only use the first 13 characters). Then I can use DecisionTrees ...
-1
votes
1answer
1k views

KMeans clustering to help label Multi-class Supervised model

EDITED: Is it accepted practice to be able to use a KMeans clustering algorithm to help label data fed into a supervised model? (Unsupervised --feeds-> supervised)? The reason being, relabeling ...
1
vote
0answers
885 views

data type (int vs float) with sklearn models

I have a rather general question. I am trying to create a classification model and my training data consists of various variables. I have figured out that it would be most efficient if I convert all ...
0
votes
2answers
559 views

Python SVM rgb cluster

This is the distribution of my data. I want to use SVM with only one 'circle' to cluster most of the 0. I tried to run it with the code ...
1
vote
2answers
4k views

Binary Classification on small dataset < 200 samples

I have a dataset consisting of 181 samples(classes are not balanced there are 41 data points with 1 label and rest 140 are with label 0) and 10 features and one target variable. The 10 features are ...
1
vote
0answers
88 views

Can I use manifold learning to transform the feature set as a substitute of graph kernel of SVC

I just wonder since the manifold learning under scikit-learn has component of graph-based transformation (e.g. Shortest-path graph search under Isomap) I can then transform the feature data set (i.e. ...
1
vote
1answer
31 views

What is the general approach I can use to predict whether a domain is related to a brand using a supervised learning algorithm?

I have a number of domain names that may or may not be related to a particular brand. For instance, if the brand is UPS, www.upssucks.com, www.upspackagesupplier.com, and www.ihateups.com might all ...
6
votes
2answers
14k views

How to determine feature importance while using xgboost in pipeline?

How to determine feature importance while using xgboost (XGBclassifier or XGBregressor) in pipeline? ...
0
votes
3answers
1k views

Clustering of numerical data

I am trying to do clustering in my dataset which has 4 numerical fields. Please find the file attached : http://www.filedropper.com/example_3 I tried with this code: ...
-1
votes
1answer
48 views

How to optimize the allocation of product aquisition

The scenario is purchasing of a product or raw material from multiple suppliers on a regular basis, and the problem is how to best allocate order quantities among the suppliers. For example need 100 ...
1
vote
1answer
599 views

sklearn RandomForestRegressor oob_score_ looks wrong?

I am a newbie to datascience. I installed the Jupyter notebook and was trying to create model for the kaggle titanic dataset. Below is the code I wrote - ...
0
votes
1answer
182 views

Failure tolerant factor coding

There are a lot of ml-algorithms which cannot directly deal with categorical variables. A very common solution is to apply binary (dummy-) coding to still properly handle the categorical nature of ...
3
votes
1answer
1k views

How to force DecisionTreeRegressor to use polyfit equation instead of mse at leaf level in python SKlearn

I am using python SKlearn DecisionTreeRegressor for my data. As DecisionTreeRegressor defines constant data at leaf node, my prediction is looking like a step, instead I wanted to force polyfit ...
3
votes
1answer
2k views

roc_auc score GridSearch

I am experimenting with xgboost. I ran GridSearchCV with score='roc_auc' on xgboost. The best classificator scored ~0.935 (this is what I read from GS output). But now when I run best classificator ...
0
votes
1answer
986 views

Syntax error in pandas dataframe slice in my sklearn data prep?

I'm new to sklearn and having trouble formatting the data to predict and evaluate a confusion matrix. I'm using this Random Forest tutorial. Here is my code ...
2
votes
1answer
284 views

What are some good error metrics for multi-label (not mutli-class) problem in industry?

What are some good error metrics for multi-label (not mutli-class) problem in industry? http://scikit-learn.org/dev/modules/multiclass.html

1
31 32
33
34 35
37