mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-22 19:23:30 +00:00
[Automated]: Update Python API docs (#14427)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: fs-eire <fs-eire@users.noreply.github.com>
This commit is contained in:
parent
5601b10644
commit
79542dd377
20 changed files with 188 additions and 173 deletions
|
|
@ -112,7 +112,7 @@ without using <em>onnx</em>.</p>
|
|||
<p>The backend API is implemented by other frameworks
|
||||
and makes it easier to switch between multiple runtimes
|
||||
with the same API.</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.016 seconds)</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.014 seconds)</p>
|
||||
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-backend-py">
|
||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||
<p><a class="reference download internal" download="" href="../downloads/3e23fa9ebb26f4728ee8426ed7da0f63/plot_backend.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_backend.py</span></code></a></p>
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ and we show the confusion matrix.</p>
|
|||
<span class="nb">print</span><span class="p">(</span><span class="n">r2_score</span><span class="p">(</span><span class="n">y_test</span><span class="p">,</span> <span class="n">pred</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>0.9358557991605122
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>0.8778842817557302
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -200,12 +200,12 @@ ONNX Runtime expects one observation at a time.</p>
|
|||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="n">r2_score</span><span class="p">(</span><span class="n">pred</span><span class="p">,</span> <span class="n">pred_onx</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>0.9999999999999337
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>0.999999999999964
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Very similar. <em>ONNX Runtime</em> uses floats instead of doubles,
|
||||
that explains the small discrepencies.</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 1.066 seconds)</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 1.044 seconds)</p>
|
||||
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-convert-pipeline-vectorizer-py">
|
||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||
<p><a class="reference download internal" download="" href="../downloads/982a1f7abbb8ffc5d5e98b671c35e5aa/plot_convert_pipeline_vectorizer.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_convert_pipeline_vectorizer.py</span></code></a></p>
|
||||
|
|
|
|||
|
|
@ -108,24 +108,24 @@ output type tensor(float)
|
|||
<span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[array([[[0.5179582 , 0.61270964, 0.61406195, 0.5725736 , 0.51330644],
|
||||
[0.69485235, 0.5532911 , 0.52013624, 0.636309 , 0.70414793],
|
||||
[0.6428818 , 0.63155353, 0.6381408 , 0.5325222 , 0.63684714],
|
||||
[0.71618 , 0.54053146, 0.7182288 , 0.54457587, 0.67911494]],
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[array([[[0.7074605 , 0.66807246, 0.5468252 , 0.6794102 , 0.72581375],
|
||||
[0.7061233 , 0.7108102 , 0.7131539 , 0.5087233 , 0.7157812 ],
|
||||
[0.5101798 , 0.6822957 , 0.71132684, 0.63517916, 0.5935693 ],
|
||||
[0.6674769 , 0.71915364, 0.6055379 , 0.6265797 , 0.6334329 ]],
|
||||
|
||||
[[0.54977566, 0.69168943, 0.56264675, 0.7119333 , 0.6331944 ],
|
||||
[0.6970906 , 0.6601206 , 0.6880265 , 0.50476724, 0.71472955],
|
||||
[0.72150964, 0.7020236 , 0.65242076, 0.58242726, 0.5292552 ],
|
||||
[0.5488381 , 0.5718334 , 0.5828182 , 0.68686056, 0.7161767 ]],
|
||||
[[0.7060813 , 0.65122193, 0.5852989 , 0.7020965 , 0.5418902 ],
|
||||
[0.70865536, 0.7239054 , 0.53950447, 0.6397851 , 0.61991036],
|
||||
[0.5108298 , 0.70998025, 0.5768114 , 0.70231366, 0.7083629 ],
|
||||
[0.5532729 , 0.6634668 , 0.68702626, 0.53754365, 0.63848865]],
|
||||
|
||||
[[0.6186368 , 0.5709658 , 0.59708256, 0.627766 , 0.64522445],
|
||||
[0.6574453 , 0.63655937, 0.6999107 , 0.70128393, 0.65033275],
|
||||
[0.5789951 , 0.61559284, 0.66066134, 0.6682638 , 0.69809294],
|
||||
[0.697786 , 0.6425333 , 0.6025326 , 0.6508598 , 0.62747025]]],
|
||||
[[0.5546355 , 0.5326628 , 0.6045945 , 0.72216797, 0.5367474 ],
|
||||
[0.54598904, 0.683926 , 0.7086522 , 0.5805207 , 0.6906233 ],
|
||||
[0.71620524, 0.6052958 , 0.7310034 , 0.6245417 , 0.6648243 ],
|
||||
[0.6229709 , 0.5226055 , 0.67183244, 0.6684347 , 0.57293963]]],
|
||||
dtype=float32)]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.009 seconds)</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.007 seconds)</p>
|
||||
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-load-and-predict-py">
|
||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||
<p><a class="reference download internal" download="" href="../downloads/7c8424f45d0156abd4d0221c65601124/plot_load_and_predict.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_load_and_predict.py</span></code></a></p>
|
||||
|
|
|
|||
|
|
@ -183,10 +183,10 @@ in a different way than before.</p>
|
|||
<span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">image</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<img src="../images/sphx_glr_plot_pipeline_001.png" srcset="../images/sphx_glr_plot_pipeline_001.png" alt="plot pipeline" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span><matplotlib.image.AxesImage object at 0x7effb65e3d90>
|
||||
<img src="../images/sphx_glr_plot_pipeline_001.png" srcset="../images/sphx_glr_plot_pipeline_001.png" alt="plot pipeline" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span><matplotlib.image.AxesImage object at 0x7f0fecf2bd90>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.221 seconds)</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.136 seconds)</p>
|
||||
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-pipeline-py">
|
||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||
<p><a class="reference download internal" download="" href="../downloads/d436e9922b51a71358604ec00f09e7e4/plot_pipeline.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_pipeline.py</span></code></a></p>
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ before running the predictions.</p>
|
|||
<span class="nb">print</span><span class="p">(</span><span class="n">prof_file</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>onnxruntime_profile__2023-01-25_17-47-38.json
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>onnxruntime_profile__2023-01-26_22-44-30.json
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The results are stored un a file in JSON format.
|
||||
|
|
@ -122,20 +122,20 @@ Let’s see what it contains.</p>
|
|||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[{'args': {},
|
||||
'cat': 'Session',
|
||||
'dur': 62,
|
||||
'dur': 59,
|
||||
'name': 'model_loading_array',
|
||||
'ph': 'X',
|
||||
'pid': 2783,
|
||||
'tid': 2783,
|
||||
'pid': 2745,
|
||||
'tid': 2745,
|
||||
'ts': 1},
|
||||
{'args': {},
|
||||
'cat': 'Session',
|
||||
'dur': 283,
|
||||
'dur': 308,
|
||||
'name': 'session_initialization',
|
||||
'ph': 'X',
|
||||
'pid': 2783,
|
||||
'tid': 2783,
|
||||
'ts': 76}]
|
||||
'pid': 2745,
|
||||
'tid': 2745,
|
||||
'ts': 73}]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 0.005 seconds)</p>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,16 @@ to its use in its converted from.</p>
|
|||
<span class="n">clr</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X_train</span><span class="p">,</span> <span class="n">y_train</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>/home/runner/.local/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py:444: ConvergenceWarning: lbfgs failed to converge (status=1):
|
||||
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.
|
||||
|
||||
Increase the number of iterations (max_iter) or scale the data as shown in:
|
||||
https://scikit-learn.org/stable/modules/preprocessing.html
|
||||
Please also refer to the documentation for alternative solver options:
|
||||
https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
|
||||
n_iter_i = _check_optimize_result(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output_subarea output_html rendered_html output_result">
|
||||
<style>#sk-container-id-2 {color: black;background-color: white;}#sk-container-id-2 pre{padding: 0;}#sk-container-id-2 div.sk-toggleable {background-color: white;}#sk-container-id-2 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-2 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-2 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-2 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-2 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-2 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-2 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-2 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-2 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-2 div.sk-item {position: relative;z-index: 1;}#sk-container-id-2 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-2 div.sk-item::before, #sk-container-id-2 div.sk-parallel-item::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-2 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-2 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-2 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-2 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-2 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-2 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-2 div.sk-label-container {text-align: center;}#sk-container-id-2 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-2 div.sk-text-repr-fallback {display: none;}</style><div id="sk-container-id-2" class="sk-top-container"><div class="sk-text-repr-fallback"><pre>LogisticRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class="sk-container" hidden><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-4" type="checkbox" checked><label for="sk-estimator-id-4" class="sk-toggleable__label sk-toggleable__label-arrow">LogisticRegression</label><div class="sk-toggleable__content"><pre>LogisticRegression()</pre></div></div></div></div></div>
|
||||
</div>
|
||||
|
|
@ -98,9 +108,9 @@ and we show the confusion matrix.</p>
|
|||
<span class="nb">print</span><span class="p">(</span><span class="n">confusion_matrix</span><span class="p">(</span><span class="n">y_test</span><span class="p">,</span> <span class="n">pred</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[[12 0 0]
|
||||
[ 0 12 1]
|
||||
[ 0 0 13]]
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[[14 0 0]
|
||||
[ 0 11 0]
|
||||
[ 0 1 12]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -142,9 +152,9 @@ output name='output_label' and shape=[None]
|
|||
<span class="nb">print</span><span class="p">(</span><span class="n">confusion_matrix</span><span class="p">(</span><span class="n">pred</span><span class="p">,</span> <span class="n">pred_onx</span><span class="p">))</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[[12 0 0]
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[[14 0 0]
|
||||
[ 0 12 0]
|
||||
[ 0 0 14]]
|
||||
[ 0 0 12]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The prediction are perfectly identical.</p>
|
||||
|
|
@ -159,9 +169,9 @@ scikit-learn.</p>
|
|||
<span class="nb">print</span><span class="p">(</span><span class="n">prob_sklearn</span><span class="p">[:</span><span class="mi">3</span><span class="p">])</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[[9.64397638e-01 3.56022281e-02 1.33661432e-07]
|
||||
[1.12861883e-02 7.36931324e-01 2.51782488e-01]
|
||||
[9.71882114e-01 2.81177168e-02 1.68768358e-07]]
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[[1.90908960e-01 8.02874408e-01 6.21663156e-03]
|
||||
[2.81698299e-02 9.12759445e-01 5.90707247e-02]
|
||||
[9.67801591e-01 3.21983324e-02 7.64754321e-08]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>And then with ONNX Runtime.
|
||||
|
|
@ -174,9 +184,9 @@ The probabilies appear to be</p>
|
|||
<span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">prob_rt</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="mi">3</span><span class="p">])</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[{0: 0.964397668838501, 1: 0.03560224175453186, 2: 1.3366144457904738e-07},
|
||||
{0: 0.01128618698567152, 1: 0.7369312644004822, 2: 0.25178253650665283},
|
||||
{0: 0.9718821048736572, 1: 0.028117714449763298, 2: 1.6876846586910688e-07}]
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>[{0: 0.19090914726257324, 1: 0.8028742074966431, 2: 0.0062166303396224976},
|
||||
{0: 0.02816985361278057, 1: 0.9127594232559204, 2: 0.059070732444524765},
|
||||
{0: 0.9678016304969788, 1: 0.03219832107424736, 2: 7.647536648391906e-08}]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Let’s benchmark.</p>
|
||||
|
|
@ -200,11 +210,11 @@ The probabilies appear to be</p>
|
|||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Execution time for clr.predict
|
||||
Average 4.45e-05 min=4.23e-05 max=5.86e-05
|
||||
Average 4.44e-05 min=4.24e-05 max=5.4e-05
|
||||
Execution time for ONNX Runtime
|
||||
Average 2.2e-05 min=2.14e-05 max=2.68e-05
|
||||
Average 2.21e-05 min=2.16e-05 max=2.71e-05
|
||||
|
||||
2.1959864999132605e-05
|
||||
2.2087500000509407e-05
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Let’s benchmark a scenario similar to what a webservice
|
||||
|
|
@ -232,11 +242,11 @@ as opposed to a batch of prediction.</p>
|
|||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Execution time for clr.predict
|
||||
Average 0.00412 min=0.00409 max=0.00419
|
||||
Average 0.00406 min=0.00404 max=0.00414
|
||||
Execution time for sess_predict
|
||||
Average 0.00102 min=0.00101 max=0.00105
|
||||
Average 0.00104 min=0.00102 max=0.00107
|
||||
|
||||
0.0010201415149995795
|
||||
0.00103513229499967
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Let’s do the same for the probabilities.</p>
|
||||
|
|
@ -253,11 +263,11 @@ Average 0.00102 min=0.00101 max=0.00105
|
|||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Execution time for predict_proba
|
||||
Average 0.0062 min=0.00618 max=0.00622
|
||||
Average 0.0061 min=0.00608 max=0.00626
|
||||
Execution time for sess_predict_proba
|
||||
Average 0.00108 min=0.00107 max=0.0011
|
||||
|
||||
0.0010763829249992797
|
||||
0.001081757285000009
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This second comparison is better as
|
||||
|
|
@ -295,11 +305,11 @@ in every case.</p>
|
|||
</pre></div>
|
||||
</div>
|
||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Execution time for predict_proba
|
||||
Average 0.676 min=0.675 max=0.678
|
||||
Average 0.674 min=0.672 max=0.678
|
||||
Execution time for sess_predict_proba
|
||||
Average 0.00136 min=0.00132 max=0.00164
|
||||
Average 0.0013 min=0.00129 max=0.00133
|
||||
|
||||
0.0013557706149995852
|
||||
0.001301839815000676
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Let’s see with different number of trees.</p>
|
||||
|
|
@ -334,40 +344,40 @@ Average 0.00136 min=0.00132 max=0.00164
|
|||
</pre></div>
|
||||
</div>
|
||||
<img src="../images/sphx_glr_plot_train_convert_predict_001.png" srcset="../images/sphx_glr_plot_train_convert_predict_001.png" alt="Speed comparison between scikit-learn and ONNX Runtime For a random forest on Iris dataset" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>5
|
||||
Average 0.0492 min=0.0491 max=0.0493
|
||||
Average 0.00102 min=0.00101 max=0.00104
|
||||
Average 0.0491 min=0.049 max=0.0491
|
||||
Average 0.00103 min=0.00102 max=0.00105
|
||||
10
|
||||
Average 0.0825 min=0.0824 max=0.0827
|
||||
Average 0.00105 min=0.00104 max=0.00107
|
||||
Average 0.0823 min=0.0822 max=0.0824
|
||||
Average 0.00104 min=0.00102 max=0.00106
|
||||
15
|
||||
Average 0.116 min=0.116 max=0.116
|
||||
Average 0.00104 min=0.00103 max=0.00107
|
||||
Average 0.115 min=0.115 max=0.115
|
||||
Average 0.00103 min=0.00102 max=0.00106
|
||||
20
|
||||
Average 0.149 min=0.149 max=0.149
|
||||
Average 0.00106 min=0.00105 max=0.00108
|
||||
Average 0.148 min=0.148 max=0.148
|
||||
Average 0.00105 min=0.00104 max=0.00108
|
||||
25
|
||||
Average 0.182 min=0.182 max=0.184
|
||||
Average 0.00108 min=0.00107 max=0.0011
|
||||
Average 0.181 min=0.181 max=0.182
|
||||
Average 0.00107 min=0.00106 max=0.00109
|
||||
30
|
||||
Average 0.215 min=0.214 max=0.215
|
||||
Average 0.00108 min=0.00108 max=0.0011
|
||||
Average 0.214 min=0.214 max=0.214
|
||||
Average 0.00107 min=0.00106 max=0.00109
|
||||
35
|
||||
Average 0.248 min=0.247 max=0.248
|
||||
Average 0.0011 min=0.00108 max=0.00113
|
||||
Average 0.247 min=0.247 max=0.248
|
||||
Average 0.00109 min=0.00108 max=0.00111
|
||||
40
|
||||
Average 0.281 min=0.281 max=0.281
|
||||
Average 0.0011 min=0.00109 max=0.00113
|
||||
Average 0.28 min=0.279 max=0.28
|
||||
Average 0.00109 min=0.00108 max=0.00112
|
||||
45
|
||||
Average 0.314 min=0.314 max=0.314
|
||||
Average 0.0011 min=0.00109 max=0.00113
|
||||
Average 0.312 min=0.311 max=0.312
|
||||
Average 0.00112 min=0.00111 max=0.00115
|
||||
50
|
||||
Average 0.347 min=0.347 max=0.348
|
||||
Average 0.00113 min=0.00112 max=0.00116
|
||||
Average 0.345 min=0.344 max=0.345
|
||||
Average 0.00112 min=0.00111 max=0.00114
|
||||
|
||||
<matplotlib.legend.Legend object at 0x7eff9f4d4400>
|
||||
<matplotlib.legend.Legend object at 0x7f0fd5bd2a40>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 3 minutes 8.827 seconds)</p>
|
||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 3 minutes 8.150 seconds)</p>
|
||||
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-train-convert-predict-py">
|
||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||
<p><a class="reference download internal" download="" href="../downloads/c647c128e0cf2b3db04ce60b41ef1a14/plot_train_convert_predict.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_train_convert_predict.py</span></code></a></p>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
<section id="computation-times">
|
||||
<span id="sphx-glr-auto-examples-sg-execution-times"></span><h1>Computation times<a class="headerlink" href="#computation-times" title="Permalink to this heading">¶</a></h1>
|
||||
<p><strong>03:10.156</strong> total execution time for <strong>auto_examples</strong> files:</p>
|
||||
<p><strong>03:09.367</strong> total execution time for <strong>auto_examples</strong> files:</p>
|
||||
<table class="docutils align-default">
|
||||
<colgroup>
|
||||
<col style="width: 85%" />
|
||||
|
|
@ -58,29 +58,29 @@
|
|||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="row-odd"><td><p><a class="reference internal" href="plot_train_convert_predict.html#sphx-glr-auto-examples-plot-train-convert-predict-py"><span class="std std-ref">Train, convert and predict with ONNX Runtime</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_train_convert_predict.py</span></code>)</p></td>
|
||||
<td><p>03:08.827</p></td>
|
||||
<td><p>03:08.150</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference internal" href="plot_convert_pipeline_vectorizer.html#sphx-glr-auto-examples-plot-convert-pipeline-vectorizer-py"><span class="std std-ref">Train, convert and predict with ONNX Runtime</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_convert_pipeline_vectorizer.py</span></code>)</p></td>
|
||||
<td><p>00:01.066</p></td>
|
||||
<td><p>00:01.044</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference internal" href="plot_pipeline.html#sphx-glr-auto-examples-plot-pipeline-py"><span class="std std-ref">Draw a pipeline</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_pipeline.py</span></code>)</p></td>
|
||||
<td><p>00:00.221</p></td>
|
||||
<td><p>00:00.136</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference internal" href="plot_backend.html#sphx-glr-auto-examples-plot-backend-py"><span class="std std-ref">ONNX Runtime Backend for ONNX</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_backend.py</span></code>)</p></td>
|
||||
<td><p>00:00.016</p></td>
|
||||
<td><p>00:00.014</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference internal" href="plot_load_and_predict.html#sphx-glr-auto-examples-plot-load-and-predict-py"><span class="std std-ref">Load and predict with ONNX Runtime and a very simple model</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_load_and_predict.py</span></code>)</p></td>
|
||||
<td><p>00:00.009</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference internal" href="plot_common_errors.html#sphx-glr-auto-examples-plot-common-errors-py"><span class="std std-ref">Common errors with onnxruntime</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_common_errors.py</span></code>)</p></td>
|
||||
<tr class="row-odd"><td><p><a class="reference internal" href="plot_common_errors.html#sphx-glr-auto-examples-plot-common-errors-py"><span class="std std-ref">Common errors with onnxruntime</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_common_errors.py</span></code>)</p></td>
|
||||
<td><p>00:00.008</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference internal" href="plot_load_and_predict.html#sphx-glr-auto-examples-plot-load-and-predict-py"><span class="std std-ref">Load and predict with ONNX Runtime and a very simple model</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_load_and_predict.py</span></code>)</p></td>
|
||||
<td><p>00:00.007</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference internal" href="plot_profiling.html#sphx-glr-auto-examples-plot-profiling-py"><span class="std std-ref">Profile the execution of a simple model</span></a> (<code class="docutils literal notranslate"><span class="pre">plot_profiling.py</span></code>)</p></td>
|
||||
<td><p>00:00.005</p></td>
|
||||
<td><p>0.0 MB</p></td>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
File diff suppressed because one or more lines are too long
|
|
@ -129,7 +129,7 @@ with the same API.
|
|||
|
||||
.. rst-class:: sphx-glr-timing
|
||||
|
||||
**Total running time of the script:** ( 0 minutes 0.016 seconds)
|
||||
**Total running time of the script:** ( 0 minutes 0.014 seconds)
|
||||
|
||||
|
||||
.. _sphx_glr_download_auto_examples_plot_backend.py:
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ and we show the confusion matrix.
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
0.9358557991605122
|
||||
0.8778842817557302
|
||||
|
||||
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ We compare them to the model's ones.
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
0.9999999999999337
|
||||
0.999999999999964
|
||||
|
||||
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ that explains the small discrepencies.
|
|||
|
||||
.. rst-class:: sphx-glr-timing
|
||||
|
||||
**Total running time of the script:** ( 0 minutes 1.066 seconds)
|
||||
**Total running time of the script:** ( 0 minutes 1.044 seconds)
|
||||
|
||||
|
||||
.. _sphx_glr_download_auto_examples_plot_convert_pipeline_vectorizer.py:
|
||||
|
|
|
|||
|
|
@ -149,20 +149,20 @@ Let's compute its outputs (or predictions if it is a machine learned model).
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
[array([[[0.5179582 , 0.61270964, 0.61406195, 0.5725736 , 0.51330644],
|
||||
[0.69485235, 0.5532911 , 0.52013624, 0.636309 , 0.70414793],
|
||||
[0.6428818 , 0.63155353, 0.6381408 , 0.5325222 , 0.63684714],
|
||||
[0.71618 , 0.54053146, 0.7182288 , 0.54457587, 0.67911494]],
|
||||
[array([[[0.7074605 , 0.66807246, 0.5468252 , 0.6794102 , 0.72581375],
|
||||
[0.7061233 , 0.7108102 , 0.7131539 , 0.5087233 , 0.7157812 ],
|
||||
[0.5101798 , 0.6822957 , 0.71132684, 0.63517916, 0.5935693 ],
|
||||
[0.6674769 , 0.71915364, 0.6055379 , 0.6265797 , 0.6334329 ]],
|
||||
|
||||
[[0.54977566, 0.69168943, 0.56264675, 0.7119333 , 0.6331944 ],
|
||||
[0.6970906 , 0.6601206 , 0.6880265 , 0.50476724, 0.71472955],
|
||||
[0.72150964, 0.7020236 , 0.65242076, 0.58242726, 0.5292552 ],
|
||||
[0.5488381 , 0.5718334 , 0.5828182 , 0.68686056, 0.7161767 ]],
|
||||
[[0.7060813 , 0.65122193, 0.5852989 , 0.7020965 , 0.5418902 ],
|
||||
[0.70865536, 0.7239054 , 0.53950447, 0.6397851 , 0.61991036],
|
||||
[0.5108298 , 0.70998025, 0.5768114 , 0.70231366, 0.7083629 ],
|
||||
[0.5532729 , 0.6634668 , 0.68702626, 0.53754365, 0.63848865]],
|
||||
|
||||
[[0.6186368 , 0.5709658 , 0.59708256, 0.627766 , 0.64522445],
|
||||
[0.6574453 , 0.63655937, 0.6999107 , 0.70128393, 0.65033275],
|
||||
[0.5789951 , 0.61559284, 0.66066134, 0.6682638 , 0.69809294],
|
||||
[0.697786 , 0.6425333 , 0.6025326 , 0.6508598 , 0.62747025]]],
|
||||
[[0.5546355 , 0.5326628 , 0.6045945 , 0.72216797, 0.5367474 ],
|
||||
[0.54598904, 0.683926 , 0.7086522 , 0.5805207 , 0.6906233 ],
|
||||
[0.71620524, 0.6052958 , 0.7310034 , 0.6245417 , 0.6648243 ],
|
||||
[0.6229709 , 0.5226055 , 0.67183244, 0.6684347 , 0.57293963]]],
|
||||
dtype=float32)]
|
||||
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ Let's compute its outputs (or predictions if it is a machine learned model).
|
|||
|
||||
.. rst-class:: sphx-glr-timing
|
||||
|
||||
**Total running time of the script:** ( 0 minutes 0.009 seconds)
|
||||
**Total running time of the script:** ( 0 minutes 0.007 seconds)
|
||||
|
||||
|
||||
.. _sphx_glr_download_auto_examples_plot_load_and_predict.py:
|
||||
|
|
|
|||
|
|
@ -226,14 +226,14 @@ Which we display...
|
|||
.. code-block:: none
|
||||
|
||||
|
||||
<matplotlib.image.AxesImage object at 0x7effb65e3d90>
|
||||
<matplotlib.image.AxesImage object at 0x7f0fecf2bd90>
|
||||
|
||||
|
||||
|
||||
|
||||
.. rst-class:: sphx-glr-timing
|
||||
|
||||
**Total running time of the script:** ( 0 minutes 0.221 seconds)
|
||||
**Total running time of the script:** ( 0 minutes 0.136 seconds)
|
||||
|
||||
|
||||
.. _sphx_glr_download_auto_examples_plot_pipeline.py:
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ before running the predictions.
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
onnxruntime_profile__2023-01-25_17-47-38.json
|
||||
onnxruntime_profile__2023-01-26_22-44-30.json
|
||||
|
||||
|
||||
|
||||
|
|
@ -148,20 +148,20 @@ Let's see what it contains.
|
|||
|
||||
[{'args': {},
|
||||
'cat': 'Session',
|
||||
'dur': 62,
|
||||
'dur': 59,
|
||||
'name': 'model_loading_array',
|
||||
'ph': 'X',
|
||||
'pid': 2783,
|
||||
'tid': 2783,
|
||||
'pid': 2745,
|
||||
'tid': 2745,
|
||||
'ts': 1},
|
||||
{'args': {},
|
||||
'cat': 'Session',
|
||||
'dur': 283,
|
||||
'dur': 308,
|
||||
'name': 'session_initialization',
|
||||
'ph': 'X',
|
||||
'pid': 2783,
|
||||
'tid': 2783,
|
||||
'ts': 76}]
|
||||
'pid': 2745,
|
||||
'tid': 2745,
|
||||
'ts': 73}]
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,19 @@ Then we fit a model.
|
|||
|
||||
|
||||
|
||||
.. rst-class:: sphx-glr-script-out
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
/home/runner/.local/lib/python3.10/site-packages/sklearn/linear_model/_logistic.py:444: ConvergenceWarning: lbfgs failed to converge (status=1):
|
||||
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.
|
||||
|
||||
Increase the number of iterations (max_iter) or scale the data as shown in:
|
||||
https://scikit-learn.org/stable/modules/preprocessing.html
|
||||
Please also refer to the documentation for alternative solver options:
|
||||
https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
|
||||
n_iter_i = _check_optimize_result(
|
||||
|
||||
|
||||
.. raw:: html
|
||||
|
||||
|
|
@ -105,9 +118,9 @@ and we show the confusion matrix.
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
[[12 0 0]
|
||||
[ 0 12 1]
|
||||
[ 0 0 13]]
|
||||
[[14 0 0]
|
||||
[ 0 11 0]
|
||||
[ 0 1 12]]
|
||||
|
||||
|
||||
|
||||
|
|
@ -197,9 +210,9 @@ We compute the predictions.
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
[[12 0 0]
|
||||
[[14 0 0]
|
||||
[ 0 12 0]
|
||||
[ 0 0 14]]
|
||||
[ 0 0 12]]
|
||||
|
||||
|
||||
|
||||
|
|
@ -232,9 +245,9 @@ scikit-learn.
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
[[9.64397638e-01 3.56022281e-02 1.33661432e-07]
|
||||
[1.12861883e-02 7.36931324e-01 2.51782488e-01]
|
||||
[9.71882114e-01 2.81177168e-02 1.68768358e-07]]
|
||||
[[1.90908960e-01 8.02874408e-01 6.21663156e-03]
|
||||
[2.81698299e-02 9.12759445e-01 5.90707247e-02]
|
||||
[9.67801591e-01 3.21983324e-02 7.64754321e-08]]
|
||||
|
||||
|
||||
|
||||
|
|
@ -264,9 +277,9 @@ The probabilies appear to be
|
|||
|
||||
.. code-block:: none
|
||||
|
||||
[{0: 0.964397668838501, 1: 0.03560224175453186, 2: 1.3366144457904738e-07},
|
||||
{0: 0.01128618698567152, 1: 0.7369312644004822, 2: 0.25178253650665283},
|
||||
{0: 0.9718821048736572, 1: 0.028117714449763298, 2: 1.6876846586910688e-07}]
|
||||
[{0: 0.19090914726257324, 1: 0.8028742074966431, 2: 0.0062166303396224976},
|
||||
{0: 0.02816985361278057, 1: 0.9127594232559204, 2: 0.059070732444524765},
|
||||
{0: 0.9678016304969788, 1: 0.03219832107424736, 2: 7.647536648391906e-08}]
|
||||
|
||||
|
||||
|
||||
|
|
@ -306,11 +319,11 @@ Let's benchmark.
|
|||
.. code-block:: none
|
||||
|
||||
Execution time for clr.predict
|
||||
Average 4.45e-05 min=4.23e-05 max=5.86e-05
|
||||
Average 4.44e-05 min=4.24e-05 max=5.4e-05
|
||||
Execution time for ONNX Runtime
|
||||
Average 2.2e-05 min=2.14e-05 max=2.68e-05
|
||||
Average 2.21e-05 min=2.16e-05 max=2.71e-05
|
||||
|
||||
2.1959864999132605e-05
|
||||
2.2087500000509407e-05
|
||||
|
||||
|
||||
|
||||
|
|
@ -355,11 +368,11 @@ as opposed to a batch of prediction.
|
|||
.. code-block:: none
|
||||
|
||||
Execution time for clr.predict
|
||||
Average 0.00412 min=0.00409 max=0.00419
|
||||
Average 0.00406 min=0.00404 max=0.00414
|
||||
Execution time for sess_predict
|
||||
Average 0.00102 min=0.00101 max=0.00105
|
||||
Average 0.00104 min=0.00102 max=0.00107
|
||||
|
||||
0.0010201415149995795
|
||||
0.00103513229499967
|
||||
|
||||
|
||||
|
||||
|
|
@ -392,11 +405,11 @@ Let's do the same for the probabilities.
|
|||
.. code-block:: none
|
||||
|
||||
Execution time for predict_proba
|
||||
Average 0.0062 min=0.00618 max=0.00622
|
||||
Average 0.0061 min=0.00608 max=0.00626
|
||||
Execution time for sess_predict_proba
|
||||
Average 0.00108 min=0.00107 max=0.0011
|
||||
|
||||
0.0010763829249992797
|
||||
0.001081757285000009
|
||||
|
||||
|
||||
|
||||
|
|
@ -466,11 +479,11 @@ We compare.
|
|||
.. code-block:: none
|
||||
|
||||
Execution time for predict_proba
|
||||
Average 0.676 min=0.675 max=0.678
|
||||
Average 0.674 min=0.672 max=0.678
|
||||
Execution time for sess_predict_proba
|
||||
Average 0.00136 min=0.00132 max=0.00164
|
||||
Average 0.0013 min=0.00129 max=0.00133
|
||||
|
||||
0.0013557706149995852
|
||||
0.001301839815000676
|
||||
|
||||
|
||||
|
||||
|
|
@ -525,44 +538,44 @@ Let's see with different number of trees.
|
|||
.. code-block:: none
|
||||
|
||||
5
|
||||
Average 0.0492 min=0.0491 max=0.0493
|
||||
Average 0.00102 min=0.00101 max=0.00104
|
||||
Average 0.0491 min=0.049 max=0.0491
|
||||
Average 0.00103 min=0.00102 max=0.00105
|
||||
10
|
||||
Average 0.0825 min=0.0824 max=0.0827
|
||||
Average 0.00105 min=0.00104 max=0.00107
|
||||
Average 0.0823 min=0.0822 max=0.0824
|
||||
Average 0.00104 min=0.00102 max=0.00106
|
||||
15
|
||||
Average 0.116 min=0.116 max=0.116
|
||||
Average 0.00104 min=0.00103 max=0.00107
|
||||
Average 0.115 min=0.115 max=0.115
|
||||
Average 0.00103 min=0.00102 max=0.00106
|
||||
20
|
||||
Average 0.149 min=0.149 max=0.149
|
||||
Average 0.00106 min=0.00105 max=0.00108
|
||||
Average 0.148 min=0.148 max=0.148
|
||||
Average 0.00105 min=0.00104 max=0.00108
|
||||
25
|
||||
Average 0.182 min=0.182 max=0.184
|
||||
Average 0.00108 min=0.00107 max=0.0011
|
||||
Average 0.181 min=0.181 max=0.182
|
||||
Average 0.00107 min=0.00106 max=0.00109
|
||||
30
|
||||
Average 0.215 min=0.214 max=0.215
|
||||
Average 0.00108 min=0.00108 max=0.0011
|
||||
Average 0.214 min=0.214 max=0.214
|
||||
Average 0.00107 min=0.00106 max=0.00109
|
||||
35
|
||||
Average 0.248 min=0.247 max=0.248
|
||||
Average 0.0011 min=0.00108 max=0.00113
|
||||
Average 0.247 min=0.247 max=0.248
|
||||
Average 0.00109 min=0.00108 max=0.00111
|
||||
40
|
||||
Average 0.281 min=0.281 max=0.281
|
||||
Average 0.0011 min=0.00109 max=0.00113
|
||||
Average 0.28 min=0.279 max=0.28
|
||||
Average 0.00109 min=0.00108 max=0.00112
|
||||
45
|
||||
Average 0.314 min=0.314 max=0.314
|
||||
Average 0.0011 min=0.00109 max=0.00113
|
||||
Average 0.312 min=0.311 max=0.312
|
||||
Average 0.00112 min=0.00111 max=0.00115
|
||||
50
|
||||
Average 0.347 min=0.347 max=0.348
|
||||
Average 0.00113 min=0.00112 max=0.00116
|
||||
Average 0.345 min=0.344 max=0.345
|
||||
Average 0.00112 min=0.00111 max=0.00114
|
||||
|
||||
<matplotlib.legend.Legend object at 0x7eff9f4d4400>
|
||||
<matplotlib.legend.Legend object at 0x7f0fd5bd2a40>
|
||||
|
||||
|
||||
|
||||
|
||||
.. rst-class:: sphx-glr-timing
|
||||
|
||||
**Total running time of the script:** ( 3 minutes 8.827 seconds)
|
||||
**Total running time of the script:** ( 3 minutes 8.150 seconds)
|
||||
|
||||
|
||||
.. _sphx_glr_download_auto_examples_plot_train_convert_predict.py:
|
||||
|
|
|
|||
|
|
@ -5,21 +5,21 @@
|
|||
|
||||
Computation times
|
||||
=================
|
||||
**03:10.156** total execution time for **auto_examples** files:
|
||||
**03:09.367** total execution time for **auto_examples** files:
|
||||
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_train_convert_predict.py` (``plot_train_convert_predict.py``) | 03:08.827 | 0.0 MB |
|
||||
| :ref:`sphx_glr_auto_examples_plot_train_convert_predict.py` (``plot_train_convert_predict.py``) | 03:08.150 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_convert_pipeline_vectorizer.py` (``plot_convert_pipeline_vectorizer.py``) | 00:01.066 | 0.0 MB |
|
||||
| :ref:`sphx_glr_auto_examples_plot_convert_pipeline_vectorizer.py` (``plot_convert_pipeline_vectorizer.py``) | 00:01.044 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_pipeline.py` (``plot_pipeline.py``) | 00:00.221 | 0.0 MB |
|
||||
| :ref:`sphx_glr_auto_examples_plot_pipeline.py` (``plot_pipeline.py``) | 00:00.136 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_backend.py` (``plot_backend.py``) | 00:00.016 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_load_and_predict.py` (``plot_load_and_predict.py``) | 00:00.009 | 0.0 MB |
|
||||
| :ref:`sphx_glr_auto_examples_plot_backend.py` (``plot_backend.py``) | 00:00.014 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_common_errors.py` (``plot_common_errors.py``) | 00:00.008 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_load_and_predict.py` (``plot_load_and_predict.py``) | 00:00.007 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_profiling.py` (``plot_profiling.py``) | 00:00.005 | 0.0 MB |
|
||||
+-------------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||
| :ref:`sphx_glr_auto_examples_plot_metadata.py` (``plot_metadata.py``) | 00:00.003 | 0.0 MB |
|
||||
|
|
|
|||
|
|
@ -85,15 +85,7 @@ ONNX format and run the first predictions.</p>
|
|||
</pre></div>
|
||||
</div>
|
||||
<p>>>></p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">runner</span><span class="o">/.</span><span class="n">local</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">python3</span><span class="mf">.10</span><span class="o">/</span><span class="n">site</span><span class="o">-</span><span class="n">packages</span><span class="o">/</span><span class="n">sklearn</span><span class="o">/</span><span class="n">linear_model</span><span class="o">/</span><span class="n">_logistic</span><span class="o">.</span><span class="n">py</span><span class="p">:</span><span class="mi">444</span><span class="p">:</span> <span class="n">ConvergenceWarning</span><span class="p">:</span> <span class="n">lbfgs</span> <span class="n">failed</span> <span class="n">to</span> <span class="n">converge</span> <span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
|
||||
<span class="n">STOP</span><span class="p">:</span> <span class="n">TOTAL</span> <span class="n">NO</span><span class="o">.</span> <span class="n">of</span> <span class="n">ITERATIONS</span> <span class="n">REACHED</span> <span class="n">LIMIT</span><span class="o">.</span>
|
||||
|
||||
<span class="n">Increase</span> <span class="n">the</span> <span class="n">number</span> <span class="n">of</span> <span class="n">iterations</span> <span class="p">(</span><span class="n">max_iter</span><span class="p">)</span> <span class="ow">or</span> <span class="n">scale</span> <span class="n">the</span> <span class="n">data</span> <span class="k">as</span> <span class="n">shown</span> <span class="ow">in</span><span class="p">:</span>
|
||||
<span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">scikit</span><span class="o">-</span><span class="n">learn</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">stable</span><span class="o">/</span><span class="n">modules</span><span class="o">/</span><span class="n">preprocessing</span><span class="o">.</span><span class="n">html</span>
|
||||
<span class="n">Please</span> <span class="n">also</span> <span class="n">refer</span> <span class="n">to</span> <span class="n">the</span> <span class="n">documentation</span> <span class="k">for</span> <span class="n">alternative</span> <span class="n">solver</span> <span class="n">options</span><span class="p">:</span>
|
||||
<span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">scikit</span><span class="o">-</span><span class="n">learn</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">stable</span><span class="o">/</span><span class="n">modules</span><span class="o">/</span><span class="n">linear_model</span><span class="o">.</span><span class="n">html</span><span class="c1">#logistic-regression</span>
|
||||
<span class="n">n_iter_i</span> <span class="o">=</span> <span class="n">_check_optimize_result</span><span class="p">(</span>
|
||||
<span class="n">LogisticRegression</span><span class="p">()</span>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="n">LogisticRegression</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -136,8 +128,8 @@ for this machine learning model.</p>
|
|||
</pre></div>
|
||||
</div>
|
||||
<p>>>></p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="mi">0</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span>
|
||||
<span class="mi">2</span><span class="p">]</span>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="mi">0</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span>
|
||||
<span class="mi">1</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The code can be changed to get one specific output
|
||||
|
|
@ -156,8 +148,8 @@ by specifying its name into a list.</p>
|
|||
</pre></div>
|
||||
</div>
|
||||
<p>>>></p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="mi">0</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span>
|
||||
<span class="mi">2</span><span class="p">]</span>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="mi">0</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">2</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span>
|
||||
<span class="mi">1</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Reference in a new issue