Git Product home page Git Product logo

Comments (9)

gykovacs avatar gykovacs commented on July 24, 2024

Could you share the dimensions of X_trainTF and y_train?

from smote_variants.

ppleumyy avatar ppleumyy commented on July 24, 2024

Could you share the dimensions of X_trainTF and y_train?

(4621, 2134) , (4621,)

@gykovacs

from smote_variants.

gykovacs avatar gykovacs commented on July 24, 2024

Interesting, which version of Python and numpy are you using? There might have been some changes in the latest versions which have not been checked yet. (up to P3.9 were the tests executed, I should cover the most recent versions soon)

from smote_variants.

ppleumyy avatar ppleumyy commented on July 24, 2024

@

Interesting, which version of Python and numpy are you using? There might have been some changes in the latest versions which have not been checked yet. (up to P3.9 were the tests executed, I should cover the most recent versions soon)

python version is 3.7.13
numpy version is 1.21.6

@gykovacs

from smote_variants.

gykovacs avatar gykovacs commented on July 24, 2024

Cool, this is not the case then, it should work with this setup. If it is not much of a burden, could you please prepare a minimal working example, like replacing the X_trainTF and y_train with some random arrays of the same size, feed them into the MulticlassOversampling and see if it fails? I could use that as a minimal working example for debugging.

Also, could you please share the label distribution in y_train? Are the labels of integer type?

from smote_variants.

ppleumyy avatar ppleumyy commented on July 24, 2024

Cool, this is not the case then, it should work with this setup. If it is not much of a burden, could you please prepare a minimal working example, like replacing the X_trainTF and y_train with some random arrays of the same size, feed them into the MulticlassOversampling and see if it fails? I could use that as a minimal working example for debugging.

Also, could you please share the label distribution in y_train? Are the labels of integer type?

this is my google colab workspace https://colab.research.google.com/drive/1ETmdFjWEJdayBq_Ji3Eu6qKprrc0lC_G?usp=sharing

and the dataset file:
Suicidal_K1_Train.csv

@gykovacs

from smote_variants.

gykovacs avatar gykovacs commented on July 24, 2024

Perfect, I look into it!

from smote_variants.

ppleumyy avatar ppleumyy commented on July 24, 2024

Perfect, I look into it!

thank you very much!

@gykovacs

from smote_variants.

gykovacs avatar gykovacs commented on July 24, 2024

Hi @ppleumyy, so, all the smote_variants tools operate on numerical arrays. Your y_train contains strings, and it is a pandas Series, while your X_trainTF is a sparse array (it needs to be dense). So with the following changes, everything seems to work as expected:

y_train[y_train == 'Level 1'] = 1
y_train[y_train == 'Level 2'] = 2
y_train[y_train == 'Level 3'] = 3
y_train[y_train == 'Level 4'] = 4
y_train[y_train == 'Level 5'] = 5
y_train[y_train == 'Other'] = 0

y_train= y_train.values

X_trainTF= X_trainTF.todense()

from smote_variants.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.