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
1
vote
0answers
3 views

General practices for building an incremental learning model which never forgets?

I'm new to datascience and appreciate your sage advice! I need to build an incremental learning model, and I know there's a lot that goes into something like that, but I'd like to highlight the most ...
0
votes
2answers
29 views

How can access to modify feature_importances of Random Forest Classifier model?

My goal is to extract the feature importances from already trained random forest classifier and transfer them to another classifier. How this can be done? and How can access to modify ...
0
votes
0answers
12 views

Error in using sklearn's GridSearchCV on Word2Vec

I am using the sklearn_api of gensim to create an estimator for a Word2vec model to pass it to sklearn's gridsearch . My code is as follows : ...
0
votes
0answers
17 views

Escaping from overfitting hell: introducing regularization vs increasing training data

I am trying to identify noisy intervals in geomagnetic data using logistic regression, working with scikit-learn. Here is a typical spectrum of the data that I am working with: In this example, the ...
1
vote
1answer
26 views

Multiple linear regression for multi-dimensional input and output?

Assume that I have $N$ points $x_i,i=1,...,N$ in some $A>1$-dimensional space $\mathbb{R}^A$ with pointwise evaluations of some function $f:\mathbb{R}^A \rightarrow \mathbb{R}^B$, i.e. $f(x_i),i=1,...
0
votes
1answer
23 views

Problem with PCA [closed]

I am getting the message Input contains NaN, infinity or a value too large for dtype('float64') when I run the pca.fit(X_train) ...
0
votes
0answers
10 views

How do you calculate the probability that a certain number of hyper-parameter combinations contains the optimum combination?

How do you calculate the probability that a certain number of hyper-parameter combinations contains the optimum combination? Summary I use SKLearn's RandomizedSearchCV module. It will test a certain ...
-2
votes
1answer
21 views

NotFittedError says this StandardScaler instance is not fitted yet while using inverse_transform() [closed]

I have a dataset and i have used Support Vector Regression.So i needed to use StandardScaler module from sklearn.preprocessing fro Feature Scaling. After training my model when i came to predict it ...
0
votes
1answer
16 views

How and where to set weights in case of imbalanced cost sensitive learning in machine learning?

I confront with a binary classification machine learning task which is both slightly imbalanced and cost sensitive. I wonder what (and where in the modeling pipeline, say, in sklearn) is the best way ...
1
vote
1answer
25 views

Does mini-batch gradient descent nullify the effect of stratification on the training data set?

In data pre-processing, stratified shuffle is used to ensure that the distribution of the original dataset is reflected in the training, test and validation dataset. Mini-batch gradient descent uses ...
0
votes
0answers
16 views

How to construct pipeline with different alternative transformations for different kind of features in Scikit-learn?

I try to construct a pipeline in sklearn where I do different (in some cases multiple) transformations on different kind (numeric/ordinal/binary nominal/non-binary non-ordinal nominal) features. An ...
0
votes
1answer
15 views

Sklearn Random Feature Importances Identical for Predicting Different Response Variables

I have created four random forest models they have the same X data, but their y data are four different response variables. The sklearn random forest feature importance is identical for all four. All ...
1
vote
1answer
15 views

Using sklearn knn imputation on a large dataset

I have a large dataset ~ 1 million rows by 400 features and I want to impute the missing values using sklearn KNNImputer. Trying this off the bat I hit memory problems, but I think I can solve this by ...
1
vote
0answers
29 views

Is it possible to do attribute, value extraction prediction model in Machine Learning?

Previously I asked a question at here, but it doesn't seems to be at the correct place. So, I moved it here with more details of what I've done. Here is the sample data image to be process. Start with ...
1
vote
1answer
33 views

How to interpret skimage orientation to straighten images?

I have a bunch of images that I am trying to straighten so the images are horizontal (major axis is horizontal) but I don't understand the orientation output from ...
0
votes
1answer
19 views
0
votes
0answers
13 views

Multi-class classification issue using Keras Found input variables with inconsistent numbers of samples: [20000, 4] [closed]

