]> granicus.if.org Git - liblinear/commitdiff
- Fix typos in README
authorrofu <rofu@16e7d947-dcc2-db11-b54a-0017319806e7>
Mon, 14 Jun 2010 15:32:43 +0000 (15:32 +0000)
committerrofu <rofu@16e7d947-dcc2-db11-b54a-0017319806e7>
Mon, 14 Jun 2010 15:32:43 +0000 (15:32 +0000)
- Change setBias to set_bias in python

README
python/README
python/linear.py
python/linearutil.py

diff --git a/README b/README
index 4607d6205a74d548004eb154508cad8a490407a2..351db30a701a178fdb9d8b9ceb44fa97461477af 100644 (file)
--- a/README
+++ b/README
@@ -413,7 +413,7 @@ Library Usage
     This function returns a pointer to the model read from the file,
     or a null pointer if the model could not be loaded.
 
-- Function: void free_model_contents(struct model *model_ptr);
+- Function: void free_model_content(struct model *model_ptr);
 
     This function frees the memory used by the entries in a model structure.
 
index 36a6e4c67981c8a6c5dc3cfb458211d6ddcc839e..426d92d40ba4695bf686965928dd409779cbee30 100644 (file)
@@ -51,7 +51,7 @@ in linearutil.py and the usage is the same as the LIBLINEAR MATLAB interface.
 >>> p_label, p_acc, p_val = predict(y[200:], x[200:], m)
 
 # Construct problem in python format
-# Dense data, the first element of the dense data must be 0
+# Dense data
 >>> y, x = [1,-1], [[1,0,1], [-1,0,-1]]
 # Sparse data
 >>> y, x = [1,-1], [{1:1, 3:1}, {1:-1,3:-1}]
@@ -150,7 +150,7 @@ LIBLINEAR shared library:
 
     You can alos modify the bias value by
 
-    >>> prob.setBias(1)
+    >>> prob.set_bias(1)
 
     Note that if your x contains sparse data (i.e., dictionary), the internal
     ctypes data format is still sparse.
@@ -213,7 +213,7 @@ To use utility functions, type
 The above command loads
     train()            : train an linear model
     predict()          : predict testing data
-    svm_read_problem() : read the data from a LIBLINEAR-format file.
+    svm_read_problem() : read the data from a LIBSVM-format file.
     load_model()       : load a LIBLINEAR model.
     save_model()       : save model to a file.
     evaluations()      : evaluate prediction results.
index 8b04ab392e6ecd5343ba0a42308a3b7dceff9b88..e9d5efa5f4c1d84d5f297a373fa3bc40ab1efd30 100644 (file)
@@ -88,9 +88,9 @@ class problem(Structure):
                self.x = (POINTER(feature_node) * l)() 
                for i, xi in enumerate(self.x_space): self.x[i] = xi
 
-               self.setBias(bias)
+               self.set_bias(bias)
 
-       def setBias(self, bias):
+       def set_bias(self, bias):
                if self.bias == bias:
                        return 
                if bias >= 0 and self.bias < 0: 
index ef6511308b45a417342352849a2b052564ac31d3..06cd1c34d2fb6243b0fbe67a128e1e54829958b7 100755 (executable)
@@ -41,7 +41,7 @@ def save_model(model_file_name, model):
        """
        save_model(model_file_name, model) -> None
 
-       Save a LIBLINEAR model model to the file model_file_name.
+       Save a LIBLINEAR model to the file model_file_name.
        """
        liblinear.save_model(model_file_name, model)
 
@@ -67,7 +67,7 @@ def train(arg1, arg2=None, arg3=None):
        train(prob, [, 'options']) -> model | ACC
        train(prob, param) -> model | ACC
 
-       Train an SVM linear model from data (y, x) or a problem prob using
+       Train a model from data (y, x) or a problem prob using
        'options' or a parameter param. 
        If '-v' is specified in 'options' (i.e., cross validation)
        accuracy (ACC) is returned.
@@ -111,7 +111,7 @@ def train(arg1, arg2=None, arg3=None):
        if prob == None or param == None :
                raise TypeError("Wrong types for the arguments")
 
-       prob.setBias(param.bias)
+       prob.set_bias(param.bias)
        liblinear.set_print_string_function(param.print_func)
        err_msg = liblinear.check_parameter(prob, param)
        if err_msg :