comparison make_test_datasets.py @ 527:3eb59514b534

bugfix. fix an import bug that I don't understand the cause.
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 17 Nov 2008 13:16:33 -0500
parents 2d8490d76b3e
children
comparison
equal deleted inserted replaced
526:242efecefd70 527:3eb59514b534
1 import dataset 1 from dataset import ArrayDataSet
2 from shapeset.dset import Polygons 2 from shapeset.dset import Polygons
3 from linear_regression import linear_predictor 3 from linear_regression import linear_predictor
4 from kernel_regression import kernel_predictor 4 from kernel_regression import kernel_predictor
5 from numpy import * 5 from numpy import *
6 6
108 # trainset = ArrayDataSet(inputs[0:n_examples/2],{'input':slice(0,n_inputs)}) | \ 108 # trainset = ArrayDataSet(inputs[0:n_examples/2],{'input':slice(0,n_inputs)}) | \
109 # ArrayDataSet(targets[0:n_examples/2],{'target':slice(0,n_targets)}) 109 # ArrayDataSet(targets[0:n_examples/2],{'target':slice(0,n_targets)})
110 # testset = ArrayDataSet(inputs[n_examples/2:],{'input':slice(0,n_inputs)}) | \ 110 # testset = ArrayDataSet(inputs[n_examples/2:],{'input':slice(0,n_inputs)}) | \
111 # ArrayDataSet(targets[n_examples/2:],{'target':slice(0,n_targets)}) 111 # ArrayDataSet(targets[n_examples/2:],{'target':slice(0,n_targets)})
112 data = hstack((inputs,targets)) 112 data = hstack((inputs,targets))
113
113 trainset = ArrayDataSet(data[0:n_train], 114 trainset = ArrayDataSet(data[0:n_train],
114 {'input':slice(0,n_inputs),'target':slice(n_inputs,n_inputs+n_targets)}) 115 {'input':slice(0,n_inputs),'target':slice(n_inputs,n_inputs+n_targets)})
115 testset = ArrayDataSet(data[n_train:], 116 testset = ArrayDataSet(data[n_train:],
116 {'input':slice(0,n_inputs),'target':slice(n_inputs,n_inputs+n_targets)}) 117 {'input':slice(0,n_inputs),'target':slice(n_inputs,n_inputs+n_targets)})
117 return trainset,testset,theta 118 return trainset,testset,theta