$ curl -I https://eng.mil.ru/
HTTP/1.1 418
Date: Thu, 24 Feb 2022 07:58:56 GMT
Content-Length: 0
Connection: keep-alive
Server: Ministry of Defence of the Russian Federation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/examples/pruning/lightgbm_integration.py b/examples/pruning/lightgbm_integration.py | |
index 8e623772..4c0c315c 100644 | |
--- a/examples/pruning/lightgbm_integration.py | |
+++ b/examples/pruning/lightgbm_integration.py | |
@@ -21,6 +21,15 @@ import optuna | |
# FYI: Objective functions can take additional arguments | |
# (https://optuna.readthedocs.io/en/stable/faq.html#objective-func-additional-args). | |
def objective(trial): | |
+ def custom_accuracy_pct(preds, data): | |
+ y_true = data.get_label() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from .functions import l2norm_numpy | |
def qe_dba( | |
feats_test, feats_index, sims, topk_idx, alpha=3.0, qe=True, dba=True | |
): | |
# alpha-query expansion (DBA) | |
feats_concat = np.concatenate([feats_test, feats_index], axis=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Usage: switchbot [OPTIONS] | |
Options: | |
-d, --device [light|speaker.tv|speaker.mpd|aircon] | |
[required] | |
--on | |
--off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An example to check the AUC score on a validation set for each 10 epochs. | |
I hope it will be helpful for optimizing number of epochs. | |
""" | |
# -*- coding: utf-8 -*- | |
import logging | |
from sklearn.metrics import roc_auc_score | |
from keras.callbacks import Callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[I 2020-04-16 15:04:56,418] Using an existing study with name 'parallel' instead of creating a new one. | |
feature_fraction, val_score: inf: 0%| | 0/7 [00:00<?, ?it/s][W 2020-04-16 15:04:56,643] Setting status of trial#15 as TrialState.FAIL because of the following error: AttributeError("'numpy.float64' object has no attribute 'translate'") | |
Traceback (most recent call last): | |
File "/home/smly/gitws/optuna/optuna/study.py", line 682, in _run_trial | |
result = func(trial) | |
File "/home/smly/gitws/optuna/optuna/integration/lightgbm_tuner/optimize.py", line 229, in __call__ | |
param_value = min(trial.suggest_uniform("feature_fraction", 0.4, 1.0 + EPS), 1.0) | |
File "/home/smly/gitws/optuna/optuna/trial.py", line 550, in suggest_uniform | |
return self._suggest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
col target | |
0 Cat 1 | |
1 Dog 1 | |
2 Dog 0 | |
3 Dog 0 | |
4 Fox 0 | |
<class 'cudf.core.dataframe.DataFrame'> | |
col target col_le | |
0 Cat 1 0 | |
1 Dog 1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/optuna/integration/lightgbm_tuner/optimize.py b/optuna/integration/lightgbm_tuner/optimize.py | |
index f11c8326..4434e51c 100644 | |
--- a/optuna/integration/lightgbm_tuner/optimize.py | |
+++ b/optuna/integration/lightgbm_tuner/optimize.py | |
@@ -112,7 +112,14 @@ class BaseTuner(object): | |
else: | |
raise NotImplementedError | |
+ if self.lgbm_params.get("metric") == "None": | |
+ if len(booster.best_score[valid_name].keys()) > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import optuna.integration.lightgbm as lgb | |
import numpy as np | |
import optuna | |
def test_run() -> None: | |
params = { | |
"objective": "binary", | |
"metric": "binary_logloss", | |
} # type: Dict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import sklearn.datasets | |
from sklearn.metrics import accuracy_score | |
from sklearn.model_selection import train_test_split | |
import mlflow | |
import optuna | |
import optuna.integration.lightgbm as lgb | |
NewerOlder