2
2
import warnings
3
3
from sasctl .pzmm .modelParameters import ModelParameters as mp
4
4
5
- pytestmark = pytest .mark .usefixtures (' session' )
5
+ pytestmark = pytest .mark .usefixtures (" session" )
6
6
7
7
8
8
@pytest .fixture
@@ -12,20 +12,20 @@ def train_data():
12
12
try :
13
13
import pandas as pd
14
14
except ImportError :
15
- pytest .skip (' Package `pandas` not found.' )
15
+ pytest .skip (" Package `pandas` not found." )
16
16
17
17
try :
18
18
from sklearn import datasets
19
19
except ImportError :
20
- pytest .skip (' Package `sklearn` not found.' )
20
+ pytest .skip (" Package `sklearn` not found." )
21
21
22
22
raw = datasets .load_iris ()
23
23
iris = pd .DataFrame (raw .data , columns = raw .feature_names )
24
24
iris = iris .join (pd .DataFrame (raw .target ))
25
- iris .columns = [' SepalLength' , ' SepalWidth' , ' PetalLength' , ' PetalWidth' , ' Species' ]
26
- iris [' Species' ] = iris [' Species' ].astype (' category' )
25
+ iris .columns = [" SepalLength" , " SepalWidth" , " PetalLength" , " PetalWidth" , " Species" ]
26
+ iris [" Species" ] = iris [" Species" ].astype (" category" )
27
27
iris .Species .cat .categories = raw .target_names
28
- return iris .iloc [:, 0 :4 ], iris [' Species' ]
28
+ return iris .iloc [:, 0 :4 ], iris [" Species" ]
29
29
30
30
31
31
@pytest .fixture
@@ -35,21 +35,18 @@ def sklearn_model(train_data):
35
35
try :
36
36
from sklearn .linear_model import LogisticRegression
37
37
except ImportError :
38
- pytest .skip (' Package `sklearn` not found.' )
38
+ pytest .skip (" Package `sklearn` not found." )
39
39
40
40
X , y = train_data
41
41
with warnings .catch_warnings ():
42
- warnings .simplefilter (' ignore' )
43
- model = LogisticRegression (multi_class = ' multinomial' , solver = ' lbfgs' )
42
+ warnings .simplefilter (" ignore" )
43
+ model = LogisticRegression (multi_class = " multinomial" , solver = " lbfgs" )
44
44
model .fit (X , y )
45
45
return model
46
46
47
+
47
48
@pytest .mark .incremental
48
49
class TestSklearnModel :
49
- PROJECT_NAME = "Test SKLearn Model"
50
- MODEL_NAME = "SKLearnModel"
51
- PATH = "."
52
-
53
-
54
-
55
-
50
+ PROJECT_NAME = "Test SKLearn Model"
51
+ MODEL_NAME = "SKLearnModel"
52
+ PATH = "."
0 commit comments