Questions tagged [scikit-learn]

Scikit-learn is a Python module comprising of simple and efficient tool for machine learning, data mining and data analysis. It is built on NumPy, SciPy, and matplotlib. It is distributed under the 3-Clause BSD license.

0
votes
0answers
10 views

SCIKIT-LEARN export results

I made a classifier with sci-kit learn. How do I deploy it on data? I see the results but I want to see the account data (in excel) that labeled it. For example I want to open an excel sheet and have ...
1
vote
2answers
15 views

Supervised learning approach - creating my own labels

****Scenario** - I have data that does not have labels but i can create a function to label the data based on behavior and deploy the model so i don't have to keep labeling the data. Is this ...
0
votes
0answers
13 views

PCA giving separated results expected (jupyter sklearn)?

I'm a complete newbie to PCA and I have 3 sets of values which I want to plot with PCA. This is what I am using: ...
0
votes
2answers
21 views

How to fit a model to the V-shaped data?

I have a dataset of chromatic and monochromatic galaxy fluxes which looks like inverted V shape as follows: ...
0
votes
0answers
20 views

Reward negative derivative on linear regression

I'm actually new to Data Science and I'm trying to make a simple linear regression with only one feature X ( which I added the feature log(X) before adding a polynomial features) on a motley dataset ...
1
vote
0answers
44 views
+50

Multicollinearity(Variance Inflation Factor). Variables to remove before doing a model

I am doing an exercise of a Machine Learning System module in python that takes a dataset of cars (cylinders, year, consumption....) and asks for a model, being the variable to predict the consumption ...
0
votes
2answers
31 views

One Hot Label Encoding Scikit_learn convert back to Data Frame

I have a data frame with 4 features and 1 target. The 4 features are 3 categorical and 1 numerical. I created X which is a new data frame for the 3 categorical features. I use one hot label encoding ...
1
vote
1answer
46 views
0
votes
1answer
14 views

Error while performing model fitting in Sklearn [closed]

I am getting the error below while performing model fitting using sklearn: ...
1
vote
1answer
35 views

Random forest classifier is predicting only one class even when the dataset is not imbalanced

This is a binary classification task, I have 15K 1's and 11K 0's (target) I have tried the following: ...
0
votes
0answers
16 views

Which models should I choose in this project? [closed]

I have a project using python which requires to predict their customer retention. The independent variables include order_date, category_name(category of the product the store sold), product_name, ...
1
vote
0answers
10 views

Prediction that a Employee can take a leave or not based on his previous track record

which prediction algorithm should I use to find the probability that an employee takes leave and come back on the specified period(i.e.does does not extend his leave). Thank You.
1
vote
0answers
18 views

Is there a documentation where it is explained why scikit-learn does not provide p-values?

Is there a documentation, paper etc. where it is explained why scikit-learn does not provide p-values/confidence levels (1, 2, 3, 4)? Note: I'm not asking about opinions, but about documentation. For ...
0
votes
0answers
16 views

How to create own dataset for SVM+HOG image classifier for custom character recognition [closed]

I am completely new to the field of machine learning and I am working on a project which requires me to recognize custom characters drawn by the user. The custom character resembles the shape of a ...
2
votes
2answers
52 views

Similarity score: Can Sklearn SVR predict values greater than 1 and less than 0?

I am using svm.SVR() from scikit-learn to apply Logistic Regression on my training data to solve a similarity problem. Using GridSearchCV, I am finding the best ...
0
votes
0answers
18 views

Pre-processing data to make predictions on deployed Sklearn model

I am new to Machine Learning. I have trained a ML model on the Diamond Prices Dataset to predict the price of a diamond given it's features (carat, cut color, clarity, etc...) I have used pickle to ...
0
votes
1answer
31 views

Accuracy of machine learning models

I started learning ML and I have some problems with evaluating / finding the accuracy of regression and classification models. Till now I used .score() in both ...
2
votes
1answer
32 views

Is there a way to put a separate line between clusters for k-Means Clustering?

k-Means Clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. here is a piece of code to perform a 2-d k-Means ...
0
votes
1answer
18 views

Principle component analysis

I have a data set that looks like the following: ...
1
vote
0answers
27 views

Using pipelines with a cross validation of several models in scikit-learn

Is there a simple way to cross-validate several models using sklearn pipelines?
0
votes
1answer
27 views

What Regresson Algorithm Would Fit This Data?

I am using regression on lottery numbers, below is the head of my database. I was wondering if anyone had a suggestions on what the best algorithm would be to use for the regression model. ...
1
vote
2answers
43 views

What exactly is a trained model for machine-learning?

I am curious about the deployment phase of a machine-learning model. So, after you run your script using python to train your millions of data and it works, what ...
1
vote
2answers
63 views

Why is r squared lowered when adding polynomial features?

I am trying to find a best fit line f(x) = ? for a random set of x,y coordinates. Linear Regression with polynomial features works well for around 10 different ...
1
vote
2answers
27 views

How do we get the baseline of each fold in cross-validation?

Given that I am using Scikit learn and cross-validation and want to compare my accuracy result for each fold with my baseline I am using 10-fold cross-validation and how for each fold I return the ...
1
vote
2answers
50 views

How to find the right regression model for my project

I tried several things to find the best regression model with the best parameters but i can't go higher than 40% right predictions. So i have 67741 rows in an excel file. the data looks like this ...
1
vote
1answer
29 views

Get how similarity between the training data and the income data?

