Replies: 2 comments
-
You probably want to have a look at An example can be found here: https://imbalanced-learn.org/stable/auto_examples/applications/plot_impact_imbalanced_classes.html#sphx-glr-auto-examples-applications-plot-impact-imbalanced-classes-py You can have a look at the different samplers as well. |
Beta Was this translation helpful? Give feedback.
-
If the idea is to make data augmentation, rather than fixing the unbalanced problem, you could pass a reference to your
Then you will be able to reassign This approach is probably much simpler than changing the view of your numpy array in-place. The major obstacle is that numpy array relies on c-like implementation, and the origin and size of your array are therefore read-only properties. If your transformer is a step in a pipeline, your other alternative could be to inherit from |
Beta Was this translation helpful? Give feedback.
-
Hi,
I would like to increase the data that leaves a scikit-learn transformer. I am doing binary classification, but I do not have much samples for the second, so this this makes the data very unbalanced. I want to do data augmentation in a transformer .
fit_transform(self, X, y)
does take both X and y, but it returns only X. I need to return y as well for the new X I am going to add.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions