akusok / hpelm

High performance implementation of Extreme Learning Machines (fast randomized neural networks).
Other
191 stars 61 forks source link

calculate cross validation accuracy #10

Open vinayakumarr opened 6 years ago

vinayakumarr commented 6 years ago

I am trying to do 10 fold cross-validation accuracy.......so how to calculate each fold accuracy and average accuracy...

The code is given below

import numpy as np import os from hpelm import ELM

curdir = os.path.dirname(file) pX = os.path.join(curdir, "data/data.txt") pY = os.path.join(curdir, "data/class-labelonehot.txt")

X = np.loadtxt(pX) Y = np.loadtxt(pY)

elm = ELM(21,3) elm.add_neurons(100, "sigm") elm.train(X, Y, "CV", k=10) yytest =elm.predict(X) print(yytest.shape)