]> granicus.if.org Git - liblinear/commitdiff
updated readme on nr_class
authorChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Mon, 5 Dec 2022 10:09:40 +0000 (18:09 +0800)
committerSinacam <stinkingmadgod@gmail.com>
Mon, 5 Dec 2022 10:09:40 +0000 (18:09 +0800)
README

diff --git a/README b/README
index c1df9e70b27b1b9bdb7567fc297416bc4b9bca0e..773e46bd13d4d9c27a3811b7f5ceb22c04c77007 100644 (file)
--- a/README
+++ b/README
@@ -456,14 +456,18 @@ in linear.h, so you can check the version number.
 
      param describes the parameters used to obtain the model.
 
-     nr_class and nr_feature are the number of classes and features,
-     respectively. nr_class = 2 for regression.
+     nr_class is the number of classes for classification. It is a
+     non-negative integer with special cases of 0 (no training data at
+     all) and 1 (all training data in one class). For regression and
+     one-class SVM, nr_class = 2.
+
+     nr_feature is the number of features.
 
      The array w gives feature weights; its size is
-     nr_feature*nr_class but is nr_feature if nr_class = 2. We use one
-     against the rest for multi-class classification, so each feature
-     index corresponds to nr_class weight values. Weights are
-     organized in the following way
+     nr_feature*nr_class but is nr_feature if nr_class = 2 (see more
+     explanation below). We use one against the rest for multi-class
+     classification, so each feature index corresponds to nr_class
+     weight values. Weights are organized in the following way
 
      +------------------+------------------+------------+
      | nr_class weights | nr_class weights |  ...
@@ -472,6 +476,9 @@ in linear.h, so you can check the version number.
 
      The array label stores class labels.
 
+     For classification, if nr_class = 1 or 2, the single vector of
+     weights is obtained by considering label[0] as positive.
+
      If bias >= 0, x becomes [x; bias]. The number of features is
      increased by one, so w is a (nr_feature+1)*nr_class array. The
      value of bias is stored in the variable bias.