Skip to content

Commit

Permalink
Merge pull request pycaret#3595 from pycaret/remove_use_train_data_fr…
Browse files Browse the repository at this point in the history
…om_plot_model

Remove `use_train_data` from `plot_model`
  • Loading branch information
Yard1 authored Jun 25, 2023
2 parents 7bfcebc + ff44d7b commit 468dfde
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 83 deletions.
2 changes: 0 additions & 2 deletions pycaret/anomaly/oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def plot_model(
groups: Optional[Union[str, Any]] = None,
feature_name: Optional[str] = None,
label: bool = False,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -165,7 +164,6 @@ def plot_model(
groups,
feature_name,
label,
use_train_data,
verbose,
display_format,
)
14 changes: 0 additions & 14 deletions pycaret/classification/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,6 @@ def plot_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -1705,11 +1704,6 @@ def plot_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
verbose: bool, default = True
When set to False, progress bar is not displayed.
Expand Down Expand Up @@ -1746,7 +1740,6 @@ def plot_model(
plot_kwargs=plot_kwargs,
groups=groups,
verbose=verbose,
use_train_data=use_train_data,
display_format=display_format,
)

Expand All @@ -1758,7 +1751,6 @@ def evaluate_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
):
"""
This function displays a user interface for analyzing performance of a trained
Expand Down Expand Up @@ -1801,11 +1793,6 @@ def evaluate_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
Returns:
None
Expand All @@ -1822,7 +1809,6 @@ def evaluate_model(
fit_kwargs=fit_kwargs,
plot_kwargs=plot_kwargs,
groups=groups,
use_train_data=use_train_data,
)


Expand Down
14 changes: 0 additions & 14 deletions pycaret/classification/oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,6 @@ def plot_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -2053,11 +2052,6 @@ def plot_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
verbose: bool, default = True
When set to False, progress bar is not displayed.
Expand Down Expand Up @@ -2094,7 +2088,6 @@ def plot_model(
plot_kwargs=plot_kwargs,
groups=groups,
verbose=verbose,
use_train_data=use_train_data,
display_format=display_format,
)

Expand All @@ -2105,7 +2098,6 @@ def evaluate_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
):
"""
This function displays a user interface for analyzing performance of a trained
Expand Down Expand Up @@ -2148,11 +2140,6 @@ def evaluate_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
Returns:
None
Expand All @@ -2169,7 +2156,6 @@ def evaluate_model(
fit_kwargs=fit_kwargs,
plot_kwargs=plot_kwargs,
groups=groups,
use_train_data=use_train_data,
)

