akusok / scikit-elm Goto Github PK
View Code? Open in Web Editor NEWExtreme Learning Machine (ELM) with Scikit-Learn compatibility
License: MIT License
Extreme Learning Machine (ELM) with Scikit-Learn compatibility
License: MIT License
Hi,
I'm running the code that prints the model.predict, model.predict_proba in binary classification. The problem is the probabilities from predict_proba() don't appear to match the predicted class from predict(). See the sample of the code and the printout below:
df = pd.read_excel (r'D:\elm\heartlog.xlsx',header=None)
X,y=df.iloc[:,:-1],df.iloc[:,-1]
X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, test_size=0.02)
clf=ELMClassifier(n_neurons=10, ufunc='sigm')
clf.fit(X_train,y_train)
y_pred=clf.predict(X_test)
y_proba=clf.predict_proba(X_test)
print("pred",y_pred)
print("proba",y_proba)
Result :
pred [1 1 2 1 1 1]
proba [[0.39689426 0.60310574]
[0.39158382 0.60841618]
[0.33327835 0.66672165]
[0.39609943 0.60390057]
[0.39689428 0.60310572]
[0.39689424 0.60310576]]
It shows all test data having the highest probability to the second class. I did try to do it on other dataset with binary class (livers disorder and HCC survival from UCI), but almost all of predict_proba result was having the highest probability to the second class and it didnt match with model.predict results.
I also tried to do it on dataset with multi class datasets (iris, dermatology, and breast tissue from UCI), the results of predict is matching with predict_proba. So i think the problem is only occurs on binary classification.
How can i get predict results that match with predict_proba in binary classification?
ValueError: The key pairwise is not defined in _get_tags() for the class ELMClassifier.
I saw in "6.4 Export to Keras and iOS.ipynb" that you converted the ELM model to Keras. Assuming I first created the same Keras model, can you convert it to ELM by using scikit-elm?
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.