From 275074013d396668e59e8f0892ee78adf6610dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sun, 30 Apr 2017 13:16:24 +0200 Subject: [PATCH] Finally fix all python_modular examples --- .../undocumented/python_modular/classifier_larank_modular.py | 4 ++-- .../python_modular/classifier_multiclassocas_modular.py | 4 ++-- .../python_modular/stochasticgbmachine_modular.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/undocumented/python_modular/classifier_larank_modular.py b/examples/undocumented/python_modular/classifier_larank_modular.py index b3d31663629..1df801f1ed7 100644 --- a/examples/undocumented/python_modular/classifier_larank_modular.py +++ b/examples/undocumented/python_modular/classifier_larank_modular.py @@ -18,8 +18,8 @@ def classifier_larank_modular (num_vec,num_class,distance,C=0.9,num_threads=1,nu fm_train=array(random.randn(num_class,num_vec)) fm_test=array(random.randn(num_class,num_vec)) for i in range(len(label_train)): - fm_train[label_train[i],int(i)]+=distance - fm_test[label_test[i],int(i)]+=distance + fm_train[int(label_train[i]),i]+=distance + fm_test[int(label_test[i]),i]+=distance feats_train=RealFeatures(fm_train) feats_test=RealFeatures(fm_test) diff --git a/examples/undocumented/python_modular/classifier_multiclassocas_modular.py b/examples/undocumented/python_modular/classifier_multiclassocas_modular.py index 14e716ab3af..68e5bac52e5 100644 --- a/examples/undocumented/python_modular/classifier_multiclassocas_modular.py +++ b/examples/undocumented/python_modular/classifier_multiclassocas_modular.py @@ -21,8 +21,8 @@ def classifier_multiclassocas_modular (num_vec=10,num_class=3,distance=15,width= fm_train=array(random.randn(num_class,num_vec)) fm_test=array(random.randn(num_class,num_vec)) for i in range(len(label_train)): - fm_train[label_train[i],int(i)]+=distance - fm_test[label_test[i],int(i)]+=distance + fm_train[int(label_train[i]),i]+=distance + fm_test[int(label_test[i]),i]+=distance feats_train=RealFeatures(fm_train) feats_test=RealFeatures(fm_test) diff --git a/examples/undocumented/python_modular/stochasticgbmachine_modular.py b/examples/undocumented/python_modular/stochasticgbmachine_modular.py index df8285f97fb..53e84be0793 100644 --- a/examples/undocumented/python_modular/stochasticgbmachine_modular.py +++ b/examples/undocumented/python_modular/stochasticgbmachine_modular.py @@ -39,8 +39,8 @@ def stochasticgbmachine_modular(train=traindat,train_labels=label_traindat,ft=fe labels.remove_subset() # apply - feats.add_subset(np.int32(p[num:len(p)])) - labels.add_subset(np.int32(p[num:len(p)])) + feats.add_subset(np.int32(p[int(num):len(p)])) + labels.add_subset(np.int32(p[int(num):len(p)])) output=s.apply_regression(feats) feats.remove_subset()