My goal is to create a model for detecting different brands of beer bottles. I've been following this example/tutorial https://www.kaggle.com/prateek0x/multiclass-image-classification-using-keras for ...
0
votes
1answer
17 views

create sequence of non dictionary words

I have a few word vectors- recvfrom,sendto,epoll_pwait,recvfrom,sendto,epoll_pwait getuid,recvfrom,writev,getuid,epoll_pwait,getuid Now i want to tokenized them ...
0
votes
0answers
21 views

Custom Transformers (Class) not working together in ColumnTransformer while do separately [closed]

I'm preprocessing a dataframe of different films. I have the following transformers (scikit-learn classes): ...
1
vote
0answers
24 views

How to plot centroids and clusters resulting from a KMean model based on a text variable

I hope you can help as after several attempts, I'm no longer sure I can get a decent result. I have a text corpus made of several documents, like the one below (which has been simplified for the sake ...
0
votes
1answer
15 views

how to assign back categorical variables to train and test data after training and testing using inverse_transform?

how to assign back categorical variables to train and test data after training and testing using inverse_transform? Like training and testing, data will have encoded numerical values. So, how to ...
1
vote
2answers
35 views

How to extract true positives data (complete row with data) after training and testing from test dataset?

How do you extract true positive data from testing data after training and testing? For example, in the test data, I have two rows and one row is true positives and the other is false negatives. ...
0
votes
0answers
23 views

Importance of Underlying mathematics behind AdaBoost, Gradient Boost and other Machine learning techniques

I am trying to understand how important is it to know the mathematical formula under the hood of these techniques, from interview and job(or practical application) point of view. For example I know ...
1
vote
1answer
33 views

How to find farthest data points from a predefined cluster in a data set with Python?

