Skip to content

Commit

Permalink
Updated easysvm
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Sep 3, 2012
1 parent 9bbe807 commit 2d57c62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion applications/easysvm/esvm/experiment.py
Expand Up @@ -313,7 +313,7 @@ def train(trainex,trainlab,C,kname,kparam,seq_source,nuc_con):
kernel.init(feats_train, feats_train)
kernel.io.disable_progress()
kernel.set_optimization_type(SLOWBUTMEMEFFICIENT)
labels = Labels(numpy.array(trainlab,numpy.double))
labels = BinaryLabels(numpy.array(trainlab,numpy.double))

# libsvm is fine for most kernels
if kname in ('wd', 'spec', 'cumspec', 'spec2', 'cumspec2'):
Expand Down
6 changes: 3 additions & 3 deletions applications/easysvm/tutpaper/svm_params.py
Expand Up @@ -15,7 +15,7 @@
import numpy
import shogun
from shogun.Kernel import GaussianKernel, LinearKernel, PolyKernel
from shogun.Features import RealFeatures, Labels
from shogun.Features import RealFeatures, BinaryLabels
from shogun.Classifier import LibSVM

from numpy import arange
Expand All @@ -34,7 +34,7 @@ def features_from_file(fileName) :
labels.append(float(tokens[1]))
features.append([float(token) for token in tokens[2:]])

return RealFeatures(numpy.transpose(numpy.array(features))), features, Labels(numpy.array(labels,numpy.float))
return RealFeatures(numpy.transpose(numpy.array(features))), features, BinaryLabels(numpy.array(labels,numpy.float))

def create_kernel(kname, features, kparam=None) :

Expand Down Expand Up @@ -67,7 +67,7 @@ def svm_test(svm, kernel, features_train, features_test) :
"""predicts on the test examples"""

kernel.init(features_train, features_test)
output = svm.classify().get_labels()
output = svm.apply().get_labels()

return output

Expand Down

0 comments on commit 2d57c62

Please sign in to comment.