gkapatai / maatpy Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
When calling Adacost.predict(X), I receive the following error:
AttributeError: 'AdaCost' object has no attribute '_validate_X_predict'
Max
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'
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.