Skip to content

Commit

Permalink
Merge pull request #3805 from besser82/bugfix/examples_python_modular
Browse files Browse the repository at this point in the history
Finally fix all python_modular examples
  • Loading branch information
besser82 committed Apr 30, 2017
2 parents 308f924 + 2750740 commit 3e9e98e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -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)
Expand Down
Expand Up @@ -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)
Expand Down
Expand Up @@ -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()
Expand Down

0 comments on commit 3e9e98e

Please sign in to comment.