Example #1
0
def test_profile():
    path = 'results/test/test.pkl'
    m = KnnClassifier()
    d = Toy()
    s = CrossValidation()
    e = [Accuracy()]
    p = expConfig(dataset=d, setting=s, model=m, metrics=e, resultPath=path)
    p.skip_if_file_exist = False
    p.run()
    assert os.path.exists(path)
def test_results():
    path = 'results/test/test.pkl'
    m = KnnClassifier()
    d = Toy() 
    s = CrossValidation()
    e = [Accuracy()]
    p = expConfig(dataset=d,
                  setting=s,
                  model=m,
                  metrics=e,
                  resultPath=path)
    p.skip_if_file_exist = False
    p.run()

    r = results(root_dir='results/test')
    x = r.load()
    assert_almost_equals(x[0].metrics[0].values[2], 0.8) 
Example #3
0
args = parser.parse_args()

# parse parameters
t = args.taskid
g = args.num_gpu

#-------------------------------------------------------------------
# classification models on text for clinical notes
#-------------------------------------------------------------------
if t == 41:
    d = ClinicalTS_numeric_combined()
    s = HoldOut()
    s.num_GPUs = g
    e = [Accuracy()]
    m = RecurrentNN()
    p = expConfig(dataset=d, setting=s, model=m, metrics=e)
    p.run()

if t == 42:
    d = ClinicalTS_numeric_combined()
    s = HoldOut()
    s.num_GPUs = g
    e = [Accuracy()]
    m = FullyConnected()
    p = expConfig(dataset=d, setting=s, model=m, metrics=e)
    p.run()

#-------------------------------------------------------------------
if t == 43:
    d = ClinicalTS_numeric_sequential()
    s = HoldOut()
Example #4
0
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 26 17:07:58 2017

@author: YimingZhao
"""

from modelGlimpseclassifier import Glimpseclassifier
from expConfig import expConfig
from setting import HoldOut
from datasetMNIST import datasetMNIST, datasetMNIST_embed, datasetMNIST3d
from metric import Accuracy
from Configuration import Configuration_Glimpse

AA = Configuration_Glimpse()
num = AA.batch_size

d = datasetMNIST(n_sample=num)
s = HoldOut()
e = [Accuracy()]
m = Glimpseclassifier(1)
path = 'results/test/' + s.name + '/' + d.name + '/' + m.name + '.pkl'
p = expConfig(dataset=d, setting=s, model=m, metrics=e, resultPath=path)
p.run()