Skip to content

Commit

Permalink
Sphinx Docstring Update for Vertica Models - Include Graphviz (#765)
Browse files Browse the repository at this point in the history
* Sphinx Docstring Update for Vertica Models - Include Graphviz

Also fixed formatting for important directive.

* updated
  • Loading branch information
mail4umar authored Oct 24, 2023
1 parent 78ee34e commit 7b643e1
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 41 deletions.
42 changes: 31 additions & 11 deletions verticapy/machine_learning/vertica/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,16 @@ class RandomForestRegressor(Regressor, RandomForest):
of the huge size of the tree. But it should render nicely
in jupyter environment.
In order to plot graph using `graphviz <https://graphviz.org/>`_
separately, you can extract the graphviz DOT file code as follows:
.. ipython:: python
model.to_graphviz()
This string can then be copied into a DOT file which can be
parsed by graphviz.
**Contour plot** is another useful plot that can be produced
for models with two predictors.
Expand All @@ -706,11 +716,11 @@ class RandomForestRegressor(Regressor, RandomForest):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Model Register
^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1900,6 +1910,16 @@ class RandomForestClassifier(MulticlassClassifier, RandomForest):
of the huge size of the tree. But it should render nicely
in jupyter environment.
In order to plot graph using `graphviz <https://graphviz.org/>`_
separately, you can extract the graphviz DOT file code as follows:
.. ipython:: python
model.to_graphviz()
This string can then be copied into a DOT file which can be
parsed by graphviz.
**Contour plot** is another useful plot that can be produced
for models with two predictors.
Expand All @@ -1909,11 +1929,11 @@ class RandomForestClassifier(MulticlassClassifier, RandomForest):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Parameter Modification
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -2688,7 +2708,7 @@ class XGBClassifier(MulticlassClassifier, XGBoost):
method is used to retrieve predictions,
probabilities, or cluster distances. For specific details on how to
use this method for different model types, refer to the relevant
documentation for each model.
documentation for each model.
"""

# Properties.
Expand Down
20 changes: 10 additions & 10 deletions verticapy/machine_learning/vertica/svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,11 @@ class LinearSVR(Regressor, LinearModel):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Parameter Modification
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -994,11 +994,11 @@ class LinearSVC(BinaryClassifier, LinearModelClassifier):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Parameter Modification
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
80 changes: 60 additions & 20 deletions verticapy/machine_learning/vertica/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@ class DecisionTreeRegressor(RandomForestRegressor):
of the huge size of the tree. But it should render nicely
in jupyter environment.
In order to plot graph using `graphviz <https://graphviz.org/>`_
separately, you can extract the graphviz DOT file code as follows:
.. ipython:: python
model.to_graphviz()
This string can then be copied into a DOT file which can be
parsed by graphviz.
**Contour plot** is another useful plot that can be produced
for models with two predictors.
Expand All @@ -368,11 +378,11 @@ class DecisionTreeRegressor(RandomForestRegressor):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Model Register
^^^^^^^^^^^^^^
Expand Down Expand Up @@ -753,6 +763,16 @@ class DummyTreeRegressor(RandomForestRegressor):
of the huge size of the tree. But it should render nicely
in jupyter environment.
In order to plot graph using `graphviz <https://graphviz.org/>`_
separately, you can extract the graphviz DOT file code as follows:
.. ipython:: python
model.to_graphviz()
This string can then be copied into a DOT file which can be
parsed by graphviz.
**Contour plot** is another useful plot that can be produced
for models with two predictors.
Expand All @@ -762,11 +782,11 @@ class DummyTreeRegressor(RandomForestRegressor):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Model Register
^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1312,6 +1332,16 @@ class DecisionTreeClassifier(RandomForestClassifier):
of the huge size of the tree. But it should render nicely
in jupyter environment.
In order to plot graph using `graphviz <https://graphviz.org/>`_
separately, you can extract the graphviz DOT file code as follows:
.. ipython:: python
model.to_graphviz()
This string can then be copied into a DOT file which can be
parsed by graphviz.
**Contour plot** is another useful plot that can be produced
for models with two predictors.
Expand All @@ -1321,11 +1351,11 @@ class DecisionTreeClassifier(RandomForestClassifier):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Parameter Modification
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1858,6 +1888,16 @@ class DummyTreeClassifier(RandomForestClassifier):
of the huge size of the tree. But it should render nicely
in jupyter environment.
In order to plot graph using `graphviz <https://graphviz.org/>`_
separately, you can extract the graphviz DOT file code as follows:
.. ipython:: python
model.to_graphviz()
This string can then be copied into a DOT file which can be
parsed by graphviz.
**Contour plot** is another useful plot that can be produced
for models with two predictors.
Expand All @@ -1867,11 +1907,11 @@ class DummyTreeClassifier(RandomForestClassifier):
.. important::
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Machine learning models with two predictors can usually
benefit from their own contour plot. This visual representation
aids in exploring predictions and gaining a deeper understanding
of how these models perform in different scenarios.
Please refer to :ref:`chart_gallery.contour` for more examples.
Model Register
^^^^^^^^^^^^^^
Expand Down

0 comments on commit 7b643e1

Please sign in to comment.