Skip to content

ELM example code is not running in Python 3.6 #4

Open
@bappa10085

Description

@bappa10085

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions