Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Dec 7, 2017
1 parent 8ab0682 commit 7f67f88
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions command_line.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
xLearn Command Line Guide
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Once you build xLearn successfully, you will get two executable files ``xlearn_train``
and ``xlearn_predict`` in your ``build`` directory. Now you can use these two executable
files to perform training task and prediction task.
Once you build xLearn from source code successfully, you will get two executable files
``xlearn_train`` and ``xlearn_predict`` in your ``build`` directory. Now you can use these
two executable files to perform training task and prediction task.

Quick Start
----------------------------------------

Make sure that you are in the build path of xLearn, and you will find the ``small_test.txt``
and ``small_train.txt`` in this directory. Now you can type the following command to train a
model ::
Make sure that you are in the build path of xLearn, and you will find the demo data
``small_test.txt`` and ``small_train.txt`` in this directory. Now you can type the following
command to train a model ::

./xlearn_train ./small_train.txt

Expand All @@ -30,44 +30,44 @@ Here we print a portion of the output ::

On default, xLearn will use the logistic regression (LR) to train our model for 10 epoch.

We can see that there is a new file called ``small_train.txt.model`` in current directory. This
is the trainned model checkpoint file. We can use the model file to make prediction like this ::
We can see that a new file called ``small_train.txt.model`` has been generated in current directory.
This file stores the trainned model checkpoint, and we can use this model file to make prediction ::

./xlearn_predict ./small_test.txt ./small_train.txt.model

Then we can get a new file called ``small_test.txt.out``. This is output prediction result.
Let's see the first ten lines of result by using the following command ::
Then we can get a new file called ``small_test.txt.out`` in current directory. This is output
prediction result. Let's see the first five lines of output by using the following command ::
head -n 10 ./small_test.txt.out
head -n 5 ./small_test.txt.out

-1.9872
-0.0707959
-0.456214
-0.170811
-1.28986
-0.618315
-1.60154
-1.50124
-0.347515
-1.12173

This is the score for every example in test set. The negative data represents a negative example and
positive data represents the positive example. You can convert the score to 0~1 by using ``--sigmoid`` option,
or you can convert your result to bianry result (0 and 1) by using ``--sign`` option ::

./xlearn_predict ./small_test.txt ./small_train.txt.model --sigmoid
head -n 10 ./small_test.txt.out

0.120553
0.482308
0.387884
0.457401
0.215877
0.350165
0.167766
0.182241
0.413985
0.245691

The ten lines of data is the score for every example in test set. The negative data represents the
negative example and positive data represents the positive example. You can convert the score to (0-1)
by using ``--sigmoid`` option, or you can convert your result to bianry result (0 and 1) by using
``--sign`` option ::

./xlearn_predict ./small_test.txt ./small_train.txt.model --sigmoid
head -n 5 ./small_test.txt.out

0.120553
0.482308
0.387884
0.457401
0.215877

./xlearn_predict ./small_test.txt ./small_train.txt.model --sign
head -n 5 ./small_test.txt.out

0
0
0
0
0

Choose Machine Learning Model
----------------------------------------
Expand Down

0 comments on commit 7f67f88

Please sign in to comment.