def demo():
import sys
sys.path.append( '../core' )
from tools import make_XOR_dataset
from BR import BR
set_printoptions(precision=3, suppress=True)
X,Y = make_XOR_dataset()
N,L = Y.shape
print("CLASSIFICATION")
h = linear_model.SGDClassifier(n_iter=100)
nn = ELM(8,f=tanh,h=BR(-1,h))
nn.fit(X, Y)
# test it
print(nn.predict(X))
print("vs")
print(Y)
print("REGRESSION")
r = ELM(100,h=linear_model.LinearRegression())
r.fit(X,Y)
print(Y)
print(r.predict(X))
print("REGRESSION OI")
r = ELM_OI(100,h=BR(-1,h=linear_model.SGDRegressor()))
r.fit(X,Y)
print(Y)
print(r.predict(X))
评论列表
文章目录