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.

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

How to encode an array of categories to feed into sklearn

I'm working on a recommendation problem, broadly following the Youtube paper on theirs. Their surrogate problem is to recommend the next video a user will watch. One feature they include in their ...
0
votes
0answers
15 views

Regression Task - Spark, PyTorch, TensorFlow or scikit

I know it's a broad question, sorry for that, but I'm still testing the waters with machine learning. I have a typical regression task (predict target numbers with the help of features x,y,z) and a ...
0
votes
3answers
35 views

How to combine GridSearchCV with Early Stopping?

I'm a beginner in machine learning and want to train a CNN (for image recognition) with optimized hyperparameter like dropout rate, learning rate and number of epochs. The optimal hyperparameter I ...
1
vote
2answers
24 views

Is it possible to know the output vectors of MLP Classifier of scikit learn?

I'm a beginner with scikiti-learn library. I have an ANN with 3 input, 2 hidden layers and 3 output. ...
0
votes
1answer
10 views

sklearn.feature_selection vs xgboost feature_importances?

sklearn.feature_selection vs xgboost feature_importances Can somebody explain in-detailed differences between sklearn.feature_selection and xgboost feature_importances? And how the algorithms work ...
1
vote
1answer
27 views

Why are my Decision Tree Leafs not pure?

I'm making a using DecisionTreeClassifier from SKlearn (v0.21.3) with its default settings, using Python. I do not want regularize it in any way, I want it to ...
0
votes
0answers
9 views

Problem with param_name in validation_curve while using Pipeline

I have got problem with sklearn function called validation_curve. ...
0
votes
0answers
18 views

Why XGBoost regressor predicts behavior but not the amplitude?

I am very new to machine learning and I am trying to use XGBoostRegressor for my machine learning model (it has to do with physical modeling). I found out that it works very well for predicting the ...
0
votes
0answers
9 views

Combining two CRF-models with sklearn-crfsuite

I'm experimenting with a concept I saw in this research paper. That is, first I train a CRF-model for named entity tagging, then I do implement an identical model, except for that one also takes the ...
1
vote
2answers
25 views

GridSearchCV vs RandomSearchCV and How it works?

GridSearchCV vs RandomSearchCV Can somebody explain in-detailed differences between GridSearchCV and RandomSearchCV? And how the algorithms work under the hood? As per my understanding from the ...
0
votes
0answers
6 views

SGDClassifier partial_fit() for online learning - is one step of gradient descent enough?

I'm interested in incremental (online) learning for my logistic regression model trained with SGDClassifier. Basically updating the model as more labeled data comes ...
2
votes
1answer
64 views

Is there any optimal way on feature selection for more than one classification algorithms?

I have a wine dataset with 13 features that indicates 3 different wine classes (target), and k-NN, SVM with linear kernel and SVM with rbf kernel algorithms to be tried with this dataset. My goal is ...
3
votes
0answers
20 views

What is the scikit learn Non-negative Matrix Factorisation Coordinate Descent algorithm?

What is the scikit-learn Coordinate Descent (CD) algorithm for Non-negative Matrix Factorization (NMF)? The sklearn implementation of NMF has two different solvers, Coordinate Descent and ...
0
votes
0answers
10 views

Testing if a sample fits into an existing cluster

I have a sample of data I'd like to create a model from, which would create N clusters. After the fitting to clusters, I'd like to test various samples against the existing clusters, seeing if the ...
0
votes
1answer
23 views

Permutation feature importance vs. RandomForest feature importance

What is the difference between Permutation feature importance vs. RandomForest feature importance? What are the disadvantages vs. advantages of the two techniques?
1
vote
0answers
13 views

Using a trained classifier in an Android app

As the title suggests, I'm attempting to train some different classifiers into an android app. The main question I have is how to represent the different models in a neat and effective way, from ...
1
vote
1answer
19 views

How to interpret ANOVA results?

I am trying to identify what attributes are not relevant in my dataset to remove them before fitting a classifier. The target is a categorical variable with three different values. I also have a lot ...
3
votes
2answers
200 views

Need machine learning algorithm to fill in time-series data

