FLAML 2.3.3__tar.gz → 2.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flaml-2.3.3 → flaml-2.3.4}/FLAML.egg-info/PKG-INFO +1 -1
- {flaml-2.3.3 → flaml-2.3.4}/FLAML.egg-info/SOURCES.txt +0 -1
- {flaml-2.3.3 → flaml-2.3.4}/PKG-INFO +1 -1
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/model.py +14 -9
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/task/generic_task.py +3 -3
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/tune.py +9 -2
- flaml-2.3.4/flaml/version.py +1 -0
- {flaml-2.3.3 → flaml-2.3.4}/test/test_gpu.py +11 -0
- flaml-2.3.3/flaml/version.py +0 -1
- flaml-2.3.3/test/test_model.py +0 -146
- {flaml-2.3.3 → flaml-2.3.4}/FLAML.egg-info/dependency_links.txt +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/FLAML.egg-info/requires.txt +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/FLAML.egg-info/top_level.txt +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/LICENSE +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/NOTICE.md +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/README.md +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/agentchat/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/agentchat/agent.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/agentchat/assistant_agent.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/agentchat/conversable_agent.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/agentchat/groupchat.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/agentchat/user_proxy_agent.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/code_utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/extensions/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/math_utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/oai/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/oai/completion.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/oai/openai_utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/autogen/retrieve_utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/automl.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/contrib/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/contrib/histgb.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/data.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/logger.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/ml.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/huggingface/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/huggingface/data_collator.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/huggingface/trainer.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/huggingface/training_args.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/huggingface/utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/nlp/utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/spark/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/spark/metrics.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/spark/utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/state.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/task/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/task/factory.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/task/task.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/task/time_series_task.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/feature.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/sklearn.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/tcn.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/tft.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/ts_data.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/time_series/ts_model.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/automl/training_log.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/config.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/all/binary.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/all/multiclass.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/all/regression.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/estimator.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/extra_tree/binary.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/extra_tree/multiclass.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/extra_tree/regression.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/greedy.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/lgbm/binary.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/lgbm/multiclass.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/lgbm/regression.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/portfolio.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/regret.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/rf/binary.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/rf/multiclass.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/rf/regression.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/suggest.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/xgb_limitdepth/binary.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/xgb_limitdepth/multiclass.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/xgb_limitdepth/regression.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/xgboost/binary.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/xgboost/multiclass.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/default/xgboost/regression.json +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/fabric/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/fabric/mlflow.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/ml.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/onlineml/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/onlineml/autovw.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/onlineml/trial.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/onlineml/trial_runner.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/analysis.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/result.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/sample.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/scheduler/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/scheduler/online_scheduler.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/scheduler/trial_scheduler.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/blendsearch.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/cfo_cat.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/flow2.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/online_searcher.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/search_thread.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/suggestion.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/searcher/variant_generator.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/space.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/spark/__init__.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/spark/utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/trial.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/trial_runner.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/flaml/tune/utils.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/pyproject.toml +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/setup.cfg +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/setup.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/test/test_autovw.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/test/test_conda_distribution.py +0 -0
- {flaml-2.3.3 → flaml-2.3.4}/test/test_version.py +0 -0
|
@@ -9,6 +9,7 @@ import os
|
|
|
9
9
|
import shutil
|
|
10
10
|
import signal
|
|
11
11
|
import sys
|
|
12
|
+
import threading
|
|
12
13
|
import time
|
|
13
14
|
import warnings
|
|
14
15
|
from contextlib import contextmanager
|
|
@@ -89,21 +90,25 @@ def limit_resource(memory_limit, time_limit):
|
|
|
89
90
|
except ValueError:
|
|
90
91
|
# According to https://bugs.python.org/issue40518, it's a mac-specific error.
|
|
91
92
|
pass
|
|
92
|
-
|
|
93
|
-
if time_limit is not None:
|
|
93
|
+
alarm_set = False
|
|
94
|
+
if time_limit is not None and threading.current_thread() is threading.main_thread():
|
|
94
95
|
try:
|
|
95
96
|
signal.signal(signal.SIGALRM, TimeoutHandler)
|
|
96
97
|
signal.alarm(int(time_limit) or 1)
|
|
97
|
-
|
|
98
|
+
alarm_set = True
|
|
98
99
|
except ValueError:
|
|
99
100
|
pass
|
|
101
|
+
|
|
100
102
|
try:
|
|
101
103
|
yield
|
|
102
104
|
finally:
|
|
103
|
-
if
|
|
105
|
+
if alarm_set:
|
|
104
106
|
signal.alarm(0)
|
|
105
107
|
if memory_limit > 0:
|
|
106
|
-
|
|
108
|
+
try:
|
|
109
|
+
resource.setrlimit(resource.RLIMIT_AS, (soft, hard))
|
|
110
|
+
except ValueError:
|
|
111
|
+
pass
|
|
107
112
|
|
|
108
113
|
|
|
109
114
|
class BaseEstimator:
|
|
@@ -130,7 +135,7 @@ class BaseEstimator:
|
|
|
130
135
|
self._task = task if isinstance(task, Task) else task_factory(task, None, None)
|
|
131
136
|
self.params = self.config2params(config)
|
|
132
137
|
self.estimator_class = self._model = None
|
|
133
|
-
if "_estimator_type" in
|
|
138
|
+
if "_estimator_type" in self.params:
|
|
134
139
|
self._estimator_type = self.params.pop("_estimator_type")
|
|
135
140
|
else:
|
|
136
141
|
self._estimator_type = "classifier" if self._task.is_classification() else "regressor"
|
|
@@ -1691,7 +1696,7 @@ class XGBoostEstimator(SKLearnEstimator):
|
|
|
1691
1696
|
# use_label_encoder is deprecated in 1.7.
|
|
1692
1697
|
if xgboost_version < "1.7.0":
|
|
1693
1698
|
params["use_label_encoder"] = params.get("use_label_encoder", False)
|
|
1694
|
-
if "n_jobs" in
|
|
1699
|
+
if "n_jobs" in params:
|
|
1695
1700
|
params["nthread"] = params.pop("n_jobs")
|
|
1696
1701
|
return params
|
|
1697
1702
|
|
|
@@ -1891,7 +1896,7 @@ class RandomForestEstimator(SKLearnEstimator, LGBMEstimator):
|
|
|
1891
1896
|
params = super().config2params(config)
|
|
1892
1897
|
if "max_leaves" in params:
|
|
1893
1898
|
params["max_leaf_nodes"] = params.get("max_leaf_nodes", params.pop("max_leaves"))
|
|
1894
|
-
if not self._task.is_classification() and "criterion" in
|
|
1899
|
+
if not self._task.is_classification() and "criterion" in params:
|
|
1895
1900
|
params.pop("criterion")
|
|
1896
1901
|
if "random_state" not in params:
|
|
1897
1902
|
params["random_state"] = 12032022
|
|
@@ -2344,7 +2349,7 @@ class SGDEstimator(SKLearnEstimator):
|
|
|
2344
2349
|
params["loss"] = params.get("loss", None)
|
|
2345
2350
|
if params["loss"] is None and self._task.is_classification():
|
|
2346
2351
|
params["loss"] = "log_loss" if SKLEARN_VERSION >= "1.1" else "log"
|
|
2347
|
-
if not self._task.is_classification():
|
|
2352
|
+
if not self._task.is_classification() and "n_jobs" in params:
|
|
2348
2353
|
params.pop("n_jobs")
|
|
2349
2354
|
|
|
2350
2355
|
if params.get("penalty") != "elasticnet":
|
|
@@ -769,10 +769,10 @@ class GenericTask(Task):
|
|
|
769
769
|
if not is_spark_dataframe:
|
|
770
770
|
y_train, y_val = y_train_split[train_index], y_train_split[val_index]
|
|
771
771
|
if weight is not None:
|
|
772
|
-
fit_kwargs["sample_weight"]
|
|
773
|
-
weight[train_index],
|
|
774
|
-
weight[val_index],
|
|
772
|
+
fit_kwargs["sample_weight"] = (
|
|
773
|
+
weight[train_index] if isinstance(weight, np.ndarray) else weight.iloc[train_index]
|
|
775
774
|
)
|
|
775
|
+
weight_val = weight[val_index] if isinstance(weight, np.ndarray) else weight.iloc[val_index]
|
|
776
776
|
if groups is not None:
|
|
777
777
|
fit_kwargs["groups"] = (
|
|
778
778
|
groups[train_index] if isinstance(groups, np.ndarray) else groups.iloc[train_index]
|
|
@@ -197,9 +197,16 @@ def report(_metric=None, **kwargs):
|
|
|
197
197
|
global _training_iteration
|
|
198
198
|
if _use_ray:
|
|
199
199
|
try:
|
|
200
|
-
from ray import
|
|
200
|
+
from ray import __version__ as ray_version
|
|
201
|
+
|
|
202
|
+
if ray_version.startswith("1."):
|
|
203
|
+
from ray import tune
|
|
204
|
+
|
|
205
|
+
return tune.report(_metric, **kwargs)
|
|
206
|
+
else: # ray>=2
|
|
207
|
+
from ray.air import session
|
|
201
208
|
|
|
202
|
-
|
|
209
|
+
return session.report(metrics={"metric": _metric, **kwargs})
|
|
203
210
|
except ImportError:
|
|
204
211
|
# calling tune.report() outside tune.run()
|
|
205
212
|
return
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.3.4"
|
|
@@ -59,6 +59,17 @@ def _test_hf_data():
|
|
|
59
59
|
except requests.exceptions.ConnectionError:
|
|
60
60
|
return
|
|
61
61
|
|
|
62
|
+
# Tests will only run if there is a GPU available
|
|
63
|
+
try:
|
|
64
|
+
import ray
|
|
65
|
+
|
|
66
|
+
pg = ray.util.placement_group([{"CPU": 1, "GPU": 1}])
|
|
67
|
+
|
|
68
|
+
if not pg.wait(timeout_seconds=10): # Wait 10 seconds for resources
|
|
69
|
+
raise RuntimeError("No available node types can fulfill resource request!")
|
|
70
|
+
except RuntimeError:
|
|
71
|
+
return
|
|
72
|
+
|
|
62
73
|
custom_sent_keys = ["sentence1", "sentence2"]
|
|
63
74
|
label_key = "label"
|
|
64
75
|
|
flaml-2.3.3/flaml/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.3.3"
|
flaml-2.3.3/test/test_model.py
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from pandas import DataFrame
|
|
5
|
-
from sklearn.datasets import make_classification
|
|
6
|
-
|
|
7
|
-
from flaml.automl.contrib.histgb import HistGradientBoostingEstimator
|
|
8
|
-
from flaml.automl.model import (
|
|
9
|
-
BaseEstimator,
|
|
10
|
-
CatBoostEstimator,
|
|
11
|
-
KNeighborsEstimator,
|
|
12
|
-
LGBMEstimator,
|
|
13
|
-
LRL2Classifier,
|
|
14
|
-
RandomForestEstimator,
|
|
15
|
-
XGBoostEstimator,
|
|
16
|
-
)
|
|
17
|
-
from flaml.automl.time_series import ARIMA, LGBM_TS, Prophet, TimeSeriesDataset
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_lrl2():
|
|
21
|
-
BaseEstimator.search_space(1, "")
|
|
22
|
-
X, y = make_classification(100000, 1000)
|
|
23
|
-
print("start")
|
|
24
|
-
lr = LRL2Classifier()
|
|
25
|
-
lr.predict(X)
|
|
26
|
-
lr.fit(X, y, budget=1e-5)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def test_prep():
|
|
30
|
-
X = np.array(
|
|
31
|
-
list(
|
|
32
|
-
zip(
|
|
33
|
-
[
|
|
34
|
-
3.0,
|
|
35
|
-
16.0,
|
|
36
|
-
10.0,
|
|
37
|
-
12.0,
|
|
38
|
-
3.0,
|
|
39
|
-
14.0,
|
|
40
|
-
11.0,
|
|
41
|
-
12.0,
|
|
42
|
-
5.0,
|
|
43
|
-
14.0,
|
|
44
|
-
20.0,
|
|
45
|
-
16.0,
|
|
46
|
-
15.0,
|
|
47
|
-
11.0,
|
|
48
|
-
],
|
|
49
|
-
[
|
|
50
|
-
"a",
|
|
51
|
-
"b",
|
|
52
|
-
"a",
|
|
53
|
-
"c",
|
|
54
|
-
"c",
|
|
55
|
-
"b",
|
|
56
|
-
"b",
|
|
57
|
-
"b",
|
|
58
|
-
"b",
|
|
59
|
-
"a",
|
|
60
|
-
"b",
|
|
61
|
-
1.0,
|
|
62
|
-
1.0,
|
|
63
|
-
"a",
|
|
64
|
-
],
|
|
65
|
-
)
|
|
66
|
-
),
|
|
67
|
-
dtype=object,
|
|
68
|
-
)
|
|
69
|
-
y = np.array([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1])
|
|
70
|
-
lr = LRL2Classifier()
|
|
71
|
-
lr.fit(X, y)
|
|
72
|
-
lr.predict(X)
|
|
73
|
-
print(lr.feature_names_in_)
|
|
74
|
-
print(lr.feature_importances_)
|
|
75
|
-
lgbm = LGBMEstimator(n_estimators=4)
|
|
76
|
-
lgbm.fit(X, y)
|
|
77
|
-
print(lgbm.feature_names_in_)
|
|
78
|
-
print(lgbm.feature_importances_)
|
|
79
|
-
cat = CatBoostEstimator(n_estimators=4)
|
|
80
|
-
cat.fit(X, y)
|
|
81
|
-
print(cat.feature_names_in_)
|
|
82
|
-
print(cat.feature_importances_)
|
|
83
|
-
knn = KNeighborsEstimator(task="regression")
|
|
84
|
-
knn.fit(X, y)
|
|
85
|
-
print(knn.feature_names_in_)
|
|
86
|
-
print(knn.feature_importances_)
|
|
87
|
-
xgb = XGBoostEstimator(n_estimators=4, max_leaves=4)
|
|
88
|
-
xgb.fit(X, y)
|
|
89
|
-
xgb.predict(X)
|
|
90
|
-
print(xgb.feature_names_in_)
|
|
91
|
-
print(xgb.feature_importances_)
|
|
92
|
-
rf = RandomForestEstimator(task="regression", n_estimators=4, criterion="gini")
|
|
93
|
-
rf.fit(X, y)
|
|
94
|
-
print(rf.feature_names_in_)
|
|
95
|
-
print(rf.feature_importances_)
|
|
96
|
-
hgb = HistGradientBoostingEstimator(task="regression", n_estimators=4, max_leaves=4)
|
|
97
|
-
hgb.fit(X, y)
|
|
98
|
-
hgb.predict(X)
|
|
99
|
-
print(hgb.feature_names_in_)
|
|
100
|
-
print(hgb.feature_importances_)
|
|
101
|
-
|
|
102
|
-
prophet = Prophet()
|
|
103
|
-
try:
|
|
104
|
-
prophet.predict(4)
|
|
105
|
-
except ValueError:
|
|
106
|
-
# predict() with steps is only supported for arima/sarimax.
|
|
107
|
-
pass
|
|
108
|
-
prophet.predict(X)
|
|
109
|
-
|
|
110
|
-
# What's the point of callin ARIMA without parameters, or calling predict before fit?
|
|
111
|
-
arima = ARIMA(p=1, q=1, d=0)
|
|
112
|
-
arima.predict(X)
|
|
113
|
-
arima._model = False
|
|
114
|
-
try:
|
|
115
|
-
arima.predict(X)
|
|
116
|
-
except ValueError:
|
|
117
|
-
# X_test needs to be either a pandas Dataframe with dates as the first column or an int number of periods for predict().
|
|
118
|
-
pass
|
|
119
|
-
lgbm = LGBM_TS(lags=1)
|
|
120
|
-
X = DataFrame(
|
|
121
|
-
{
|
|
122
|
-
"A": [
|
|
123
|
-
datetime(1900, 3, 1),
|
|
124
|
-
datetime(1900, 3, 2),
|
|
125
|
-
datetime(1900, 3, 3),
|
|
126
|
-
datetime(1900, 3, 4),
|
|
127
|
-
datetime(1900, 3, 4),
|
|
128
|
-
datetime(1900, 3, 4),
|
|
129
|
-
datetime(1900, 3, 5),
|
|
130
|
-
datetime(1900, 3, 6),
|
|
131
|
-
],
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
y = np.array([0, 1, 0, 1, 1, 1, 0, 0])
|
|
135
|
-
lgbm.predict(X[:2])
|
|
136
|
-
df = X.copy()
|
|
137
|
-
df["y"] = y
|
|
138
|
-
tsds = TimeSeriesDataset(df, time_col="A", target_names="y")
|
|
139
|
-
lgbm.fit(tsds, period=2)
|
|
140
|
-
lgbm.predict(X[:2])
|
|
141
|
-
print(lgbm.feature_names_in_)
|
|
142
|
-
print(lgbm.feature_importances_)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if __name__ == "__main__":
|
|
146
|
-
test_prep()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|