Skip to content

Commit

Permalink
Updated testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 11, 2012
1 parent b88994d commit 4666b79
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/regression/python_modular/classifier.py
Expand Up @@ -3,7 +3,7 @@
"""

from numpy import double
from shogun.Features import Labels
from shogun.Features import BinaryLabels
from shogun.Kernel import *
from shogun.Distance import *
from shogun.Classifier import *
Expand Down Expand Up @@ -87,7 +87,7 @@ def _get_results (indata, prefix, classifier, machine=None, feats=None):
classifier.set_features(feats['test'])

res['classified']=max(abs(
classifier.apply().get_labels()-indata[prefix+'classified']))
classifier.apply().get_confidences()-indata[prefix+'classified']))
return res


Expand All @@ -111,7 +111,7 @@ def _evaluate (indata):

# cannot refactor into function, because labels is unrefed otherwise
if indata.has_key(prefix+'labels'):
labels=Labels(double(indata[prefix+'labels']))
labels=BinaryLabels(double(indata[prefix+'labels']))
if ctype=='kernel':
classifier=fun(indata[prefix+'C'], machine, labels)
elif ctype=='linear':
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/python_modular/clustering.py
Expand Up @@ -2,7 +2,7 @@
Test Clustering
"""

from shogun.Distance import EuclidianDistance
from shogun.Distance import EuclideanDistance
from shogun.Clustering import *

import util
Expand Down
4 changes: 2 additions & 2 deletions tests/regression/python_modular/kernel.py
Expand Up @@ -141,7 +141,7 @@ def _evaluate_custom (indata, prefix):
def _evaluate_pie (indata, prefix):
pie=PluginEstimate()
feats=util.get_features(indata, prefix)
labels=Labels(double(indata['classifier_labels']))
labels=BinaryLabels(double(indata['classifier_labels']))
pie.set_labels(labels)
pie.set_features(feats['train'])
pie.train()
Expand All @@ -156,7 +156,7 @@ def _evaluate_pie (indata, prefix):
km_test=max(abs(
indata[prefix+'matrix_test']-kernel.get_kernel_matrix()).flat)
classified=max(abs(
pie.apply().get_labels()-indata['classifier_classified']))
pie.apply().get_confidences()-indata['classifier_classified']))

return util.check_accuracy(indata[prefix+'accuracy'],
km_train=km_train, km_test=km_test, classified=classified)
Expand Down
4 changes: 2 additions & 2 deletions tests/regression/python_modular/regression.py
Expand Up @@ -3,7 +3,7 @@
"""

from numpy import double
from shogun.Features import Labels
from shogun.Features import RegressionLabels
from shogun.Kernel import *
from shogun.Regression import *

Expand All @@ -25,7 +25,7 @@ def _evaluate (indata):
print "%s is disabled/unavailable!"%indata[prefix+'name']
return False

labels=Labels(double(indata[prefix+'labels']))
labels=RegressionLabels(double(indata[prefix+'labels']))
if indata[prefix+'type']=='svm':
regression=rfun(
indata[prefix+'C'], indata[prefix+'epsilon'], kernel, labels)
Expand Down

0 comments on commit 4666b79

Please sign in to comment.