Skip to content

Commit

Permalink
added missing metrics docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mail4umar committed Oct 31, 2023
1 parent 60284f6 commit 4da8c99
Showing 1 changed file with 118 additions and 1 deletion.
119 changes: 118 additions & 1 deletion verticapy/machine_learning/metrics/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,46 @@ def quantile_error(
float
score.
Examples
---------
We should first import verticapy.
.. ipython:: python
:suppress:
import verticapy as vp
Then we can create a small dataset that has
- true value
- predicted value
.. ipython:: python
data = vp.vDataFrame({"y_true": [1, 1.5, 3, 2, 5],
"y_pred": [1.1, 1.55, 2.9, 2.01, 4.5]}
)
Next, we can import the metric:
.. ipython:: python
from verticapy.machine_learning.metrics import quantile_error
Now we can conveniently calcualte the score:
.. ipython:: python
quantile_error(y_true = "y_true",
y_score = "y_pred",
input_relation = data,
q = 0.25,
)
.. seealso::
:py:mod:`verticapy.machine_learning.metrics.max_error`
:py:mod:`verticapy.machine_learning.metrics.classification_report`
"""
return regression_report(y_true, y_score, input_relation, metrics=f"qe{100 * q}%")

Expand Down Expand Up @@ -668,6 +705,46 @@ def anova_table(
-------
TableSample
ANOVA table.
Examples
---------
We should first import verticapy.
.. ipython:: python
:suppress:
import verticapy as vp
Then we can create a small dataset that has
- true value
- predicted value
.. ipython:: python
data = vp.vDataFrame({"y_true": [1, 1.5, 3, 2, 5],
"y_pred": [1.1, 1.55, 2.9, 2.01, 4.5]}
)
Next, we can import the metric:
.. ipython:: python
from verticapy.machine_learning.metrics import anova_table
Now we can conveniently calcualte the score:
.. ipython:: python
anova_table(y_true = "y_true",
y_score = "y_pred",
input_relation = data,
)
.. seealso::
:py:mod:`verticapy.machine_learning.metrics.classification_report`
"""
n, avg = _executeSQL(
query=f"""
Expand Down Expand Up @@ -783,6 +860,46 @@ def regression_report(
-------
TableSample
report.
Examples
---------
We should first import verticapy.
.. ipython:: python
:suppress:
import verticapy as vp
Then we can create a small dataset that has
- true value
- predicted value
.. ipython:: python
data = vp.vDataFrame({"y_true": [1, 1.5, 3, 2, 5],
"y_pred": [1.1, 1.55, 2.9, 2.01, 4.5]}
)
Next, we can import the metric:
.. ipython:: python
from verticapy.machine_learning.metrics import regression_report
Now we can conveniently calcualte the score:
.. ipython:: python
regression_report(y_true = "y_true",
y_score = "y_pred",
input_relation = data,
)
.. seealso::
:py:mod:`verticapy.machine_learning.metrics.classification_report`
"""
return_scalar = False
if isinstance(metrics, str):
Expand Down

0 comments on commit 4da8c99

Please sign in to comment.