forked from bentoml/BentoML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
49 lines (45 loc) · 1.09 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import xgboost as xgb
import bentoml
# Load the model by setting the model tag
booster = bentoml.xgboost.load_model("cancer:latest")
# Predict using a sample
res = booster.predict(
xgb.DMatrix(
[
[
1.308e01,
1.571e01,
8.563e01,
5.200e02,
1.075e-01,
1.270e-01,
4.568e-02,
3.110e-02,
1.967e-01,
6.811e-02,
1.852e-01,
7.477e-01,
1.383e00,
1.467e01,
4.097e-03,
1.898e-02,
1.698e-02,
6.490e-03,
1.678e-02,
2.425e-03,
1.450e01,
2.049e01,
9.609e01,
6.305e02,
1.312e-01,
2.776e-01,
1.890e-01,
7.283e-02,
3.184e-01,
8.183e-02,
]
]
)
)
print(res)
# Expected output: [[0.02664177 0.9733583 ]]