Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Dec 19, 2017
1 parent 6fa0751 commit dc08851
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
Binary file modified _build/doctrees/demo.doctree
Binary file not shown.
Binary file modified _build/doctrees/environment.pickle
Binary file not shown.
15 changes: 15 additions & 0 deletions _build/html/_sources/demo.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ survived the tragedy. (`Link`__)

You can find the data used in this demo in the path ``/demo/classification/titanic/``.

The follow code is the Python demo:

.. code-block:: python
import xlearn as xl
# Training task
fm_model = xl.create_fm()
fm_model.setTrain("./titanic_train.txt")
param = {'task':'binary', 'lr':0.2,
'lambda':0.002, 'metric':'acc'}
# Cross-validation
fm_model.cv(param)
House Price Prediction
-----------------------------

Expand Down
13 changes: 13 additions & 0 deletions _build/html/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,19 @@ <h2>Predict Survival in Titanic<a class="headerlink" href="#predict-survival-in-
were likely to survive. In particular, we ask you to apply the tools of machine learning to predict which passengers
survived the tragedy. (<a class="reference external" href="https://www.kaggle.com/c/titanic">Link</a>)</p>
<p>You can find the data used in this demo in the path <code class="docutils literal"><span class="pre">/demo/classification/titanic/</span></code>.</p>
<p>The follow code is the Python demo:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">xlearn</span> <span class="kn">as</span> <span class="nn">xl</span>

<span class="c1"># Training task</span>
<span class="n">fm_model</span> <span class="o">=</span> <span class="n">xl</span><span class="o">.</span><span class="n">create_fm</span><span class="p">()</span>
<span class="n">fm_model</span><span class="o">.</span><span class="n">setTrain</span><span class="p">(</span><span class="s2">&quot;./titanic_train.txt&quot;</span><span class="p">)</span>
<span class="n">param</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;task&#39;</span><span class="p">:</span><span class="s1">&#39;binary&#39;</span><span class="p">,</span> <span class="s1">&#39;lr&#39;</span><span class="p">:</span><span class="mf">0.2</span><span class="p">,</span>
<span class="s1">&#39;lambda&#39;</span><span class="p">:</span><span class="mf">0.002</span><span class="p">,</span> <span class="s1">&#39;metric&#39;</span><span class="p">:</span><span class="s1">&#39;acc&#39;</span><span class="p">}</span>

<span class="c1"># Cross-validation</span>
<span class="n">fm_model</span><span class="o">.</span><span class="n">cv</span><span class="p">(</span><span class="n">param</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="house-price-prediction">
<h2>House Price Prediction<a class="headerlink" href="#house-price-prediction" title="Permalink to this headline"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion _build/html/searchindex.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ survived the tragedy. (`Link`__)

You can find the data used in this demo in the path ``/demo/classification/titanic/``.

The follow code is the Python demo:

.. code-block:: python
import xlearn as xl
# Training task
fm_model = xl.create_fm()
fm_model.setTrain("./titanic_train.txt")
param = {'task':'binary', 'lr':0.2,
'lambda':0.002, 'metric':'acc'}
# Cross-validation
fm_model.cv(param)
House Price Prediction
-----------------------------

Expand Down

0 comments on commit dc08851

Please sign in to comment.