Skip to content

Instantly share code, notes, and snippets.

@OXPHOS
Created May 27, 2016 14:38
Show Gist options
  • Save OXPHOS/4d58f4371e4e49ae8fbef16d176d8149 to your computer and use it in GitHub Desktop.
Save OXPHOS/4d58f4371e4e49ae8fbef16d176d8149 to your computer and use it in GitHub Desktop.
with '0' error when making cookbook
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 = 0
RealVector m = qda.get_mean(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()
@karlnapf
Copy link

karlnapf commented May 28, 2016

I dont get this in latest develop
EDIT: I do get the error .... on it

@karlnapf
Copy link

See email I wrote to @sorig

@karlnapf
Copy link

One potential fix would be to change t_NUMERAL = "([1-9][0-9]*(\.[0-9]+)?)|0\.[0-9]+" in generator/parse.py to t_NUMERAL = "([0-9][0-9]*(\.[0-9]+)?)|0\.[0-9]+"

@karlnapf
Copy link

For now, we can just use class index 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment