Skip to content

Commit

Permalink
Label fix for missing examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed May 22, 2012
1 parent 4e4ae17 commit d59c2b2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Expand Up @@ -19,7 +19,7 @@
feats_test=RealFeatures(testdata_real);
kernel=GaussianKernel(feats_train, feats_train, width);

labels=Labels(trainlab);
labels=BinaryLabels(trainlab);
svm=LibSVM(C, kernel, labels);
svm.train();

Expand Down
Expand Up @@ -22,7 +22,7 @@
feats_test=RealFeatures(testdata_real);
kernel=GaussianKernel(feats_train, feats_train, width);

labels=Labels(trainlab);
labels=BinaryLabels(trainlab);
gp=GaussianProcessRegression(1.0, kernel, feats_train, labels);
gp.train(feats_train);
out=gp.apply(feats_test).get_labels();
Expand Down
Expand Up @@ -10,7 +10,7 @@ def serialization_matrix_modular(m):
fstream = SerializableAsciiFile("foo.asc", "w")
feats.save_serializable(fstream)

l=Labels(array([1.0,2,3]))
l=MulticlassLabels(array([0.0,1.0,2,3]))
fstream = SerializableAsciiFile("foo2.asc", "w")
l.save_serializable(fstream)

Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/modular/Machine.i
Expand Up @@ -17,6 +17,7 @@
%rename(apply_generic) shogun::CLeastSquaresRegression::apply(CFeatures*);
%rename(apply_generic) shogun::CLeastAngleRegression::apply(CFeatures*);
%rename(apply_generic) shogun::CGaussianProcessRegression::apply(CFeatures*);
%rename(apply_generic) shogun::CConjugateIndex::apply(CFeatures*);

%define APPLY_MULTICLASS(CLASS)
%extend CLASS
Expand Down Expand Up @@ -53,6 +54,7 @@ APPLY_MULTICLASS(CMulticlassMachine);
APPLY_MULTICLASS(CKernelMulticlassMachine);
APPLY_MULTICLASS(CLinearMulticlassMachine);
APPLY_MULTICLASS(CDistanceMachine);
APPLY_MULTICLASS(CConjugateIndex);

APPLY_BINARY(CLinearMachine);
APPLY_BINARY(CKernelMachine);
Expand Down

0 comments on commit d59c2b2

Please sign in to comment.