Giter Club home page Giter Club logo

maatpy's People

Contributors

gkapatai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

maatpy's Issues

Adacost predicti issue

When calling Adacost.predict(X), I receive the following error:

AttributeError: 'AdaCost' object has no attribute '_validate_X_predict'

Max

AttributeError: 'int' object has no attribute 'flatten'

Hi @gkapatai, @bbk-nm

Could you spot what the error is all about?

How to reproduce the error:

In Google Colab, cloned repo (and cd into cloned repo):

!git clone https://github.com/gkapatai/MaatPy.git
cd MaatPy/

Then import classifier, and generate fake dataset:

X, y = make_classification(n_samples=1000, n_classes=3, n_informative=6, weights=[.1, .15, .75])
xtrain, xtest, ytrain, ytest = train_test_split(X, y, test_size=.2, random_state=123)

from maatpy.classifiers import SMOTEBoost

model = SMOTEBoost()
model.fit(xtrain, train)

/usr/local/lib/python3.7/dist-packages/imblearn/over_sampling/_smote.py in _make_samples(self, X, y_dtype, y_type, nn_data, nn_num, n_samples, step_size)
    106         random_state = check_random_state(self.random_state)
    107         samples_indices = random_state.randint(
--> 108             low=0, high=len(nn_num.flatten()), size=n_samples)
    109         steps = step_size * random_state.uniform(size=n_samples)
    110         rows = np.floor_divide(samples_indices, nn_num.shape[1])

AttributeError: 'int' object has no attribute 'flatten'

AttributeError: 'int' object has no attribute 'size'

Tried using the SMOTEBoost classifier, but encountered this error:

 X_new, y_new = self.smote._make_samples(X_class, min_class, X_class,
  File "../venv/lib/python3.8/site-packages/imblearn/over_sampling/_smote/base.py", line 96, in _make_samples
    samples_indices = random_state.randint(low=0, high=nn_num.size, size=n_samples)
AttributeError: 'int' object has no attribute 'size'

Could this be a package version related error? Using:

>> print(f"Imblearn version: {imblearn.__version__}")
Imblearn version: 0.8.0

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.