def interpret_model(
Expand Down
2 changes: 0 additions & 2 deletions pycaret/clustering/oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def plot_model(
groups: Optional[Union[str, Any]] = None,
feature_name: Optional[str] = None,
label: bool = False,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -183,7 +182,6 @@ def plot_model(
groups,
feature_name,
label,
use_train_data,
verbose,
display_format,
)
Expand Down
8 changes: 0 additions & 8 deletions pycaret/internal/pycaret_experiment/tabular_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ def _plot_model(
groups: Optional[Union[str, Any]] = None,
feature_name: Optional[str] = None,
label: bool = False,
use_train_data: bool = False,
verbose: bool = True,
system: bool = True,
display: Optional[CommonDisplay] = None, # added in pycaret==2.2.0
Expand Down Expand Up @@ -485,9 +484,6 @@ def is_tree(e):
if type(label) is not bool:
raise TypeError("Label parameter only accepts True or False.")

if type(use_train_data) is not bool:
raise TypeError("use_train_data parameter only accepts True or False.")

if feature_name is not None and type(feature_name) is not str:
raise TypeError(
"feature parameter must be string containing column name of dataset."
Expand Down Expand Up @@ -1948,7 +1944,6 @@ def plot_model(
groups: Optional[Union[str, Any]] = None,
feature_name: Optional[str] = None,
label: bool = False,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -2060,7 +2055,6 @@ def plot_model(
groups=groups,
feature_name=feature_name,
label=label,
use_train_data=use_train_data,
verbose=verbose,
display_format=display_format,
)
Expand All @@ -2073,7 +2067,6 @@ def evaluate_model(
plot_kwargs: Optional[dict] = None,
feature_name: Optional[str] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
):
"""
This function displays a user interface for all of the available plots for
Expand Down Expand Up @@ -2152,7 +2145,6 @@ def evaluate_model(
feature_name=fixed(feature_name),
label=fixed(False),
groups=fixed(groups),
use_train_data=fixed(use_train_data),
system=fixed(True),
display=fixed(None),
display_format=fixed(None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,6 @@ def evaluate_model(
plot_kwargs: Optional[dict] = None,
feature_name: Optional[str] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
):
"""
This function displays a user interface for analyzing performance of a trained
Expand Down Expand Up @@ -1390,5 +1389,4 @@ def evaluate_model(
plot_kwargs,
feature_name,
groups,
use_train_data,
)
14 changes: 0 additions & 14 deletions pycaret/regression/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,6 @@ def plot_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -1638,11 +1637,6 @@ def plot_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
verbose: bool, default = True
When set to False, progress bar is not displayed.
Expand All @@ -1667,7 +1661,6 @@ def plot_model(
plot_kwargs=plot_kwargs,
groups=groups,
verbose=verbose,
use_train_data=use_train_data,
display_format=display_format,
)

Expand All @@ -1679,7 +1672,6 @@ def evaluate_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
):
"""
This function displays a user interface for analyzing performance of a trained
Expand Down Expand Up @@ -1721,11 +1713,6 @@ def evaluate_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
Returns:
None
Expand All @@ -1742,7 +1729,6 @@ def evaluate_model(
fit_kwargs=fit_kwargs,
plot_kwargs=plot_kwargs,
groups=groups,
use_train_data=use_train_data,
)


Expand Down
14 changes: 0 additions & 14 deletions pycaret/regression/oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,6 @@ def plot_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
verbose: bool = True,
display_format: Optional[str] = None,
) -> Optional[str]:
Expand Down Expand Up @@ -1938,11 +1937,6 @@ def plot_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
verbose: bool, default = True
When set to False, progress bar is not displayed.
Expand All @@ -1967,7 +1961,6 @@ def plot_model(
plot_kwargs=plot_kwargs,
groups=groups,
verbose=verbose,
use_train_data=use_train_data,
display_format=display_format,
)

Expand All @@ -1978,7 +1971,6 @@ def evaluate_model(
fit_kwargs: Optional[dict] = None,
plot_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
use_train_data: bool = False,
):
"""
This function displays a user interface for analyzing performance of a trained
Expand Down Expand Up @@ -2020,11 +2012,6 @@ def evaluate_model(
the column name in the dataset containing group labels.
use_train_data: bool, default = False
When set to true, train data will be used for plots, instead
of test data.
Returns:
None
Expand All @@ -2041,7 +2028,6 @@ def evaluate_model(
fit_kwargs=fit_kwargs,
plot_kwargs=plot_kwargs,
groups=groups,
use_train_data=use_train_data,
)

def interpret_model(
Expand Down
3 changes: 1 addition & 2 deletions tests/test_classification_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def test_plot():
available_plots = exp._available_plots

for plot in available_plots:
pycaret.classification.plot_model(model, plot=plot, use_train_data=False)
pycaret.classification.plot_model(model, plot=plot, use_train_data=True)
pycaret.classification.plot_model(model, plot=plot)

models = [
pycaret.classification.create_model("et"),
Expand Down
3 changes: 1 addition & 2 deletions tests/test_regression_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def test_plot():
available_plots = exp._available_plots

for plot in available_plots:
pycaret.regression.plot_model(model, plot=plot, use_train_data=False)
pycaret.regression.plot_model(model, plot=plot, use_train_data=True)
pycaret.regression.plot_model(model, plot=plot)

models = [
pycaret.regression.create_model("et"),
Expand Down
1 change: 0 additions & 1 deletion tutorials/Tutorial - Binary Classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9133,7 +9133,6 @@
"- fit_kwargs\n",
"- plot_kwargs\n",
"- groups\n",
"- use_train_data\n",
"- display_format\n",
"\n",
"You can check the docstring of the function for more info."
Expand Down
8 changes: 1 addition & 7 deletions tutorials/Tutorial - Multiclass Classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@
"text": [
"Help on function plot_model in module pycaret.classification.functional:\n",
"\n",
"plot_model(estimator, plot: str = 'auc', scale: float = 1, save: bool = False, fold: Union[int, Any, NoneType] = None, fit_kwargs: Union[dict, NoneType] = None, plot_kwargs: Union[dict, NoneType] = None, groups: Union[str, Any, NoneType] = None, use_train_data: bool = False, verbose: bool = True, display_format: Union[str, NoneType] = None) -> Union[str, NoneType]\n",
"plot_model(estimator, plot: str = 'auc', scale: float = 1, save: bool = False, fold: Union[int, Any, NoneType] = None, fit_kwargs: Union[dict, NoneType] = None, plot_kwargs: Union[dict, NoneType] = None, groups: Union[str, Any, NoneType] = None, verbose: bool = True, display_format: Union[str, NoneType] = None) -> Union[str, NoneType]\n",
" This function analyzes the performance of a trained model on holdout set.\n",
" It may require re-training the model in certain cases.\n",
" \n",
Expand Down Expand Up @@ -1364,11 +1364,6 @@
" the column name in the dataset containing group labels.\n",
" \n",
" \n",
" use_train_data: bool, default = False\n",
" When set to true, train data will be used for plots, instead\n",
" of test data.\n",
" \n",
" \n",
" verbose: bool, default = True\n",
" When set to False, progress bar is not displayed.\n",
" \n",
Expand Down Expand Up @@ -7995,7 +7990,6 @@
"- fit_kwargs\n",
"- plot_kwargs\n",
"- groups\n",
"- use_train_data\n",
"- display_format\n",
"\n",
"You can check the docstring of the function for more info."
Expand Down
1 change: 0 additions & 1 deletion tutorials/Tutorial - Regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7862,7 +7862,6 @@
"- fit_kwargs\n",
"- plot_kwargs\n",
"- groups\n",
"- use_train_data\n",
"- display_format\n",
"\n",
"You can check the docstring of the function for more info."
Expand Down

0 comments on commit 468dfde

Please sign in to comment.