From: popo Date: Sat, 26 Feb 2011 00:09:48 +0000 (+0000) Subject: matlab/README is slightly modified. (Section 'Other Utilities' and 'Examples' are... X-Git-Tag: v180~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acd0a16b9347cd0fb955e7e8f763280f0b5a3286;p=liblinear matlab/README is slightly modified. (Section 'Other Utilities' and 'Examples' are swapped.) --- diff --git a/matlab/README b/matlab/README index 7ede401..226693f 100644 --- a/matlab/README +++ b/matlab/README @@ -9,8 +9,8 @@ Table of Contents - Installation - Usage - Returned Model Structure -- Examples - Other Utilities +- Examples - Additional Information @@ -133,21 +133,6 @@ each row contains k values indicating the probability that the testing instance each class. Note that the order of classes here is the same as 'Label' field in the model structure. -Examples -======== - -Train and test on the provided data heart_scale: - -matlab> [heart_scale_label, heart_scale_inst] = libsvmread('../heart_scale'); -matlab> model = train(heart_scale_label, heart_scale_inst, '-c 1'); -matlab> [predict_label, accuracy, dec_values] = predict(heart_scale_label, heart_scale_inst, model); % test the training data - -Note that for testing, you can put anything in the testing_label_vector. - -For probability estimates, you need '-b 1' for training and testing: - -matlab> [predict_label, accuracy, prob_estimates] = predict(heart_scale_label, heart_scale_inst, model, '-b 1'); - Other Utilities =============== @@ -163,9 +148,27 @@ A matlab function libsvmwrite writes Matlab matrix to a file in LIBSVM format: libsvmwrite('data.txt', label_vector, instance_matrix] The instance_matrix must be a sparse matrix. (type must be double) +For windows, `libsvmread.mexw32' and `libsvmwrite.mexw32' are ready in +the directory `..\windows'. + These codes are prepared by Rong-En Fan and Kai-Wei Chang from National Taiwan University. +Examples +======== + +Train and test on the provided data heart_scale: + +matlab> [heart_scale_label, heart_scale_inst] = libsvmread('../heart_scale'); +matlab> model = train(heart_scale_label, heart_scale_inst, '-c 1'); +matlab> [predict_label, accuracy, dec_values] = predict(heart_scale_label, heart_scale_inst, model); % test the training data + +Note that for testing, you can put anything in the testing_label_vector. + +For probability estimates, you need '-b 1' for training and testing: + +matlab> [predict_label, accuracy, prob_estimates] = predict(heart_scale_label, heart_scale_inst, model, '-b 1'); + Additional Information ======================