elm icon indicating copy to clipboard operation
elm copied to clipboard

ELM example code is not running in Python 3.6

Open bappa10085 opened this issue 8 years ago • 0 comments

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)

bappa10085 avatar May 31 '17 07:05 bappa10085