Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Dec 8, 2017
1 parent 7f67f88 commit 15ceef7
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 67 deletions.
Binary file modified _build/doctrees/command_line.doctree
Binary file not shown.
Binary file modified _build/doctrees/environment.pickle
Binary file not shown.
70 changes: 36 additions & 34 deletions _build/html/_sources/command_line.rst.txt
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,47 +30,49 @@ 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
----------------------------------------

For now, xLearn can support three different machine learning model, including LR, FM and FFM.

.. toctree::
:hidden:
51 changes: 26 additions & 25 deletions _build/html/command_line.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@

<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 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>
<p>Once you build 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>
<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 <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>
<p>Make sure that you are in the build path 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>
Expand All @@ -193,48 +193,49 @@ <h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to thi
</pre></div>
</div>
<p>On default, xLearn will use the logistic regression (LR) to train our model for 10 epoch.</p>
<p>We can see that there is a new file called <code class="docutils literal"><span class="pre">small_train.txt.model</span></code> in current directory. This
is the trainned model checkpoint file. We can use the model file to make prediction like this</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>
<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>
<p>Then we can get a new file called <code class="docutils literal"><span class="pre">small_test.txt.out</span></code>. This is output prediction result.
Let’s see the first ten lines of result by using the following command</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">head</span> <span class="o">-</span><span class="n">n</span> <span class="mi">10</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>
<p>Then we can get a new file called <code class="docutils literal"><span class="pre">small_test.txt.out</span></code> in current directory. This is output
prediction result. Let’s see the first five lines of output by using the following command</p>
<div class="highlight-default"><div class="highlight"><pre><span></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>

<span class="o">-</span><span class="mf">1.9872</span>
<span class="o">-</span><span class="mf">0.0707959</span>
<span class="o">-</span><span class="mf">0.456214</span>
<span class="o">-</span><span class="mf">0.170811</span>
<span class="o">-</span><span class="mf">1.28986</span>
<span class="o">-</span><span class="mf">0.618315</span>
<span class="o">-</span><span class="mf">1.60154</span>
<span class="o">-</span><span class="mf">1.50124</span>
<span class="o">-</span><span class="mf">0.347515</span>
<span class="o">-</span><span class="mf">1.12173</span>
</pre></div>
</div>
<p>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 <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>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>
<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">10</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>
<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>

<span class="mf">0.120553</span>
<span class="mf">0.482308</span>
<span class="mf">0.387884</span>
<span class="mf">0.457401</span>
<span class="mf">0.215877</span>
<span class="mf">0.350165</span>
<span class="mf">0.167766</span>
<span class="mf">0.182241</span>
<span class="mf">0.413985</span>
<span class="mf">0.245691</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">sign</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>

<span class="mi">0</span>
<span class="mi">0</span>
<span class="mi">0</span>
<span class="mi">0</span>
<span class="mi">0</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>
<p>For now, xLearn can support three different machine learning model, including LR, FM and FFM.</p>
<blockquote>
<div><div class="toctree-wrapper compound">
</div>
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.

2 changes: 2 additions & 0 deletions command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ by using ``--sigmoid`` option, or you can convert your result to bianry result (
Choose Machine Learning Model
----------------------------------------

For now, xLearn can support three different machine learning model, including LR, FM and FFM.

.. toctree::
:hidden:
8 changes: 1 addition & 7 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -142,7 +141,6 @@
u'Chao Ma', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
Expand All @@ -152,7 +150,6 @@
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -162,7 +159,4 @@
(master_doc, 'xlearn_doc', u'xlearn_doc Documentation',
author, 'xlearn_doc', 'One line description of project.',
'Miscellaneous'),
]



]

0 comments on commit 15ceef7

Please sign in to comment.