I have a data set where certain rows are labeled as one class (and interpreted as distinct cluster #1 as such), but other points are either unlabeled or ambiguous. Hence I want to figure out which ...
0
votes
1answer
33 views

Single image feature reduction at inference time : SVM

I am trying to train a SVM classifier using scikit-learn.. At training time I want to reduce the feature vector dimension. I have used PCA to reduce the dimension. ...
1
vote
1answer
42 views

Criteria used to create and select leaf nodes in sklearn

I just want to know the details of what (and how) is the criteria used by sklearn.tree.DecisionTreeClassifier to create leaf nodes. I know that the parameters ...
0
votes
1answer
17 views

MLP classifier Gridsearch CV parameters to tune?

I'm looking to tune the parameters for sklearn's MLP classifier but don't know which to tune/how many options to give them? Example is learning rate. should i give it[.0001,.001,.01,.1,.2,.3]? or is ...
0
votes
2answers
31 views

Feature scaling for MLP neural network sklearn

I am working with a dataset that has multiple scales for my features. Before running sklearn's MLP neural network I was reading around and found a variety of different opinions for feature scaling. ...
0
votes
0answers
20 views

Plotting scikit-learn confusion matrix returns no values in the last class

I am attempting to create a confusion matrix using Scikit-Learn for a multiclass classification CNN, and it works well except for the fact that it does not provide ...
0
votes
1answer
22 views

Using word embeddings with additional features

I have the set of queries for classification task using Gradient Boosting Classifier of scikit learn. I want to enrich the model by feeding additional features along with GloVe. How should I approach ...
0
votes
0answers
24 views

How can we perfrom pre fitted standard scalar inverse transform on y variable in pipeline

I want to create pipeline which will inverse transform the y variable after model prediction I have 3 pickle files: X variable scalar transform pre fitted object :-X sclr Y variable scalar transform ...
0
votes
1answer
45 views

How to grid search feature selection and neural network hyperparameters in the same grid?

I'm using the GridSearchCV () class from scikit to perform hyperparameter optimization in a sequential neural network. I've built a pipeline to also find the best ...
3
votes
1answer
48 views

Is it possible to have stratified train-test split of a set based on two columns?

Consider a dataframe that contains two columns, text and label. I can very easily create a stratified train-test split using ...
1
vote
1answer
15 views

how to create sklearn pipeline object using predtrained standardscalar object

I am having pretrained Sklearn model and pre-trained Standard scalar object saved as pickle . And now I want to create Sklearn pipeline using both of it. I need sklearn pipeline to convert it into ...
0
votes
0answers
7 views

Feature selection to improve quadratic discriminant analysis score

I have to solve a multiclass classification problem in python, I'm using scikit-learn. My dataset has got 8000 rows and 21 columns (20 features + 1 class)and my goal is to achieve a certain value of ...
2
votes
0answers
16 views

Identifying persistent clusters within a series of graphs

The task is to identify persistent clusters, i.e., groups of nodes that "persist" as clusters (tend to form a cluster) in a series of graphs. This is how I approached the problem: I form a ...
1
vote
1answer
40 views

Function extrapolation

I have a list [1.0, 0.488, 0.300, 0.213, 0.163, 0.127] Plot (dont have enough reputation to post an image) I need to extrapolate this function for 15 more points ...
0
votes
0answers
12 views

Predicting next day value

I am new to Data Science and I am trying to solve this problem. It is a problem of supervised learning. I have a dataset that for every day of a time interval, for every defined geographic point, has ...
3
votes
2answers
62 views

Is Label Encoding with arbitrary numbers ever useful at all?

From what I read online, there seems to be some confusion regarding the taxonomy and the terms used, so to avoid misunderstanding I'm going to define them here: Label Encoding - encoding a nominal ...
0
votes
0answers
28 views

Understanding the K-means clustering result in Python Scatter plot

I'm a newbie in machine learning and I am trying each models. I’d like to perform unsupervised learning to see a cluster. Considering a data set of ice cream company where it has flavor, rating, size. ...
0
votes
0answers
23 views

Cross-Validation in Anomaly Detection with Labelled Data

I am working on a project where I train anomaly detection algorithms Isolation Forest and Auto-Encoder. My data is labelled so I have the ground truth but the nature of the problem requires ...
0
votes
1answer
15 views

How should I choose n_features in FeatureHasher in sklearn?

How should I choose n_features in FeatureHasher in sklearn ? assume that I have 1000 categories in feature "case" and I want to hash them
1
vote
2answers
79 views

Logistic regression does cannot converge without poor model performance

I have a multi-class classification logistic regression model. Using a very basic sklearn pipeline I am taking in cleansed text descriptions of an object and classifying said object into a category. <...
1
vote
0answers
15 views

How to assess nested cross validation results in comparison to non-nested results?

I have a nonlinear regression model scoring genes from scores between 0 to 1 as to whether they are likely to cause disease. Training data is ~700 gene samples by 53 features. Currently I get results ...
3
votes
2answers
54 views

How to perform feature selection on dataset with categorical and numerical features?

I am working on a dataset with 30 columns (29 numerical, 1 non-ordinal categorical). I hot-encoded the categorical feature and reached at 35 columns. To improve training efficiency, I want to perform ...
2
votes
1answer
13 views

How to restrict the columns to be passed to final classifier in PMML Pipeline

I am working on building XGBoost PMML using SKLearn and SKLearn2PMML. I am having some numerical,somecategorical and datetime columns from which i am creating new feature inside the pipeline. When i ...
1
vote
2answers
45 views

How to find correlation between categorical data and continuous data

I'm working on imputing null values in the Titanic dataset. The 'Embarked' column has some. I do NOT want to just set them all to the most common value, ...
1
vote
1answer
19 views

Got some troubles with using OneHotEncoder to multiple categories

I'm trying to get the final pipeline on the titanic dataset(Example was taken from the 'Hands-on ML' book). ...
1
vote
1answer
18 views

How do reshape an image to fit my Mnist Convolutional model?

I have done research but cannot seem to find what's wrong here I have created this model for Mnist digit clasification : ...
2
votes
1answer
14 views

variance threshold, returning the names of the selected features

I am trying the variance threshold method for the first time and I am following the example in sklearn to work on it. ...

1
2 3 4 5
32