Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed a number of .rb scripts and removed broken non-trivial to fix ones
- Loading branch information
Soeren Sonnenburg
committed
Aug 31, 2011
1 parent
e3c14a4
commit 52fb28d
Showing
18 changed files
with
205 additions
and
375 deletions.
There are no files selected for viewing
Submodule data
updated
from 0d3c49 to 90a72b
36 changes: 0 additions & 36 deletions
36
examples/undocumented/ruby_modular/classifier_custom_kernel_modular.rb
This file was deleted.
Oops, something went wrong.
54 changes: 27 additions & 27 deletions
54
examples/undocumented/ruby_modular/classifier_libsvm_minimal_modular.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
require 'modshogun' | ||
require 'narray' | ||
require './shogun_helpers' | ||
require 'load' | ||
|
||
@num = 1000 | ||
@dist = 1 | ||
@width = 2.1 | ||
C = 1 | ||
|
||
puts "generating training data" | ||
traindata_real = gen_rand_ary | ||
testdata_real = gen_rand_ary | ||
|
||
puts "generating labels" | ||
trainlab = gen_ones_vec | ||
testlab = gen_ones_vec | ||
|
||
puts "doing feature stuff" | ||
feats_train = Modshogun::RealFeatures.new | ||
feats_train.set_feature_matrix traindata_real | ||
feats_test = Modshogun::RealFeatures.new | ||
feats_test.set_feature_matrix testdata_real | ||
kernel = Modshogun::GaussianKernel.new feats_train, feats_train, @width | ||
|
||
puts "labeling stuff" | ||
labels = Modshogun::Labels.new | ||
labels.set_labels trainlab | ||
svm = Modshogun::LibSVM.new C, kernel, labels | ||
svm.train | ||
|
||
puts "the grand finale" | ||
kernel.init feats_train, feats_test | ||
out = svm.apply.get_labels | ||
testerr = mean out.sign.eql_items? testlab | ||
puts testerr | ||
#puts "generating training data" | ||
#traindata_real = gen_rand_ary(@num, @dist) | ||
#testdata_real = gen_rand_ary(@num, @dist) | ||
# | ||
#puts "generating labels" | ||
#trainlab = gen_labels_vec(@num) | ||
#testlab = gen_labels_vec(@num) | ||
# | ||
#puts "doing feature stuff" | ||
#feats_train = Modshogun::RealFeatures.new | ||
#feats_train.set_feature_matrix traindata_real | ||
#feats_test = Modshogun::RealFeatures.new | ||
#feats_test.set_feature_matrix testdata_real | ||
#kernel = Modshogun::GaussianKernel.new feats_train, feats_train, @width | ||
# | ||
#puts "labeling stuff" | ||
#labels = Modshogun::Labels.new | ||
#labels.set_labels trainlab | ||
#svm = Modshogun::LibSVM.new C, kernel, labels | ||
#svm.train | ||
# | ||
#puts "the grand finale" | ||
#kernel.init feats_train, feats_test | ||
#out = svm.apply.get_labels | ||
#testerr = mean out.sign.eql_items? testlab | ||
#puts testerr |
1 change: 1 addition & 0 deletions
1
examples/undocumented/ruby_modular/clustering_hierarchical_modular.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
require 'modshogun' | ||
require 'pp' | ||
require 'load' | ||
|
||
traindat = LoadMatrix.load_numbers('../data/fm_train_real.dat') | ||
|
||
|
1 change: 1 addition & 0 deletions
1
examples/undocumented/ruby_modular/distance_braycurtis_modular.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
examples/undocumented/ruby_modular/distance_canberra_modular.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
examples/undocumented/ruby_modular/distribution_histogram_modular.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
require 'modshogun' | ||
require 'pp' | ||
require 'load' | ||
|
||
traindna = LoadMatrix.load_dna('../data/fm_train_dna.dat') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.