Exemplo n.º 1
0
def test_neurolab_classification_types():
    import pandas as pd
    for net_type in rep.estimators.neurolab.NET_TYPES.keys():
        try:
            clf = NeurolabClassifier(net_type=net_type, epochs=2)
            ds = pd.DataFrame()
            ds['feature1'] = [0, 1, 2, 3, 4, 5]
            ds['feature2'] = [5, 7, 2, 4, 7, 9]
            ds['y'] = [0, 0, 0, 1, 1, 1]
            clf.fit(ds[['feature1', 'feature2']] / 10., ds['y'])
            _ = clf.predict_proba(ds[['feature1', 'feature2']] / 10.)
            print(net_type, 'is ok')
        except Exception as e:
            print(net_type, 'FAILED', e)
Exemplo n.º 2
0
def test_neurolab_classification_types():
    import pandas as pd
    for net_type in rep.estimators.neurolab.NET_TYPES.keys():
        try:
            clf = NeurolabClassifier(net_type=net_type, epochs=2)
            ds = pd.DataFrame()
            ds['feature1'] = [0, 1, 2, 3, 4, 5]
            ds['feature2'] = [5, 7, 2, 4, 7, 9]
            ds['y'] = [0, 0, 0, 1, 1, 1]
            clf.fit(ds[['feature1', 'feature2']] / 10., ds['y'])
            _ = clf.predict_proba(ds[['feature1', 'feature2']] / 10.)
            print(net_type, 'is ok')
        except Exception as e:
            print(net_type, 'FAILED', e)
Exemplo n.º 3
0
def test_partial_fit():
    clf = NeurolabClassifier(layers=[4, 5], epochs=2, trainf=nl.train.train_gd)
    X, y, _ = generate_classification_data()
    clf.fit(X, y)
    clf.partial_fit(X[:2], y[:2])
Exemplo n.º 4
0
def test_partial_fit():
    clf = NeurolabClassifier(layers=[4, 5], epochs=2, trainf=nl.train.train_gd)
    X, y, _ = generate_classification_data()
    clf.fit(X, y)
    clf.partial_fit(X[:2], y[:2])