imblearn Questions

11

Solved

I am trying to import imblearn into my python notebook after installing the required modules. However, I am getting the following error: Additional info: I am using a virtual environment in Visual...
Malvoisie asked 1/7, 2023 at 8:52

14

I tried running the following code: from imblearn import under_sampling, over_sampling from imblearn.over_sampling import SMOTE sm = SMOTE(random_state=12, ratio = 1.0) x_SMOTE, y_SMOTE = sm.fit_...
Roland asked 16/5, 2018 at 17:36

3

Solved

Why I am getting the error AttributeError: 'SMOTE' object has no attribute 'fit_sample' I don't think this code should cause any error? from imblearn.over_sampling import SMOTE smt = SMOTE(random_...

2

Solved

Let us suppose the following code (from imblearn example on pipelines) ... # Instanciate a PCA object for the sake of easy visualisation pca = PCA(n_components=2) # Create the samplers enn = Edit...
Upcast asked 21/8, 2020 at 10:14

5

Solved

I have already pre-cleaned the data, and below shows the format of the top 4 rows: [IN] df.head() [OUT] Year cleaned 0 1909 acquaint hous receiv follow letter clerk crown... 1 1909 ask secret...
Influence asked 20/3, 2018 at 23:48

14

Solved

I installed "imbalanced-learn" (version 0.3.1) on ANACONDA Navigator. When I ran an example from the imbalanced-learn website using Jupyter (Python 3): from imblearn.datasets import make_...
Sudoriferous asked 2/12, 2017 at 10:25

8

I installed https://github.com/glemaitre/imbalanced-learn on windows powershell using pip install, conda and github. But when I'm on iPython notebook and I tried to import the package using: from ...
Pass asked 12/10, 2016 at 20:42

3

Solved

I have a highly imbalanced dataset and would like to perform SMOTE to balance the dataset and perfrom cross validation to measure the accuracy. However, most of the existing tutorials make use of o...

7

Solved

I'm resampling my data (multiclass) by using SMOTE. sm = SMOTE(random_state=1) X_res, Y_res = sm.fit_resample(X_train, Y_train) However, I'm getting this attribute error. Can anyone help?
Barbitone asked 17/6, 2020 at 18:48

4

Solved

I have recently installed imblearn package in jupyter using !pip show imbalanced-learn But I am not able to import this package. from tensorflow.keras import backend from imblearn.over_sampli...
Feeder asked 10/2, 2020 at 7:14

1

Solved

I'm trying to implement a pipeline with FAMD, SMOTENC, and other preprocessing steps. However it gives error each time. If i remove FAMD from the pipeline it works fine. My code: #Seperate the data...
Amandie asked 3/3, 2021 at 11:44

2

Solved

I have this code: from imblearn.over_sampling import ADASYN Y = df.target X = df.drop('target', axis=1) ad = ADASYN() X_adasyn, y_adasyn = ad.fit_sample(X, Y) getting this error: ValueError: N...
Valgus asked 12/5, 2019 at 14:18

1

Solved

I'm trying to use the Pipeline class from imblearn and GridSearchCV to get the best parameters for classifying the imbalanced dataset. As per the answers mentioned here, I want to leave out resampl...
Illene asked 12/11, 2019 at 8:49

1

Solved

In imbalanced classification (with scikit-learn) what would be the difference of balancing classes (i.e. set class_weight to balanced) to oversampling with SMOTE for example? What would be the expe...
Brunel asked 12/4, 2019 at 18:44

1

Solved

I am using RandomUnderSampler from imblearn, but I get the following error. Any ideas? Thanks from imblearn.under_sampling import RandomUnderSampler print('Initial dataset shape %s' % Counter(y.va...
Carnassial asked 12/8, 2019 at 18:43

1

I am working on an imbalanced data for classification and I tried to use Synthetic Minority Over-sampling Technique (SMOTE) previously to oversampling the training data. However, this time I think ...

1

Solved

I have split my data into train/test before doing cross-validation on the training data to validate my hyperparameters. I have an unbalanced dataset and want to perform SMOTE oversampling on each i...
Legendre asked 6/5, 2019 at 20:4

1

I am trying to implement SMOTE of imblearn inside the Pipeline. My data sets are text data stored in pandas dataframe. Please see below the code snippet text_clf =Pipeline([('vect', TfidfVectorize...
Keyser asked 2/11, 2018 at 7:55

2

I am trying to use SMOTE from imblearn package in Python, but my data has a lot of missing values and I got the following error: ValueError: Input contains NaN, infinity or a value too large for...
Scorpion asked 13/7, 2018 at 9:58
1

© 2022 - 2025 — McMap. All rights reserved.