I am currently dealing with a time-series data set with cyclical gaps every 30 minutes (30 minutes of data, 30 minutes of no data). Is there a relatively simple way of using scikit-learn (or some ...
0
votes
0answers
20 views

Multi-class classification with custom loss matrix?

Suppose I have classes A,B,C and some predictors. I want to minimize the loss function where the loss penalties are arbitrary penalties applied to each possible misclassification e.g.: $$L = \begin{...
1
vote
0answers
23 views

Linear Regression on data with bimodal outcome

I have a data set with 3,000 features and continuous dependent variables of time with 18,000 instances. The histogram of the dependent variables show that the they have a bimodal distribution. I am ...
0
votes
0answers
17 views

How do I get confidence intervals for an ElasticNet in sklearn?

I need to produce a row for the confidence interval for every field that I am calculating coefficients and scores off of. So here is my code so far- ...
0
votes
0answers
23 views

how to use sklearn without feature selection

I am trying to study the effect of using feature selection onmy text classification code . I want to make a rating without any feature selection, but sklearn use document frequency (df) by default ...
0
votes
1answer
20 views

TypeError: 'GridSearchCV' object is not callable - how do I use a pickle of an SVM (Scikit-learn)?

I have created an SVM in Scikit-learn for classification. It works; it prints out either 1 or 0 depending on the class. I converted it to a pickle file and tried to use it, but I am receiving this ...
4
votes
2answers
185 views

Training a model sample by sample

I'm training a Scikit model but it seems that in all examples, they call the fit method on the entire training set. What I want to do however is call it per sample (...
0
votes
1answer
47 views

Increase accuracy of classification problem [closed]

I am trying to build a classifier that predicts the compiler given some operations of assembly code. Here is the pandas dataframe: What I do is using a TfidfVectorizer and select the features that ...
1
vote
1answer
37 views

How do I force specified coefficients in a Linear Regression model to be positive?

Looking for a way to do this in Python. scipy.optimize.nnls forces all coefficients to be positive. Some additional context: I have a data frame with a some explanatory variables and a response ...
0
votes
0answers
12 views

can i get weights per iteration of MLP?

im building an mlp with scikit learn. Is there a way I can access weights and biases of the output layer per iteration? There is an option mlp.coefs_ But it ...
0
votes
1answer
21 views

Applying Standardization OLS estimator

I have basic understanding of how to perform linear regression with sklearn and statsmodels. There are several questions that I would like to ask regarding Linear Regression (OLS estimator) : Is ...
0
votes
0answers
20 views

token_pattern in CountVectorizer?

I have a question about this piece of a program: ...
0
votes
0answers
19 views

Have installed Sklearn but issues with it

Installed Sklearn on my workspace and anytime I try importing any of the packages I get an error message. Like the image above, I tried importing the train_test_split package from Sklearn to train and ...
0
votes
1answer
53 views

Building an efficient feature vector

I am building a classifier for malware analysis, which predicts if I have a malware by looking at the intructions of an assembly code, such as push, mov,... and predicting the optimization method. ...
1
vote
1answer
34 views

Scikit model is not able to predict sequence correctly

I am trying to create a regression model using scikit-learn for predicting car price. The input data are, car model(trim), kilometers used, past resale price of similar car and age of used car. I am ...
3
votes
1answer
104 views

Difference between learning_curve and validation_curve

What is the difference between these two curves: learning_curve and validation_curve ?
0
votes
2answers
20 views

How to Keep Missing Values in Ordinal Logistic Regression

I’m using mord package in python to do ordinal logit regression (predict response to movie rating 1-5 stars). One of my predictor variables is also ordinal but ...
0
votes
2answers
30 views
-1
votes
0answers
19 views

How to check if survey is done by bot / random or real human

I want to make a model that will recognize answers in a survey that are given without thinking / like a bot / automatic ... You know that sometimes, people give random answers when they are doing ...
1
vote
1answer
56 views

Selecting features for malware analysis

I am trying to build a classifier that detects if I have a malaware by predicting the provenance compiler. To do so I have a dataset composed of assembly code in json format : In particular, I want ...
0
votes
0answers
5 views

SVM, which range to use when normalizing

I am using the SVM classifier from Scikit Learn. I was wondering is there is a know-best-practice when it comes to normalization. I'm using different normalization tecniques, but all my normalized ...
0
votes
0answers
36 views

PCA scikit-learn - ValueError: array must not contain infs or NaNs

I use PCA from from sklearn.decomposition to reduce data dimension. ...
0
votes
2answers
20 views

Sklearn LocalOutlierFactor contamination parameter

Can anyone provide an intuitive explanation of the choice of contamination parameter used in sklearn's LocalOutlierFactor implementation when ...
1
vote
2answers
33 views

Majority voting in scikit-learn Random forest

My main concern is that i need to understand that how does the random forest do majority voting in scikit learn source code. I did not find that specific code in source code of RandomForest. if ...
-1
votes
0answers
12 views

How To Do Cluster Analysis with a Categorical Index Column?

I have This DF : Amount_A Pos Code 0012 1251 10 0211 154 5 0321 35465 6 The Code Column is a category but i need it to do my ...
4
votes
1answer
47 views

TS-SS and Cosine similarity among text documents using TF-IDF in Python

A common way of calculating the cosine similarity between text based documents is to calculate tf-idf and then calculating the linear kernel of the tf-idf matrix. TF-IDF matrix is calculated using ...
2
votes
0answers
14 views

Temporal outlier Analysis on sensor data

I am working to find anomaly/outliers in sensor data using unsupervised machine learning (without training dataset). I have around 20000 samples taken per minute of various sensors. I just need to ...
0
votes
0answers
14 views

Workaround on using Grid Search when we have scipy.sparse.csr.csr_matrix

I am reviewing some techniques based on scikit-learn and I would like to check what are the best parameters for SVM using Grid Search. The thing is that I don't know how to use Grid Search to the ...
1
vote
0answers
17 views

How to use a custom objective function?

The following is what I'm trying to accomplish: I have a charity contact data set. Each contact has features such as sex, age and so on, which we define as X. Now we are doing a solicitation ...
1
vote
1answer
31 views

What to do with large number of collinear variables?

I have this time-series dataset that has 63 features, out of which 57 were manually engineered. While checking for collinearity, I get this correlation matrix: As can be seen there are a number of ...
0
votes
0answers
6 views

Pipeline that cached the results

I use pandas to do feature extraction for machine learning. I hope to achieve the following: Consider I have five data processing steps done sequentially, and I execute it once, the results will be ...
0
votes
1answer
25 views

Explaining feature_importances_ in Scikit Learn RandomForestRegressor

For a project, I used the feature_importances_ attributes from the RandomForestRegressor. Everything works well but I don't know ...