Created
July 1, 2016 07:19
-
-
Save sanuj/1c1f0393f96e46c4b822057fabe9bb5f to your computer and use it in GitHub Desktop.
Error while building MulticlassSVM cookbook.
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
[ 0%] Built target class_list | |
[ 0%] Built target HeadersProtobuf | |
[ 0%] Built target ChunksProtobuf | |
[ 1%] Built target ShogunVersionProtobuf | |
[ 3%] Generating version header | |
[ 3%] Built target version | |
[ 96%] Built target libshogun | |
[ 96%] Built target shogun | |
[ 96%] Built target ctags | |
[ 96%] Generating examples from meta-language | |
Translating gaussian_processes/gaussian_process_classifier.sg | |
Translating gaussian_processes/gaussian_process_regression.sg | |
Translating multiclass_classifier/svm.sg | |
Traceback (most recent call last): | |
File "/home/sanuj/Projects/shogun_cb/examples/meta/generator/generate.py", line 135, in <module> | |
includedTargets=args.targets, storeVars=storeVars) | |
File "/home/sanuj/Projects/shogun_cb/examples/meta/generator/generate.py", line 59, in translateExamples | |
ast = parse(file.read(), os.path.join(dirRelative, filename)) | |
File "/home/sanuj/Projects/shogun_cb/examples/meta/generator/parse.py", line 285, in parse | |
return parser.parse(programString, filePath) | |
File "/home/sanuj/Projects/shogun_cb/examples/meta/generator/parse.py", line 28, in parse | |
program = self.parser.parse(programString) | |
File "/usr/local/lib/python2.7/dist-packages/ply-3.8-py2.7.egg/ply/yacc.py", line 331, in parse | |
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc) | |
File "/usr/local/lib/python2.7/dist-packages/ply-3.8-py2.7.egg/ply/yacc.py", line 1049, in parseopt_notrack | |
lookahead = get_token() # Get the next token | |
File "/usr/local/lib/python2.7/dist-packages/ply-3.8-py2.7.egg/ply/lex.py", line 386, in token | |
newtok = self.lexerrorf(tok) | |
File "/home/sanuj/Projects/shogun_cb/examples/meta/generator/parse.py", line 121, in t_error | |
raise TypeError("Failed to tokenize input. Unknown text on line %d '%s'" % (t.lineno, t.value,)) | |
TypeError: Failed to tokenize input. Unknown text on line 15 '; | |
MulticlassSVM svm(C, gauss_kernel, labels_train) | |
svm.set_epsilon(epsilon) | |
#![create_instance] | |
#![train_and_apply] | |
svm.train() | |
MulticlassLabels labels_predict = svm.apply_multiclass(features_test) | |
#![train_and_apply] | |
#![evaluate_accuracy] | |
MulticlassAccuracy eval() | |
real accuracy = eval.evaluate(labels_predict, labels_test) | |
#![evaluate_accuracy] | |
# additional integration testing variables | |
RealVector output = labels_predict.get_labels() | |
' | |
make[3]: *** [examples/meta/CMakeFiles/meta_examples] Error 1 | |
make[2]: *** [examples/meta/CMakeFiles/meta_examples.dir/all] Error 2 | |
make[1]: *** [examples/meta/cpp/CMakeFiles/build_cpp_meta_examples.dir/rule] Error 2 |
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
CSVFile f_feats_train("../../data/classifier_4class_2d_linear_features_train.dat") | |
CSVFile f_feats_test("../../data/classifier_4class_2d_linear_features_test.dat") | |
CSVFile f_labels_train("../../data/classifier_4class_2d_linear_labels_train.dat") | |
CSVFile f_labels_test("../../data/classifier_4class_2d_linear_labels_test.dat") | |
#![create_features] | |
RealFeatures features_train(f_feats_train) | |
RealFeatures features_test(f_feats_test) | |
MulticlassLabels labels_train(f_labels_train) | |
MulticlassLabels labels_test(f_labels_test) | |
#![create_features] | |
#![set_parameters] | |
real C = 1 | |
real epsilon = 0.0001 | |
GaussianKernel gauss_kernel(features_train, features_train, 15) | |
#![set_parameters] | |
#![create_instance] | |
MulticlassOneVsOneStrategy ovo_strategy(); | |
MulticlassSVM svm(ovo_strategy, C, gauss_kernel, labels_train) | |
svm.set_epsilon(epsilon) | |
#![create_instance] | |
#![train_and_apply] | |
svm.train() | |
MulticlassLabels labels_predict = svm.apply_multiclass(features_test) | |
#![train_and_apply] | |
#![evaluate_accuracy] | |
MulticlassAccuracy eval() | |
real accuracy = eval.evaluate(labels_predict, labels_test) | |
#![evaluate_accuracy] | |
# additional integration testing variables | |
RealVector output = labels_predict.get_labels() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment