forked from pycaret/pycaret
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_create_docker.py
61 lines (44 loc) · 1.21 KB
/
test_create_docker.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
50
51
52
53
54
55
56
57
58
59
60
61
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
import numpy as np
import pandas as pd
import pytest
import pycaret.classification
import pycaret.datasets
import pycaret.regression
def test_classification_create_docker():
# loading dataset
data = pycaret.datasets.get_data("blood")
# initialize setup
clf1 = pycaret.classification.setup(
data,
target="Class",
html=False,
n_jobs=1,
)
# train model
lr = pycaret.classification.create_model("lr")
# create api
pycaret.classification.create_api(lr, "blood_api")
pycaret.classification.create_docker("blood_api")
assert 1 == 1
def test_regression_create_docker():
# loading dataset
data = pycaret.datasets.get_data("boston")
# initialize setup
reg1 = pycaret.regression.setup(
data,
target="medv",
html=False,
n_jobs=1,
)
# train model
lr = pycaret.regression.create_model("lr")
# create api
pycaret.regression.create_api(lr, "boston_api")
pycaret.regression.create_docker("boston_api")
assert 1 == 1
if __name__ == "__main__":
test_classification_create_docker()
test_regression_create_docker()