Y-oHr-N / OptGBM

Optuna + LightGBM = OptGBM
MIT License
34 stars 7 forks source link

Set _evals_result so that lgb.plot_metric can be used #77

Open Y-oHr-N opened 4 years ago

Y-oHr-N commented 4 years ago

This PR closes #75.

codecov-io commented 4 years ago

Codecov Report

Merging #77 into master will increase coverage by 0.05%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
+ Coverage   96.27%   96.33%   +0.05%     
==========================================
  Files           8        8              
  Lines         564      573       +9     
==========================================
+ Hits          543      552       +9     
  Misses         21       21              
Impacted Files Coverage Δ
optgbm/sklearn.py 96.44% <100.00%> (+0.05%) :arrow_up:
tests/test_sklearn.py 99.44% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 315fc1b...6cf921e. Read the comment docs.

Y-oHr-N commented 4 years ago
import optgbm as lgb
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris

X, y = load_iris(return_X_y=True)
clf = lgb.LGBMClassifier(random_state=0)

clf.fit(X, y)

lgb.plot_metric(clf)

plt.show()

Figure_1