Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ELM example code is not running in Python 3.6 #4

Open
bappa10085 opened this issue May 31, 2017 · 0 comments
Open

ELM example code is not running in Python 3.6 #4

bappa10085 opened this issue May 31, 2017 · 0 comments

Comments

@bappa10085
Copy link

I have used the following code in Python 3.6 but nothing is running
#download an example dataset from
from sklearn import datasets
data = datasets.load_iris()
iris = pd.DataFrame(data.data, columns=data.feature_names)

create a classifier

elmk = elm.ELMKernel()

search for best parameter for this dataset

define "kfold" cross-validation method, "accuracy" as a objective function

to be optimized and perform 10 searching steps.

best parameters will be saved inside 'elmk' object

elmk.search_param(iris, cv="kfold", of="accuracy", eval=10)

split data in training and testing sets

use 80% of dataset to training and shuffle data before splitting

tr_set, te_set = elm.split_sets(iris, training_percent=.8, perm=True)

#train and test

results are Error objects

tr_result = elmk.train(iris)
te_result = elmk.test(te_set)

print(te_result.get_accuracy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant