New answers tagged scikit-learn
2
votes
How to Scale target feature
You should fit your scaler only on train data, and then transform the test data with the fitted scaler. You should avoid fitting the scaler with the test data, since if you do that you would have a ...
0
votes
Poisson regression options in python
You can use PoissonRegressor or even RandomForestRegressor in sklearn.
I think you can use common other regressor too, it is not problem, it is base on your evaluation metrics.
1
vote
Why use fit when already have fit_transform?
A relatively late answer, but it is also very convenient to first fit all the data then during the deep learning training loop ...
0
votes
Is there a way to force a transformer to return a pandas dataframe?
The following code snippet returns a Pandas DataFrame, but overwrites the original DataFrame values:
...
1
vote
Isolation Forest Feature Importance
Interpretable Anomaly Detection with DIFFI: Depth-based Isolation Forest Feature Importance
The Isolation Forest is one of the most commonly adopted algorithms in the field of Anomaly Detection, due ...
0
votes
How to get different results running sklearn's MeanShift in a single program? (Python3)
A couple of work arounds:
1- Set bin_seeding to True, and/or using random seeds at each iteration.
2- Shuffling the data at each iteration.
0
votes
Which algorithm is used in sklearn SGDClassifier when modified huber loss is used?
The modified Huber loss is equivalent to a quadratically smoothed SVM with gamma = 2.
See also https://www.quora.com/What-algorithm-is-used-in-sklearn%E2%80%99s-SGDClassifier-when-a-modified-huber-...
0
votes
Can anyone explain why there is an error?
You are manually implementing train/test split. It is better to use scikit-learn's train test split function.
...
0
votes
Generating synthetic data based off existing real data (in Python)
One option is the Python package imblearn which contains the SMOTE algorithm. SMOTE generates synthetic samples from a real dataset by interpolating plausible new datapoints based on observed data.
0
votes
How to perform entity level train-val-test split for NER task?
I know it's a bit late, but I had the same question and developed a method which is available here:
...
2
votes
What mean a column in zero in confusion matrix?
The entry $[i, j]$ in a confusion matrix is the number of times the class $j$ was predicted while the correct class was $i$.
For example, $C[1, 1]$ is the number of times your model correctly ...
0
votes
Accepted
What mean a column in zero in confusion matrix?
If the plot is correct, it means the model never gives any predictions label of 1 and 2.
4
votes
Accepted
What are the differences between the below feature selection methods?
They are not the same.
As the name suggests, "recursive feature elimination" (RFE) recursively eliminates features, by fitting the model and throwing away ...
Top 50 recent answers are included
Related Tags
scikit-learn × 2124python × 957
machine-learning × 719
classification × 235
random-forest × 166
regression × 135
pandas × 135
decision-trees × 134
clustering × 116
svm × 106
cross-validation × 99
linear-regression × 82
feature-selection × 81
keras × 76
logistic-regression × 76
neural-network × 73
nlp × 66
multiclass-classification × 64
predictive-modeling × 60
k-means × 58
class-imbalance × 51
deep-learning × 50
machine-learning-model × 49
xgboost × 47
hyperparameter-tuning × 44