Last active
May 28, 2016 11:27
-
-
Save OXPHOS/36a3c1f58cb657ab2f5ff86045238e6f to your computer and use it in GitHub Desktop.
with ruby pda.get_cov() error
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] | |
#![create_instance] | |
QDA qda(features_train, labels_train) | |
#![create_instance] | |
#![train_and_apply] | |
qda.train() | |
MulticlassLabels labels_predict = qda.apply_multiclass(features_test) | |
#![train_and_apply] | |
#![extract_mean_and_cov] | |
int classlabel = 1 | |
RealVector m = qda.get_mean(classlabel) | |
RealMatrix c = qda.get_cov(classlabel) | |
#![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() |
this error comes from file not found, as the error says. So the path is probably wrong.
Can you post the generated ruby listing as well. I get a different error when trying to reproduce locally
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ruby ruby/classifier/qda.rb