You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error when trying to use any sampler from smote_variants, my binary dataset has 30 input features and one output
X_train is ndarray with shape (227845, 30)
y_train is ndarray with shape (227845, 1)
/usr/local/lib/python3.10/dist-packages/smote_variants/oversampling/_mwmote.py in sampling_algorithm(self, X, y)
498 return self.return_copies(X, y, "Sampling is not needed")
499
--> 500 X_min = X[y == self.min_label]
501
502 nn_params= {**self.nn_params}
IndexError: boolean index did not match indexed array along dimension 1; dimension is 30 but corresponding boolean dimension is 1
Here's sample of my code: X_train, X_test, y_train, y_test = split_data(df, 0.2)
import smote_variants as sv
sampler = sv.MWMOTE()
X_resampled, y_resampled = sampler.sample(X_train, y_train)
The text was updated successfully, but these errors were encountered:
I think the problem is that your y_train should be an array of shape (227845), that is, instead of a 2D array with the spatial extent of 1 in the second dimension, it should be a 1D array.
I am getting this error when trying to use any sampler from smote_variants, my binary dataset has 30 input features and one output
X_train is ndarray with shape (227845, 30)
y_train is ndarray with shape (227845, 1)
/usr/local/lib/python3.10/dist-packages/smote_variants/oversampling/_mwmote.py in sampling_algorithm(self, X, y)
498 return self.return_copies(X, y, "Sampling is not needed")
499
--> 500 X_min = X[y == self.min_label]
501
502 nn_params= {**self.nn_params}
IndexError: boolean index did not match indexed array along dimension 1; dimension is 30 but corresponding boolean dimension is 1
Here's sample of my code:
X_train, X_test, y_train, y_test = split_data(df, 0.2)
import smote_variants as sv
sampler = sv.MWMOTE()
X_resampled, y_resampled = sampler.sample(X_train, y_train)
The text was updated successfully, but these errors were encountered: