Merge pull request #11023 from freqtrade/dependabot/pip/develop/xgboost-2.1.3
chore(deps): bump xgboost from 2.0.3 to 2.1.3
This commit is contained in:
@@ -5,7 +5,6 @@ from xgboost import XGBRFRegressor
|
|||||||
|
|
||||||
from freqtrade.freqai.base_models.BaseRegressionModel import BaseRegressionModel
|
from freqtrade.freqai.base_models.BaseRegressionModel import BaseRegressionModel
|
||||||
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
||||||
from freqtrade.freqai.tensorboard import TBCallback
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -45,7 +44,12 @@ class XGBoostRFRegressor(BaseRegressionModel):
|
|||||||
|
|
||||||
model = XGBRFRegressor(**self.model_training_parameters)
|
model = XGBRFRegressor(**self.model_training_parameters)
|
||||||
|
|
||||||
model.set_params(callbacks=[TBCallback(dk.data_path)])
|
# Callbacks are not supported for XGBRFRegressor, and version 2.1.x started to throw
|
||||||
|
# the following error:
|
||||||
|
# NotImplementedError: `early_stopping_rounds` and `callbacks` are not implemented
|
||||||
|
# for random forest.
|
||||||
|
|
||||||
|
# model.set_params(callbacks=[TBCallback(dk.data_path)])
|
||||||
model.fit(
|
model.fit(
|
||||||
X=X,
|
X=X,
|
||||||
y=y,
|
y=y,
|
||||||
@@ -55,6 +59,6 @@ class XGBoostRFRegressor(BaseRegressionModel):
|
|||||||
xgb_model=xgb_model,
|
xgb_model=xgb_model,
|
||||||
)
|
)
|
||||||
# set the callbacks to empty so that we can serialize to disk later
|
# set the callbacks to empty so that we can serialize to disk later
|
||||||
model.set_params(callbacks=[])
|
# model.set_params(callbacks=[])
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ catboost==1.2.7; 'arm' not in platform_machine
|
|||||||
# Temporary downgrade of matplotlib due to https://github.com/matplotlib/matplotlib/issues/28551
|
# Temporary downgrade of matplotlib due to https://github.com/matplotlib/matplotlib/issues/28551
|
||||||
matplotlib==3.9.3
|
matplotlib==3.9.3
|
||||||
lightgbm==4.5.0
|
lightgbm==4.5.0
|
||||||
xgboost==2.0.3
|
xgboost==2.1.3
|
||||||
tensorboard==2.18.0
|
tensorboard==2.18.0
|
||||||
datasieve==0.1.7
|
datasieve==0.1.7
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# pragma pylint: disable=missing-docstring
|
# pragma pylint: disable=missing-docstring
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import platform
|
||||||
import re
|
import re
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
@@ -517,6 +518,30 @@ def patch_gc(mocker) -> None:
|
|||||||
mocker.patch("freqtrade.main.gc_set_threshold")
|
mocker.patch("freqtrade.main.gc_set_threshold")
|
||||||
|
|
||||||
|
|
||||||
|
def is_arm() -> bool:
|
||||||
|
machine = platform.machine()
|
||||||
|
return "arm" in machine or "aarch64" in machine
|
||||||
|
|
||||||
|
|
||||||
|
def is_mac() -> bool:
|
||||||
|
machine = platform.system()
|
||||||
|
return "Darwin" in machine
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def patch_torch_initlogs(mocker) -> None:
|
||||||
|
if is_mac():
|
||||||
|
# Mock torch import completely
|
||||||
|
import sys
|
||||||
|
import types
|
||||||
|
|
||||||
|
module_name = "torch"
|
||||||
|
mocked_module = types.ModuleType(module_name)
|
||||||
|
sys.modules[module_name] = mocked_module
|
||||||
|
else:
|
||||||
|
mocker.patch("torch._logging._init_logs")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def user_dir(mocker, tmp_path) -> Path:
|
def user_dir(mocker, tmp_path) -> Path:
|
||||||
user_dir = tmp_path / "user_data"
|
user_dir = tmp_path / "user_data"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import platform
|
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -20,30 +19,6 @@ def is_py12() -> bool:
|
|||||||
return sys.version_info >= (3, 12)
|
return sys.version_info >= (3, 12)
|
||||||
|
|
||||||
|
|
||||||
def is_mac() -> bool:
|
|
||||||
machine = platform.system()
|
|
||||||
return "Darwin" in machine
|
|
||||||
|
|
||||||
|
|
||||||
def is_arm() -> bool:
|
|
||||||
machine = platform.machine()
|
|
||||||
return "arm" in machine or "aarch64" in machine
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
|
||||||
def patch_torch_initlogs(mocker) -> None:
|
|
||||||
if is_mac():
|
|
||||||
# Mock torch import completely
|
|
||||||
import sys
|
|
||||||
import types
|
|
||||||
|
|
||||||
module_name = "torch"
|
|
||||||
mocked_module = types.ModuleType(module_name)
|
|
||||||
sys.modules[module_name] = mocked_module
|
|
||||||
else:
|
|
||||||
mocker.patch("torch._logging._init_logs")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
def freqai_conf(default_conf, tmp_path):
|
def freqai_conf(default_conf, tmp_path):
|
||||||
freqaiconf = deepcopy(default_conf)
|
freqaiconf = deepcopy(default_conf)
|
||||||
|
|||||||
@@ -10,11 +10,10 @@ from freqtrade.configuration import TimeRange
|
|||||||
from freqtrade.data.dataprovider import DataProvider
|
from freqtrade.data.dataprovider import DataProvider
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
||||||
from tests.conftest import get_patched_exchange
|
from tests.conftest import get_patched_exchange, is_mac
|
||||||
from tests.freqai.conftest import (
|
from tests.freqai.conftest import (
|
||||||
get_patched_data_kitchen,
|
get_patched_data_kitchen,
|
||||||
get_patched_freqai_strategy,
|
get_patched_freqai_strategy,
|
||||||
is_mac,
|
|
||||||
make_unfiltered_dataframe,
|
make_unfiltered_dataframe,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,16 @@ from freqtrade.freqai.utils import download_all_data_for_training, get_required_
|
|||||||
from freqtrade.optimize.backtesting import Backtesting
|
from freqtrade.optimize.backtesting import Backtesting
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
from freqtrade.plugins.pairlistmanager import PairListManager
|
from freqtrade.plugins.pairlistmanager import PairListManager
|
||||||
from tests.conftest import EXMS, create_mock_trades, get_patched_exchange, log_has_re
|
from tests.conftest import (
|
||||||
from tests.freqai.conftest import (
|
EXMS,
|
||||||
get_patched_freqai_strategy,
|
create_mock_trades,
|
||||||
|
get_patched_exchange,
|
||||||
is_arm,
|
is_arm,
|
||||||
is_mac,
|
is_mac,
|
||||||
|
log_has_re,
|
||||||
|
)
|
||||||
|
from tests.freqai.conftest import (
|
||||||
|
get_patched_freqai_strategy,
|
||||||
make_rl_config,
|
make_rl_config,
|
||||||
mock_pytorch_mlp_model_training_parameters,
|
mock_pytorch_mlp_model_training_parameters,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user