Skip to content

Commit

Permalink
Merge branch 'master' of github.com:shogun-toolbox/shogun
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jun 24, 2011
2 parents 9d78a61 + 8de57a2 commit 9e02b38
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion testsuite/generator/featop.py
Expand Up @@ -3,7 +3,7 @@
"""

import shogun.Features as features
import shogun.PreProc as preproc
import shogun.Preprocessor as preproc

WORDSTRING_ORDER=3
WORDSTRING_GAP=0
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python_modular/classifier.py
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.classify().get_labels()-indata[prefix+'classified']))
classifier.apply().get_labels()-indata[prefix+'classified']))
return res


Expand Down
2 changes: 1 addition & 1 deletion testsuite/python_modular/kernel.py
Expand Up @@ -4,7 +4,7 @@

from shogun.Features import *
from shogun.Kernel import *
from shogun.PreProc import *
from shogun.Preprocessor import *
from shogun.Distance import *
from shogun.Classifier import PluginEstimate
from shogun.Distribution import HMM, BW_NORMAL
Expand Down
@@ -1,5 +1,5 @@
"""
Test PreProc
Test Preprocessor
"""

from shogun.Kernel import *
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python_modular/regression.py
Expand Up @@ -56,7 +56,7 @@ def _evaluate (indata):

kernel.init(feats['train'], feats['test'])
classified=max(abs(
regression.classify().get_labels()-indata[prefix+'classified']))
regression.apply().get_labels()-indata[prefix+'classified']))

return util.check_accuracy(indata[prefix+'accuracy'], alphas=alphas,
bias=bias, support_vectors=sv, classified=classified)
Expand Down
4 changes: 2 additions & 2 deletions testsuite/python_modular/test_one.py
Expand Up @@ -12,11 +12,11 @@
import clustering
import distribution
import regression
import preproc
import preprocessor
from shogun.Library import Math_init_random

SUPPORTED=['kernel', 'distance', 'classifier', 'clustering', 'distribution',
'regression', 'preproc']
'regression', 'preprocessor']

def _get_name_fun (fnam):
module=None
Expand Down
14 changes: 7 additions & 7 deletions testsuite/python_modular/util.py
Expand Up @@ -3,7 +3,7 @@
"""

from shogun.Features import *
from shogun.PreProc import *
from shogun.Preprocessor import *
from shogun.Distance import *
from shogun.Kernel import *
from numpy import *
Expand Down Expand Up @@ -158,7 +158,7 @@ def get_feats_string_complex (indata, prefix=''):
if indata[prefix+'feature_type']=='Word' or \
indata[prefix+'feature_type']=='Ulong':
name='Sort'+indata[prefix+'feature_type']+'String'
return add_preproc(name, feats)
return add_preprocessor(name, feats)
else:
return feats

Expand All @@ -182,14 +182,14 @@ def get_feats_wd (indata, prefix=''):
return feats


def add_preproc (name, feats, *args):
def add_preprocessor(name, feats, *args):
fun=eval(name)
preproc=fun(*args)
preproc.init(feats['train'])
feats['train'].add_preproc(preproc)
feats['train'].apply_preproc()
feats['test'].add_preproc(preproc)
feats['test'].apply_preproc()
feats['train'].add_preprocessor(preproc)
feats['train'].apply_preprocessor()
feats['test'].add_preprocessor(preproc)
feats['test'].apply_preprocessor()

return feats

0 comments on commit 9e02b38

Please sign in to comment.