Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
goodwanghan authored Jan 28, 2022
1 parent e601a9a commit e547562
Show file tree
Hide file tree
Showing 8 changed files with 674 additions and 25,748 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ catboost_info
/dist
.vscode/settings.json
/logs.log
examples/logs.log
.log
pycaret/__pycache__/
pycaret/tests/__pycache__/
tutorials/logs.log
Expand Down
175 changes: 0 additions & 175 deletions .log

This file was deleted.

1,869 changes: 662 additions & 1,207 deletions examples/PyCaret 2 Fugue Integration.ipynb

Large diffs are not rendered by default.

24,356 changes: 0 additions & 24,356 deletions examples/logs.log

This file was deleted.

16 changes: 8 additions & 8 deletions pycaret/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np

import pycaret.internal.tabular
from pycaret.parallel_backends import NoDisplay, ParallelBackend
from pycaret.parallel import NoDisplay, ParallelBackend
from pycaret.internal.Display import Display, is_in_colab, enable_colab
from typing import List, Tuple, Any, Union, Optional, Dict, Callable
import warnings
Expand Down Expand Up @@ -682,7 +682,7 @@ def compare_models(
probability_threshold: Optional[float] = None,
verbose: bool = True,
display: Optional[Display] = None,
parallel_backend: Optional[ParallelBackend] = None,
parallel: Optional[ParallelBackend] = None,
) -> Union[Any, List[Any]]:

"""
Expand Down Expand Up @@ -777,11 +777,11 @@ def compare_models(
display: Display, default = None
Custom display object
parallel_backend: Any, default = None
parallel: Any, default = None
A ParallelBackend instance. For example if you have a SparkSession ``session``,
you can use ``FugueBackend(session)`` to make this function running using
Spark. For more details, see
:class:`~pycaret.parallel_backends.fugue_backend.FugueBackend`
:class:`~pycaret.parallel.fugue_backend.FugueBackend`
Returns:
Trained model or list of trained models, depending on the ``n_select`` param.
Expand All @@ -796,13 +796,13 @@ def compare_models(
- No models are logged in ``MLFlow`` when ``cross_validation`` parameter is False.
"""
params = dict(locals())
if parallel_backend is not None:
if parallel is not None:
global _pycaret_setup_call
parallel_backend.attach(_pycaret_setup_call["func"], _pycaret_setup_call["params"])
parallel.attach(_pycaret_setup_call["func"], _pycaret_setup_call["params"])
if params.get("include", None) is None:
params["include"] = models().index.tolist()
del params["parallel_backend"]
return parallel_backend.compare_models(compare_models, params)
del params["parallel"]
return parallel.compare_models(compare_models, params)

return pycaret.internal.tabular.compare_models(
include=include,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ class FugueBackend(ParallelBackend):
>>> from pycaret.datasets import get_data
>>> from pyspark.sql import SparkSession
>>> from pycaret.parallel_backends import FugueBackend
>>> from pycaret.parallel import FugueBackend
>>> juice = get_data('juice')
>>> from pycaret.classification import *
>>> exp_name = setup(data = juice, target = 'Purchase')
>>> session = SparkSessiong.builder.getOrCreate()
>>> best_model = compare_models(parallel_backend=FugueBackend(session))
>>> best_model = compare_models(parallel=FugueBackend(session))
engine: Any
Expand Down
File renamed without changes.

0 comments on commit e547562

Please sign in to comment.