File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 21
21
from mlflow .exceptions import RestException
22
22
from mlflow .protos .databricks_pb2 import ErrorCode , RESOURCE_DOES_NOT_EXIST
23
23
from mlflow .tracking import MlflowClient
24
- from sklearn .base import BaseEstimator
25
24
from torch import nn
26
25
26
+ from numalogic .base import BaseThresholdModel , BaseTransformer
27
27
from numalogic .registry import ArtifactManager , ArtifactData
28
28
from numalogic .registry .artifact import ArtifactCache
29
29
from numalogic .tools .exceptions import ModelVersionError
@@ -104,7 +104,7 @@ def __init__(
104
104
def handler_from_obj (artifact : artifact_t ):
105
105
if isinstance (artifact , nn .Module ):
106
106
return mlflow .pytorch
107
- if isinstance (artifact , BaseEstimator ):
107
+ if isinstance (artifact , ( BaseThresholdModel , BaseTransformer ) ):
108
108
return mlflow .sklearn
109
109
return mlflow .pyfunc
110
110
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " numalogic"
3
- version = " 0.12.4 "
3
+ version = " 0.13.0 "
4
4
description = " Collection of operational Machine Learning models and tools."
5
5
authors = [" Numalogic Developers" ]
6
6
packages = [{ include = " numalogic" }]
Original file line number Diff line number Diff line change 7
7
from mlflow .entities .model_registry import ModelVersion
8
8
from mlflow .models .model import ModelInfo
9
9
from mlflow .store .entities import PagedList
10
- from sklearn .ensemble import RandomForestRegressor
11
10
from sklearn .preprocessing import StandardScaler
12
11
from torch import tensor
13
12
13
+ from numalogic .models .threshold import StdDevThreshold
14
+
14
15
15
16
def create_model ():
16
17
x = torch .linspace (- math .pi , math .pi , 2000 )
@@ -33,8 +34,7 @@ def create_model():
33
34
34
35
35
36
def model_sklearn ():
36
- params = {"n_estimators" : 5 , "random_state" : 42 }
37
- return RandomForestRegressor (** params )
37
+ return StdDevThreshold ()
38
38
39
39
40
40
def mock_log_state_dict (* _ , ** __ ):
You can’t perform that action at this time.
0 commit comments