DOC/TST: Fix Python sklearn dep
This commit is contained in:
@@ -1,19 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import numpy as np
|
||||
import xgboost as xgb
|
||||
import xgboost.testing as tm
|
||||
import unittest
|
||||
|
||||
import matplotlib
|
||||
from matplotlib.axes import Axes
|
||||
from graphviz import Digraph
|
||||
try:
|
||||
import matplotlib
|
||||
matplotlib.use('Agg')
|
||||
from matplotlib.axes import Axes
|
||||
from graphviz import Digraph
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
tm._skip_if_no_matplotlib()
|
||||
|
||||
matplotlib.use('Agg')
|
||||
|
||||
dpath = 'demo/data/'
|
||||
rng = np.random.RandomState(1994)
|
||||
|
||||
|
||||
class TestPlotting(unittest.TestCase):
|
||||
|
||||
def test_plotting(self):
|
||||
bst2 = xgb.Booster(model_file='xgb.model')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user