Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Dec 9, 2017
1 parent c424c57 commit 38a9baa
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 34 deletions.
Binary file modified _build/doctrees/command_line.doctree
Binary file not shown.
Binary file modified _build/doctrees/environment.pickle
Binary file not shown.
Binary file modified _build/doctrees/install.doctree
Binary file not shown.
27 changes: 17 additions & 10 deletions _build/html/_sources/command_line.rst.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
xLearn Command Line Guide
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Once you build xLearn from source code successfully, you will get two executable files
Once you built 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.
two executable files to perform training and prediction task.

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

Make sure that you are in the build path of xLearn, and you will find the demo data
Make sure that you are in the ``build`` directory 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

Here we print a portion of the output ::
Here, we show a portion of the xLearn's output ::

Epoch Train log_loss Time cost (sec)
1 0.567514 0.00
Expand All @@ -28,10 +28,11 @@ Here we print a portion of the output ::
9 0.405954 0.00
10 0.396313 0.00

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

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 ::
This file stores the trainned model checkpoint, and we can use this model file to make prediction in
the future ::

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

Expand All @@ -46,10 +47,10 @@ prediction result. Let's see the first five lines of output by using the followi
-0.170811
-1.28986

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 ::
These five lines of data is the prediction score calculated 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
Expand All @@ -69,6 +70,12 @@ by using ``--sigmoid`` option, or you can convert your result to bianry result (
0
0

Users may generate many model files, so you can set the name of the model checkpoint file
by using ``-m`` option ::

./xlearn_train ./small_train.txt -m model_1.bin
./xlearn_train ./small_train.txt -e 5 -m model_2.bin

Choose Machine Learning Model
----------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion _build/html/_sources/install.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ and then build xLearn using the folloing commands ::
cd xlearn
./build.sh

The ``build.sh`` will build xLearn in ``build`` directory in current path.
The ``build.sh`` will build xLearn in the ``build`` directory in current path.

Test
----------------------------------
Expand Down
27 changes: 17 additions & 10 deletions _build/html/command_line.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@

<div class="section" id="xlearn-command-line-guide">
<h1>xLearn Command Line Guide<a class="headerlink" href="#xlearn-command-line-guide" title="Permalink to this headline"></a></h1>
<p>Once you build xLearn from source code successfully, you will get two executable files
<p>Once you built xLearn from source code successfully, you will get two executable files
<code class="docutils literal"><span class="pre">xlearn_train</span></code> and <code class="docutils literal"><span class="pre">xlearn_predict</span></code> in your <code class="docutils literal"><span class="pre">build</span></code> directory. Now you can use these
two executable files to perform training task and prediction task.</p>
two executable files to perform training and prediction task.</p>
<div class="section" id="quick-start">
<h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to this headline"></a></h2>
<p>Make sure that you are in the build path of xLearn, and you will find the demo data
<p>Make sure that you are in the <code class="docutils literal"><span class="pre">build</span></code> directory of xLearn, and you will find the demo data
<code class="docutils literal"><span class="pre">small_test.txt</span></code> and <code class="docutils literal"><span class="pre">small_train.txt</span></code> in this directory. Now you can type the following
command to train a model</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">xlearn_train</span> <span class="o">./</span><span class="n">small_train</span><span class="o">.</span><span class="n">txt</span>
</pre></div>
</div>
<p>Here we print a portion of the output</p>
<p>Here, we show a portion of the xLearn’s output</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Epoch</span> <span class="n">Train</span> <span class="n">log_loss</span> <span class="n">Time</span> <span class="n">cost</span> <span class="p">(</span><span class="n">sec</span><span class="p">)</span>
<span class="mi">1</span> <span class="mf">0.567514</span> <span class="mf">0.00</span>
<span class="mi">2</span> <span class="mf">0.516861</span> <span class="mf">0.00</span>
Expand All @@ -192,9 +192,10 @@ <h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to thi
<span class="mi">10</span> <span class="mf">0.396313</span> <span class="mf">0.00</span>
</pre></div>
</div>
<p>On default, xLearn will use the logistic regression (LR) to train our model for 10 epoch.</p>
<p>On default, xLearn will use the logistic regression (LR) to train our model within 10 epoch.</p>
<p>We can see that a new file called <code class="docutils literal"><span class="pre">small_train.txt.model</span></code> has been generated in current directory.
This file stores the trainned model checkpoint, and we can use this model file to make prediction</p>
This file stores the trainned model checkpoint, and we can use this model file to make prediction in
the future</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">xlearn_predict</span> <span class="o">./</span><span class="n">small_test</span><span class="o">.</span><span class="n">txt</span> <span class="o">./</span><span class="n">small_train</span><span class="o">.</span><span class="n">txt</span><span class="o">.</span><span class="n">model</span>
</pre></div>
</div>
Expand All @@ -209,10 +210,10 @@ <h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to thi
<span class="o">-</span><span class="mf">1.28986</span>
</pre></div>
</div>
<p>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 <code class="docutils literal"><span class="pre">--sigmoid</span></code> option, or you can convert your result to bianry result (0 and 1) by using
<code class="docutils literal"><span class="pre">--sign</span></code> option</p>
<p>These five lines of data is the prediction score calculated 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 <code class="docutils literal"><span class="pre">--sigmoid</span></code> option, or you can convert your result
to bianry result (0 and 1) by using <code class="docutils literal"><span class="pre">--sign</span></code> option</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">xlearn_predict</span> <span class="o">./</span><span class="n">small_test</span><span class="o">.</span><span class="n">txt</span> <span class="o">./</span><span class="n">small_train</span><span class="o">.</span><span class="n">txt</span><span class="o">.</span><span class="n">model</span> <span class="o">--</span><span class="n">sigmoid</span>
<span class="n">head</span> <span class="o">-</span><span class="n">n</span> <span class="mi">5</span> <span class="o">./</span><span class="n">small_test</span><span class="o">.</span><span class="n">txt</span><span class="o">.</span><span class="n">out</span>

Expand All @@ -232,6 +233,12 @@ <h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to thi
<span class="mi">0</span>
</pre></div>
</div>
<p>Users may generate many model files, so you can set the name of the model checkpoint file
by using <code class="docutils literal"><span class="pre">-m</span></code> option</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">xlearn_train</span> <span class="o">./</span><span class="n">small_train</span><span class="o">.</span><span class="n">txt</span> <span class="o">-</span><span class="n">m</span> <span class="n">model_1</span><span class="o">.</span><span class="n">bin</span>
<span class="o">./</span><span class="n">xlearn_train</span> <span class="o">./</span><span class="n">small_train</span><span class="o">.</span><span class="n">txt</span> <span class="o">-</span><span class="n">e</span> <span class="mi">5</span> <span class="o">-</span><span class="n">m</span> <span class="n">model_2</span><span class="o">.</span><span class="n">bin</span>
</pre></div>
</div>
</div>
<div class="section" id="choose-machine-learning-model">
<h2>Choose Machine Learning Model<a class="headerlink" href="#choose-machine-learning-model" title="Permalink to this headline"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion _build/html/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ <h2>Install xLearn from Source Code<a class="headerlink" href="#install-xlearn-f
<span class="o">./</span><span class="n">build</span><span class="o">.</span><span class="n">sh</span>
</pre></div>
</div>
<p>The <code class="docutils literal"><span class="pre">build.sh</span></code> will build xLearn in <code class="docutils literal"><span class="pre">build</span></code> directory in current path.</p>
<p>The <code class="docutils literal"><span class="pre">build.sh</span></code> will build xLearn in the <code class="docutils literal"><span class="pre">build</span></code> directory in current path.</p>
</div>
<div class="section" id="test">
<h2>Test<a class="headerlink" href="#test" title="Permalink to this headline"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion _build/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 38a9baa

Please sign in to comment.