I'am trying to use Clustering and Classification methods as SVM using scikitlearn. I'm also studying some outliers/novelty detections I want something like a semi-supervised model. I want to predict ...
0
votes
0answers
18 views

Why would one use entropy instead of Gini index in CART?

I read this question Gini Impurity vs Entropy and was wondering why would someone use entropy instead of Gini index in a decision tree with scikit-learn. Indeed, I find these arguments legit: ...
0
votes
2answers
51 views

What happens when scikit-learn does a Lasso Model?

I have started an MLS course. As a beginner and non-mathematician it has been hard. I am trying to understand the exercise about Lasso Models. I have done Lasso models on R-cran, but this is my first ...
1
vote
0answers
23 views
0
votes
1answer
28 views

What does it mean when an Actual vs Predicted plot is like this assuming you are using the best model?

I'm trying to predict the monetary value in a fixed time-frame for a project. I wanted to start with a baseline model before doing any feature engineering or advanced pre-processing. I'm using a feed-...
0
votes
1answer
21 views

How to tune parameters batch by batch?

As the title states, I am trying to cluster a huge dataset and cluster it by using sklearn.Birch to learn incrementally. If it's a small dataset, I could just use ...
0
votes
2answers
29 views

sklearn.preprocessing.MinMaxScaler: non-broadcastable output shape error

Why I am getting the following error: ValueError: non-broadcastable output operand with shape (1,1) doesn't match the broadcast shape (1,2) While executing: ...
2
votes
2answers
224 views

one-hot-encoding categorical data gives error

I am currently working on the Boston problem hosted on Kaggle. The dataset is nothing like the Titanic dataset. There are many categorical columns and I'm trying to one-hot-encode these columns. I'...
0
votes
0answers
16 views

Can one set manual adaptive learning in SGDRegressor()?

I wanted to update learning rate $r = r/2$ in each iteration of SGDRegressor(). I cannot find any way so far to update the learning rate manually. There is a choice called adaptive but it doesn't look ...
0
votes
0answers
21 views

How to reduce / avoid false predictions with sklearn and MultinomialNB?

I'm using sklearn to predict product groups from product titles. That is working very well, if the titles are similar to the ones I labeled. Simplified example: ...
0
votes
0answers
31 views

Why the accuracy decreased with more data

When working with a random forest model, it is surprising that the cross-validation score on the training dataset is much higher than the score on the whole dataset. Here is the code: ...
1
vote
1answer
28 views

Algorithms inherently supporting multilabel classification

In the documentation of sklearn, it says that several algorithms inherentrly support multilabel classification, such as RandomForest or MLP : https://scikit-learn.org/stable/modules/multiclass.html ...
2
votes
3answers
61 views

Logistic Regression doesn't predict for the entire test set

I am working through Kaggle's Titanic competition. I am mostly done with my model but the problem is that the logistic regression model does not predict for all of 418 rows in the test set but ...
1
vote
2answers
136 views

ValueError: Found input variables with inconsistent numbers of samples [43,19]

So, I've been trying to split my dataset into a 70-30 ratio using train_test_split in order to work things out with sklearn's ...
2
votes
1answer
32 views

Histograms in Machine Learning

I have a large data set with over 100k samples and I want to predict a continuous target feature from 4 other continuous features using Scikit Learn. For this project, I would like to visualize and ...
0
votes
2answers
21 views

Changing categorical data to binary data is not reflected on the dataset

I am working through the Titanic competition. This is my code so far: ...
0
votes
0answers
18 views

Cannot explain Naive Bayes prediction on toy data

I tested Naive Bayes from sklearn on the toy data from Tom Mitchell's book Machine Learning. The results are unexpected. The very first instance should be classified as "No" according to the ...
0
votes
0answers
20 views

Unsupervised learning/ clustering for data with multiple categorical variables

Dataset: I have been trying unsupervised clustering algorithms (K-modes & SOM) to cluster the students based on their grades in 3 exams. Should I one-hot encode the data (even though grades are ...
0
votes
1answer
24 views

Value error while using linear regression | ML

With reference to the below screen, I received the error: ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). For reading ...
0
votes
0answers
16 views

Building recommendation engine from transactions data

I am trying to build a recommendation engine for an e-commerce company and I have the following input files : 1) past user transactions + in-app events 2) a new list of campaigns I should recommend ...
0
votes
0answers
19 views

Probability Calibration : For 2D image data, how to use the calibration?

I have a model which takes 2D input data and does multi class classification in keras. I would like to plot the probability calibration curve. However, using the scikit function, it returns an error ...
3
votes
1answer
44 views

Classify samples based on other sample probabilities

I was wondering if there's a way to train a classifier or set up a way of classifying after that can classify certain samples as some relationship between the previous two. I notice that, for example,...
1
vote
1answer
14 views

Sensorfusion: Generate virtual sensor based on analysis of sensorsdata

I have a steam engine which is equipped with the following sensors: temperature sensor in the boiler room temperature sensor in the heating room pressure sensor in the boiler room rotations-per-...
0
votes
0answers
13 views

How to use contrast coding schemes in the case of multiclass target variable? How to encode categorical features if contrast coding fails?

How do you deal with a dataset which only has categorical variables, all of whom have high cardinality? What is the right way to encode high cardinality categorical variables if the target variable ...
0
votes
0answers
12 views

How to compute AUC in gridsearchCV for multiclass problem

I'm currently working on a multiclass imbalanced problem. I am using random forest as learner and using different methods of resampling. I would like to use ...