New answers tagged

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 ...
user avatar
  • 489
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.
user avatar
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 ...
user avatar
  • 11
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: ...
user avatar
  • 101
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 ...
user avatar
  • 2,336
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.
user avatar
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-...
user avatar
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. ...
user avatar
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.
user avatar
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: ...
user avatar
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 ...
user avatar
  • 489
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.
user avatar
  • 440
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 ...
user avatar
  • 9,591

Top 50 recent answers are included