Questions tagged [scikit-learn]

For questions related to the Python's package scikit-learn (or sklearn).

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Is this the correct method for how to implement a stratified K fold with grid search SVC?

I'm writing a support vector classifier for a binary class using some toy data. This is the code: ...
0
votes
0answers
13 views

Is it possible that k-means generates a cluster with no points in it, if the initial centroid is not properly set and no of cluster is large?

Is it possible that sklearn's k-means algorithm will generate a cluster that has no points at all, given that the number of k is large and the initial centroid is just random? Furthermore, will k-...
0
votes
0answers
33 views

What is the best machine learning algorithm for clustering dots based on coordinates $(x,y)$ with consideration of weight of the points?

I'm looking for a machine learning algorithm for clustering points based on their coordinates. Furthermore, I want to take into consideration the weights of each point. Suppose there is a weight in ...
0
votes
0answers
6 views

Predicting single floats based on set of 2 feature arrays each of 100 values

I am trying to predict audio to video desynchronization based on ser od two arrays of lenght 100 which consist of coresponding audio and video samples. The problem is that my labels are single floats (...
0
votes
1answer
59 views

Do I need to tune the hyper-parameters or more data if SVR model performs poorly?

I am using non-linear data to SVR and have tried tuning the hyperparameters and still have a poor model performance. Do I need more data or format the data for more suitable results? I get similar ...
2
votes
0answers
23 views

How matrix factorization helps with recommendations when it converges to the initial user-items matrix?

We can say that matrix factorization of a matrix $R$, in general, is finding two matrices $P$ and $Q$ such that $R \approx P.Q^{T}$ with some constraints on $P$ and $Q$. Looking at some matrix ...
0
votes
0answers
17 views

Can I use the phi coefficient to compare predictions by two different classifiers?

Can I use the Matthews correlation coefficient (aka phi coefficient) to compare predictions by two different classifiers? That is, is this code correct if I want to check how diverse/correlated my two ...
0
votes
0answers
12 views

Preprocessing deterministic data with sklearn

I am trying to create a set of ML models that will serve as a replacement for a complex deterministic simulation. The simulation requires 4 inputs (x1, x2, x3 and x4) to determine 4 different outputs (...
0
votes
0answers
62 views

How to use Product Matching to create Product Bundles

I am working on a product matching model. GOAL A store has many products like creams, perfumes, other beauty products. Based on product properties I have to create bundles of it so we can sell more ...
4
votes
0answers
265 views

When computing the ROC-AUC score for multi-class classification problems, when should we use One-vs-Rest and One-vs-One?

The sklearn's documentation of the method roc_auc_score states that the parameter multi_class can take the value ...
2
votes
1answer
146 views

Why isn't my decision tree classifier able to solve the XOR problem properly?

I was trying to solve an XOR problem, and the dataset seems like the one in the image. I plotted the tree and got this result: As I understand, the tree should have depth 2 and four leaves. The ...
0
votes
1answer
47 views

Train a model using a multi-column text-filled excel sheet

I have an excel sheet filled with my own personal appreciations of movies I've watched, and I want to use it to train an AI model so that it can predict if I'll like a specific movie or not, based on ...
2
votes
0answers
54 views

Suitable deep learning algorithms for spatial / geometric data

I have a task of classifying spatial data from a geographic information system. More precisely, I need a way to filter out unnecessary line segments from the CAD system before loading into the GIS (...
1
vote
1answer
103 views

Interpretation of feature selection based on the model

The description of feature selection based on a random forest uses trees without pruning. Do I need to use tree pruning? The thing is, if I don't cut the trees, the forest will retrain. Below in the ...
1
vote
0answers
59 views

How can I split the data into training and validation sets such that entries with a certain value are kept together?

I have the following kind of data frame. These are just example: A 1 Normal A 2 Normal A 3 Stress B 1 Normal B 2 Stress B 3 Stress C 1 Normal C 2 Normal C 3 Normal ...
3
votes
2answers
1k views

Can ML be used to curve fit data based on dataset of example fits?

Say I have x,y data connected by a function with some additional parameters (a,b,c): $$ y = f(x ; a, b, c) $$ Now given a set of data points (x and y) I want to determine a,b,c. If I know the model ...
2
votes
1answer
61 views

Is it compulsary to normalize the dataset if doing so can negatively impact a Binary Logistic regression performance?

I am using raw data set with 4 feature variables (Total Cholesterol, Systolic Blood Pressure, Diastolic Blood Pressure, and Cigraeette count) to do a Binominal Classification (find stroke likelihood) ...
1
vote
0answers
67 views

How can I use gradient boosting with multiple features?

I'm trying to use gradient boosting and I'm using sklearn's GradientBoostingClassifier class. My problem is that I'm having a data frame with 5 columns and I want ...