Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
teanijarv committed Mar 3, 2024
1 parent cc9536c commit 9983635
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 14 deletions.
102 changes: 102 additions & 0 deletions docs/images/hlr_summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>Model Level</th>
<th>Predictors</th>
<th>N (observations)</th>
<th>DF (residuals)</th>
<th>DF (model)</th>
<th>R-squared</th>
<th>F-value</th>
<th>P-value (F)</th>
<th>SSR</th>
<th>SSTO</th>
<th>MSE (model)</th>
<th>MSE (residuals)</th>
<th>MSE (total)</th>
<th>Beta coefs</th>
<th>P-values (beta coefs)</th>
<th>Std Beta coefs</th>
<th>Partial correlations</th>
<th>Semi-partial correlations</th>
<th>Unique variance %</th>
<th>R-squared change</th>
<th>F-value change</th>
<th>P-value (F-value change)</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>[bill_length_mm]</td>
<td>333.0</td>
<td>331.0</td>
<td>1.0</td>
<td>0.35</td>
<td>176.24</td>
<td>0.0</td>
<td>140467132.89</td>
<td>215259665.92</td>
<td>74792533.03</td>
<td>424372.00</td>
<td>648372.49</td>
<td>{'const': 388.85, 'bill_length_mm': 86.79}</td>
<td>{'const': 0.18, 'bill_length_mm': 0.0}</td>
<td>{'bill_length_mm': 0.59}</td>
<td>{'bill_length_mm': 0.59}</td>
<td>{'bill_length_mm': 0.59}</td>
<td>{'bill_length_mm': 34.75}</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<td>2</td>
<td>[bill_length_mm, bill_depth_mm]</td>
<td>333.0</td>
<td>330.0</td>
<td>2.0</td>
<td>0.47</td>
<td>144.84</td>
<td>0.0</td>
<td>114633408.59</td>
<td>215259665.92</td>
<td>50313128.67</td>
<td>347373.97</td>
<td>648372.49</td>
<td>{'const': 3413.45, 'bill_length_mm': 74.81, 'bill_depth_mm': -145.51}</td>
<td>{'const': 0.0, 'bill_length_mm': 0.0, 'bill_depth_mm': 0.0}</td>
<td>{'bill_length_mm': 0.51, 'bill_depth_mm': -0.36}</td>
<td>{'bill_length_mm': 0.56, 'bill_depth_mm': -0.43}</td>
<td>{'bill_length_mm': 0.49, 'bill_depth_mm': -0.35}</td>
<td>{'bill_length_mm': 24.47, 'bill_depth_mm': 12.0}</td>
<td>0.12</td>
<td>74.37</td>
<td>0.0</td>
</tr>
<tr>
<td>3</td>
<td>[bill_length_mm, bill_depth_mm, flipper_length_mm]</td>
<td>333.0</td>
<td>329.0</td>
<td>3.0</td>
<td>0.76</td>
<td>354.90</td>
<td>0.0</td>
<td>50814911.80</td>
<td>215259665.92</td>
<td>54814918.04</td>
<td>154452.62</td>
<td>648372.49</td>
<td>{'const': -6445.48, 'bill_length_mm': 3.29, 'bill_depth_mm': 17.84, 'flipper_length_mm': 50.76}</td>
<td>{'const': 0.0, 'bill_length_mm': 0.54, 'bill_depth_mm': 0.2, 'flipper_length_mm': 0.0}</td>
<td>{'bill_length_mm': 0.02, 'bill_depth_mm': 0.04, 'flipper_length_mm': 0.88}</td>
<td>{'bill_length_mm': 0.03, 'bill_depth_mm': 0.07, 'flipper_length_mm': 0.75}</td>
<td>{'bill_length_mm': 0.02, 'bill_depth_mm': 0.03, 'flipper_length_mm': 0.54}</td>
<td>{'bill_length_mm': 0.03, 'bill_depth_mm': 0.12, 'flipper_length_mm': 29.65}</td>
<td>0.30</td>
<td>413.19</td>
<td>0.0</td>
</tr>
</tbody>
</table>
46 changes: 32 additions & 14 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,8 @@ Initialize HLR & generate summary report
Output:

