Skip to content

[BUG]: default value for restack in stack_models should be aligned #3870

@pascal456

Description

@pascal456

pycaret version checks

Issue Description

stack_models has a wrong ?! default value for restack here:

def stack_models(
estimator_list: list,
meta_model=None,
meta_model_fold: Optional[Union[int, Any]] = 5,
fold: Optional[Union[int, Any]] = None,
round: int = 4,
restack: bool = True,
choose_better: bool = False,
optimize: str = "R2",
fit_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
verbose: bool = True,
return_train_score: bool = False,
):

for the OOP implementation the default is set to False:

def stack_models(
self,
estimator_list: list,
meta_model=None,
meta_model_fold: Optional[Union[int, Any]] = 5,
fold: Optional[Union[int, Any]] = None,
round: int = 4,
restack: bool = False,
choose_better: bool = False,
optimize: str = "R2",
fit_kwargs: Optional[dict] = None,
groups: Optional[Union[str, Any]] = None,
verbose: bool = True,
return_train_score: bool = False,
):

The documentation also describes False as the default:

restack: bool, default = False
When set to False, only the predictions of estimators will be used as
training data for the ``meta_model``.

and
restack: bool, default = False
When set to False, only the predictions of estimators will be used as
training data for the ``meta_model``.

Reproducible Example

NA

Expected Behavior

  • default value should be False

Actual Results

NA

Installed Versions

Python 3.11.7 (main, Dec 5 2023, 18:55:16) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pycaret import show_versions; show_versions()

System:
python: 3.11.7 (main, Dec 5 2023, 18:55:16) [GCC 12.2.0]
executable: /usr/local/bin/python
machine: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.36

PyCaret required dependencies:
pip: 23.2.1
setuptools: 69.0.2
pycaret: 3.2.1
IPython: 8.19.0
ipywidgets: 8.1.1
tqdm: 4.66.1
numpy: 1.25.2
pandas: 2.0.3
jinja2: 3.1.2
scipy: 1.10.1
joblib: 1.3.2
sklearn: 1.2.2
pyod: 1.1.2
imblearn: 0.11.0
category_encoders: 2.6.3
lightgbm: 4.2.0
numba: 0.58.1
requests: 2.31.0
matplotlib: 3.6.1
scikitplot: 0.3.7
yellowbrick: 1.5
plotly: 5.18.0
plotly-resampler: Not installed
kaleido: 0.2.1
schemdraw: 0.15
statsmodels: 0.14.1
sktime: 0.21.1
tbats: 1.1.3
pmdarima: 2.0.4
psutil: 5.9.7
markupsafe: 2.1.3
pickle5: Not installed
cloudpickle: 3.0.0
deprecation: 2.1.0
xxhash: 3.4.1
wurlitzer: 3.0.3

PyCaret optional dependencies:
shap: Not installed
interpret: Not installed
umap: Not installed
ydata_profiling: Not installed
explainerdashboard: Not installed
autoviz: Not installed
fairlearn: Not installed
deepchecks: Not installed
xgboost: 2.0.3
catboost: 1.2.2
kmodes: 0.12.2
mlxtend: 0.23.0
statsforecast: 1.5.0
tune_sklearn: Not installed
ray: Not installed
hyperopt: Not installed
optuna: Not installed
skopt: Not installed
mlflow: 2.9.2
gradio: 3.50.2
fastapi: 0.108.0
uvicorn: 0.25.0
m2cgen: 0.10.0
evidently: 0.2.8
fugue: 0.8.7
streamlit: Not installed
prophet: Not installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions