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))
def demo(): from tools import make_XOR_dataset X,Y = make_XOR_dataset() N,L = Y.shape nn = DRBM(20) nn.train(X, Y) # test it print nn.predict(X) print "vs" print Y
def demo(): from tools import make_XOR_dataset X, Y = make_XOR_dataset() N, L = Y.shape nn = DRBM(20) nn.train(X, Y) # test it print nn.predict(X) print "vs" print Y
def demo(): import sys sys.path.append('../core') from tools import make_XOR_dataset X, Y = make_XOR_dataset() N, L = Y.shape br = BR(L, linear_model.SGDClassifier(n_iter=100)) br.fit(X, Y) # test it print(br.predict(X)) print("vs") print(Y)
def demo(): import sys sys.path.append( '../core' ) from tools import make_XOR_dataset X,Y = make_XOR_dataset() N,L = Y.shape br = BR(L, linear_model.SGDClassifier(n_iter=100)) br.fit(X, Y) # test it print br.predict(X) print "vs" print Y
def demo(): #from molearn.core.tools import make_XOR_dataset import sys sys.path.append( '../core' ) from tools import make_XOR_dataset X,Y = make_XOR_dataset() N,L = Y.shape cc = RCC(L, SGDClassifier(n_iter=100)) cc.fit(X, Y) # test it print cc.predict(X) print "vs" print Y
def demo(): #from molearn.core.tools import make_XOR_dataset import sys sys.path.append('../core') from tools import make_XOR_dataset X, Y = make_XOR_dataset() N, L = Y.shape cc = RCC(L, SGDClassifier(n_iter=100)) cc.fit(X, Y) # test it print(cc.predict(X)) print("vs") print(Y)
def demo(): #from molearn.core.tools import make_XOR_dataset import sys sys.path.append('../core') from tools import make_XOR_dataset X, Y = make_XOR_dataset() N, L = Y.shape ps = PS() ps.fit(X, Y) # test it print(ps.predict(X)) print("vs") print(Y)
def demo(): from tools import make_XOR_dataset from BR import BR X,Y = make_XOR_dataset() N,L = Y.shape h = linear_model.SGDClassifier(n_iter=100) nn = ELM(8,BR(L,h)) nn.train(X, Y) # test it print nn.predict(X) print "vs" print Y
def demo(): #from molearn.core.tools import make_XOR_dataset import sys sys.path.append('../core') from tools import make_XOR_dataset X, Y = make_XOR_dataset() N, L = Y.shape lp = LP() lp.fit(X, Y) # test it print(lp.predict_proba(X)) print("vs") print(Y)
def demo(): import sys sys.path.append('../core') from tools import make_XOR_dataset X, Y = make_XOR_dataset() N, L = Y.shape from sklearn import linear_model h = linear_model.LogisticRegression() h = linear_model.SGDClassifier(n_iter=100) ml = ML(L, h) ml.fit(X, Y) # Eval print(ml.predict(X)) print("vs") print(Y)
def demo(): import sys sys.path.append( '../core' ) from tools import make_XOR_dataset X,Y = make_XOR_dataset() N,L = Y.shape from sklearn import linear_model h_ = linear_model.SGDClassifier(n_iter=100) from CC import RCC cc = RCC(h=h_) e = Ensemble(n_estimators=10,base_estimator=cc) e.fit(X, Y) # test it print(e.predict(X)) print("vs") print(Y)