+--------------+-------------------------------------------------------+-------------------+----------------+------------+------------+-----------+----------------+-----------------+-----------------+-------------+-----------------+---------------------------+---------------------+--------------------------------+----------------------------------+----------------------------------+------------------+----------------+--------------------------+
| Model Level | Predictors | N (observations) | DF (residuals) | DF (model) | R-squared | F-value | P-value (F) | SSR | SSTO | MSE (model) | MSE (residuals) | MSE (total) | Beta coefs | P-values (beta coefs) | Std Beta coefs | Partial correlations | Semi-partial correlations | Unique variance % | R-squared change | F-value change | P-value (F-value change) |
+==============+=======================================================+===================+================+============+============+===========+================+=================+=================+=============+=================+===========================+=====================+================================+==================================+==================================+==================+==================+==========================+
| 1 | [bill_length_mm] | 333.0 | 331.0 | 1.0 | 0.347453 | 176.242854| 1.538614e-32 | 1.404671e+08 | 2.152597e+08 | ... | 648372.487699 | {'const': 388.84515876027484, 'bill_length_mm': ...} | {'const': 0.1806158931602473, 'bill_length_mm': ...} | {'bill_length_mm': 0.5894511101769488} | {'bill_length_mm': 0.589451110176949} | {'bill_length_mm': 0.589451110176949} | {'bill_length_mm': 34.74526112888376} | NaN | NaN | NaN |
+--------------+-------------------------------------------------------+-------------------+----------------+------------+------------+-----------+----------------+-----------------+-----------------+-------------+-----------------+---------------------------+---------------------+--------------------------------+----------------------------------+----------------------------------+----------------------------------+------------------+------------------+--------------------------+
| 2 | [bill_length_mm, bill_depth_mm] | 333.0 | 330.0 | 2.0 | 0.467465 | 144.838513| 7.038981e-46 | 1.146334e+08 | 2.152597e+08 | ... | 648372.487699 | {'const': 3413.451851285957, 'bill_length_mm': ...} | {'const': 8.498889663375682e-14, 'bill_length_mm': ...} | {'bill_length_mm': 0.5080941489911919, 'bill_depth_mm': ...} | {'bill_length_mm': 0.5610736136532921, 'bill_depth_mm': ...} | {'bill_length_mm': 0.4946369788440619, 'bill_depth_mm': ...} | {'bill_length_mm': 24.46657408399809, 'bill_depth_mm': ...} | 0.120012 | 74.368625 | 2.760228e-16 |
+--------------+-------------------------------------------------------+-------------------+----------------+------------+------------+-----------+----------------+-----------------+-----------------+-------------+-----------------+---------------------------+---------------------+--------------------------------+----------------------------------+----------------------------------+----------------------------------+------------------+------------------+--------------------------+
| 3 | [bill_length_mm, bill_depth_mm, flipper_length_mm] | 333.0 | 329.0 | 3.0 | 0.763937 | 354.897950| 9.260836e-103 | 5.081491e+07 | 2.152597e+08 | ... | 648372.487699 | {'const': -6445.4760430301985, 'bill_length_mm': ...} | {'const': 1.5260941153089323e-25, 'bill_length_mm': ...} | {'bill_length_mm': 0.022363660870482777, 'bill_depth_mm': ..., 'flipper_length_mm': ...} | {'bill_length_mm': 0.03381286549878069, 'bill_depth_mm': ..., 'flipper_length_mm': ...} | {'bill_length_mm': 0.01643783598133535, 'bill_depth_mm': ..., 'flipper_length_mm': ...} | {'bill_length_mm': 0.027020245174928313, 'bill_depth_mm': ..., 'flipper_length_mm': ...} | 0.296472 | 413.191418 | 4.446424e-60 |
+--------------+-------------------------------------------------------+-------------------+----------------+------------+------------+-----------+----------------+-----------------+-----------------+-------------+-----------------+---------------------------+---------------------+--------------------------------+----------------------------------+----------------------------------+----------------------------------+------------------+------------------+--------------------------+
.. raw:: html
:file: images/hlr_summary.html

Run diagnostics for testing assumptions
---------------------------------------
Expand Down Expand Up @@ -110,11 +103,6 @@ Plotting options for all model levels
.. code-block:: python
hlr.plot_studentized_residuals_vs_fitted()
hlr.plot_qq_residuals()
hlr.plot_influence()
hlr.plot_std_residuals()
hlr.plot_histogram_std_residuals()
hlr.plot_partial_regression()
Output:

Expand All @@ -123,26 +111,56 @@ Output:
:align: center
:width: 50%

.. code-block:: python
hlr.plot_qq_residuals()
Output:

.. image:: /images/plot_qq_residuals.png
:alt: plot_qq_residuals
:align: center
:width: 50%

.. code-block:: python
hlr.plot_influence()
Output:

.. image:: /images/plot_influence.png
:alt: plot_influence
:align: center
:width: 50%

.. code-block:: python
hlr.plot_std_residuals()
Output:

.. image:: /images/plot_std_residuals.png
:alt: plot_std_residuals
:align: center
:width: 50%

.. code-block:: python
hlr.plot_histogram_std_residuals()
Output:

.. image:: /images/plot_histogram_std_residuals.png
:alt: plot_histogram_std_residuals
:align: center
:width: 50%

.. code-block:: python
hlr.plot_partial_regression()
Output:

.. image:: /images/plot_partial_regression.png
:alt: plot_partial_regression
:align: center
Expand Down

0 comments on commit 9983635

Please sign in to comment.