oracle-ads 2.13.13__py3-none-any.whl → 2.13.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ads/aqua/extension/model_handler.py +7 -3
- ads/aqua/modeldeployment/deployment.py +1 -23
- ads/common/utils.py +1 -3
- ads/feature_engineering/feature_type/boolean.py +15 -14
- ads/feature_engineering/feature_type/category.py +12 -11
- ads/feature_engineering/feature_type/continuous.py +13 -12
- ads/feature_engineering/feature_type/datetime.py +10 -13
- ads/feature_engineering/feature_type/gis.py +15 -13
- ads/feature_engineering/feature_type/integer.py +11 -10
- ads/feature_engineering/feature_type/ip_address.py +9 -7
- ads/feature_engineering/feature_type/ip_address_v4.py +7 -6
- ads/feature_engineering/feature_type/ip_address_v6.py +7 -6
- ads/feature_engineering/feature_type/lat_long.py +15 -14
- ads/feature_engineering/feature_type/phone_number.py +8 -7
- ads/feature_engineering/feature_type/string.py +12 -12
- ads/feature_engineering/feature_type/text.py +6 -7
- ads/feature_engineering/feature_type/zip_code.py +11 -9
- ads/feature_engineering/utils.py +14 -12
- ads/model/transformer/onnx_transformer.py +7 -8
- ads/templates/score.jinja2 +3 -3
- ads/templates/score_onnx.jinja2 +3 -3
- ads/templates/score_onnx_new.jinja2 +3 -3
- {oracle_ads-2.13.13.dist-info → oracle_ads-2.13.15.dist-info}/METADATA +7 -4
- {oracle_ads-2.13.13.dist-info → oracle_ads-2.13.15.dist-info}/RECORD +27 -27
- {oracle_ads-2.13.13.dist-info → oracle_ads-2.13.15.dist-info}/WHEEL +0 -0
- {oracle_ads-2.13.13.dist-info → oracle_ads-2.13.15.dist-info}/entry_points.txt +0 -0
- {oracle_ads-2.13.13.dist-info → oracle_ads-2.13.15.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2021,
|
3
|
+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
"""
|
@@ -15,22 +14,24 @@ Functions:
|
|
15
14
|
default_handler(data: pd.Series) -> pd.Series
|
16
15
|
Processes given data and indicates if the data matches requirements.
|
17
16
|
"""
|
17
|
+
|
18
|
+
import re
|
19
|
+
|
18
20
|
import matplotlib.pyplot as plt
|
19
21
|
import pandas as pd
|
20
|
-
|
22
|
+
|
23
|
+
from ads.common.decorator.runtime_dependency import (
|
24
|
+
OptionalDependency,
|
25
|
+
runtime_dependency,
|
26
|
+
)
|
27
|
+
from ads.feature_engineering import schema
|
21
28
|
from ads.feature_engineering.feature_type.string import String
|
22
29
|
from ads.feature_engineering.utils import (
|
23
|
-
_count_unique_missing,
|
24
|
-
_str_lat_long_to_point,
|
25
30
|
SchemeNeutral,
|
26
31
|
SchemeTeal,
|
32
|
+
_count_unique_missing,
|
33
|
+
_str_lat_long_to_point,
|
27
34
|
)
|
28
|
-
from ads.feature_engineering import schema
|
29
|
-
from ads.common.decorator.runtime_dependency import (
|
30
|
-
runtime_dependency,
|
31
|
-
OptionalDependency,
|
32
|
-
)
|
33
|
-
|
34
35
|
|
35
36
|
PATTERN = re.compile(r"^[(]?(\-?\d+\.\d+?),\s*(\-?\d+\.\d+?)[)]?$", re.VERBOSE)
|
36
37
|
|
@@ -131,7 +132,7 @@ class LatLong(String):
|
|
131
132
|
"-44.510428,-169.269477",
|
132
133
|
"-56.3344375,-166.407038",
|
133
134
|
"",
|
134
|
-
np.
|
135
|
+
np.nan,
|
135
136
|
None
|
136
137
|
],
|
137
138
|
name='latlong'
|
@@ -170,7 +171,7 @@ class LatLong(String):
|
|
170
171
|
"-44.510428,-169.269477",
|
171
172
|
"-56.3344375,-166.407038",
|
172
173
|
"",
|
173
|
-
np.
|
174
|
+
np.nan,
|
174
175
|
None
|
175
176
|
],
|
176
177
|
name='latlong'
|
@@ -226,7 +227,7 @@ class LatLong(String):
|
|
226
227
|
"-44.510428,-169.269477",
|
227
228
|
"-56.3344375,-166.407038",
|
228
229
|
"",
|
229
|
-
np.
|
230
|
+
np.nan,
|
230
231
|
None
|
231
232
|
],
|
232
233
|
name='latlong'
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2021 Oracle and/or its affiliates.
|
3
|
+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
"""
|
@@ -15,12 +14,14 @@ Functions:
|
|
15
14
|
default_handler(data: pd.Series) -> pd.Series
|
16
15
|
Processes given data and indicates if the data matches requirements.
|
17
16
|
"""
|
18
|
-
|
17
|
+
|
19
18
|
import re
|
19
|
+
|
20
|
+
import pandas as pd
|
21
|
+
|
22
|
+
from ads.feature_engineering import schema
|
20
23
|
from ads.feature_engineering.feature_type.string import String
|
21
24
|
from ads.feature_engineering.utils import _count_unique_missing
|
22
|
-
from ads.feature_engineering import schema
|
23
|
-
|
24
25
|
|
25
26
|
PATTERN = re.compile(
|
26
27
|
r"^(\+?\d{1,2}[\s-])?\(?(\d{3})\)?[\s.-]?\d{3}[\s.-]?\d{4}$", re.VERBOSE
|
@@ -91,7 +92,7 @@ class PhoneNumber(String):
|
|
91
92
|
|
92
93
|
Examples
|
93
94
|
--------
|
94
|
-
>>> s = pd.Series(['2068866666', '6508866666', '2068866666', '', np.
|
95
|
+
>>> s = pd.Series(['2068866666', '6508866666', '2068866666', '', np.nan, np.nan, None], name='phone')
|
95
96
|
>>> s.ads.feature_type = ['phone_number']
|
96
97
|
>>> s.ads.feature_stat()
|
97
98
|
Metric Value
|
@@ -113,7 +114,7 @@ class PhoneNumber(String):
|
|
113
114
|
|
114
115
|
Examples
|
115
116
|
--------
|
116
|
-
>>> s = pd.Series(['2068866666', '6508866666', '2068866666', '', np.
|
117
|
+
>>> s = pd.Series(['2068866666', '6508866666', '2068866666', '', np.nan, np.nan, None], name='phone')
|
117
118
|
>>> s.ads.feature_type = ['phone_number']
|
118
119
|
>>> s.ads.feature_domain()
|
119
120
|
constraints: []
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2021,
|
3
|
+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
"""
|
@@ -11,19 +10,20 @@ Classes:
|
|
11
10
|
String
|
12
11
|
The feature type that represents string values.
|
13
12
|
"""
|
13
|
+
|
14
14
|
import matplotlib.pyplot as plt
|
15
15
|
import pandas as pd
|
16
|
+
|
17
|
+
from ads.common.decorator.runtime_dependency import (
|
18
|
+
OptionalDependency,
|
19
|
+
runtime_dependency,
|
20
|
+
)
|
21
|
+
from ads.feature_engineering import schema
|
16
22
|
from ads.feature_engineering.feature_type.base import FeatureType
|
17
23
|
from ads.feature_engineering.utils import (
|
24
|
+
SchemeNeutral,
|
18
25
|
_count_unique_missing,
|
19
26
|
random_color_func,
|
20
|
-
SchemeNeutral,
|
21
|
-
)
|
22
|
-
from ads.feature_engineering import schema
|
23
|
-
from ads.common import utils, logger
|
24
|
-
from ads.common.decorator.runtime_dependency import (
|
25
|
-
runtime_dependency,
|
26
|
-
OptionalDependency,
|
27
27
|
)
|
28
28
|
|
29
29
|
|
@@ -89,7 +89,7 @@ class String(FeatureType):
|
|
89
89
|
Examples
|
90
90
|
--------
|
91
91
|
>>> string = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
|
92
|
-
'S', 'S', 'S', 'Q', 'S', 'S', '', np.
|
92
|
+
'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan, None], name='string')
|
93
93
|
>>> string.ads.feature_type = ['string']
|
94
94
|
>>> string.ads.feature_stat()
|
95
95
|
Metric Value
|
@@ -113,7 +113,7 @@ class String(FeatureType):
|
|
113
113
|
Examples
|
114
114
|
--------
|
115
115
|
>>> string = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
|
116
|
-
'S', 'S', 'S', 'Q', 'S', 'S', '', np.
|
116
|
+
'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan, None], name='string')
|
117
117
|
>>> string.ads.feature_type = ['string']
|
118
118
|
>>> string.ads.feature_plot()
|
119
119
|
|
@@ -149,7 +149,7 @@ class String(FeatureType):
|
|
149
149
|
Examples
|
150
150
|
--------
|
151
151
|
>>> string = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
|
152
|
-
'S', 'S', 'S', 'Q', 'S', 'S', '', np.
|
152
|
+
'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan, None], name='string')
|
153
153
|
>>> string.ads.feature_type = ['string']
|
154
154
|
>>> string.ads.feature_domain()
|
155
155
|
constraints: []
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2021,
|
3
|
+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
"""
|
@@ -11,16 +10,16 @@ Classes:
|
|
11
10
|
Text
|
12
11
|
The Text feature type.
|
13
12
|
"""
|
13
|
+
|
14
14
|
import matplotlib.pyplot as plt
|
15
15
|
import pandas as pd
|
16
|
-
from ads.feature_engineering.feature_type.string import String
|
17
|
-
from ads.feature_engineering.utils import random_color_func, SchemeNeutral
|
18
16
|
|
19
|
-
from ads.common import utils, logger
|
20
17
|
from ads.common.decorator.runtime_dependency import (
|
21
|
-
runtime_dependency,
|
22
18
|
OptionalDependency,
|
19
|
+
runtime_dependency,
|
23
20
|
)
|
21
|
+
from ads.feature_engineering.feature_type.string import String
|
22
|
+
from ads.feature_engineering.utils import SchemeNeutral, random_color_func
|
24
23
|
|
25
24
|
|
26
25
|
class Text(String):
|
@@ -53,7 +52,7 @@ class Text(String):
|
|
53
52
|
Examples
|
54
53
|
--------
|
55
54
|
>>> text = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
|
56
|
-
'S', 'S', 'S', 'Q', 'S', 'S', '', np.
|
55
|
+
'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan, None], name='text')
|
57
56
|
>>> text.ads.feature_type = ['text']
|
58
57
|
>>> text.ads.feature_plot()
|
59
58
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2021 Oracle and/or its affiliates.
|
3
|
+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
"""
|
@@ -15,17 +14,20 @@ Functions:
|
|
15
14
|
default_handler(data: pd.Series) -> pd.Series
|
16
15
|
Processes given data and indicates if the data matches requirements.
|
17
16
|
"""
|
17
|
+
|
18
|
+
import re
|
19
|
+
|
18
20
|
import matplotlib.pyplot as plt
|
19
21
|
import pandas as pd
|
20
|
-
|
22
|
+
|
23
|
+
from ads.feature_engineering import schema
|
21
24
|
from ads.feature_engineering.feature_type.string import String
|
22
25
|
from ads.feature_engineering.utils import (
|
23
26
|
_count_unique_missing,
|
24
|
-
_to_lat_long,
|
25
27
|
_plot_gis_scatter,
|
28
|
+
_to_lat_long,
|
26
29
|
_zip_code,
|
27
30
|
)
|
28
|
-
from ads.feature_engineering import schema
|
29
31
|
|
30
32
|
PATTERN = re.compile(r"^[0-9]{5}(?:-[0-9]{4})?$", re.VERBOSE)
|
31
33
|
|
@@ -78,7 +80,7 @@ class ZipCode(String):
|
|
78
80
|
>>> from ads.feature_engineering.feature_type.zip_code import ZipCode
|
79
81
|
>>> import pandas as pd
|
80
82
|
>>> import numpy as np
|
81
|
-
>>> s = pd.Series(["94065", "90210", np.
|
83
|
+
>>> s = pd.Series(["94065", "90210", np.nan, None], name='zipcode')
|
82
84
|
>>> ZipCode.validator.is_zip_code(s)
|
83
85
|
0 True
|
84
86
|
1 True
|
@@ -97,7 +99,7 @@ class ZipCode(String):
|
|
97
99
|
|
98
100
|
Examples
|
99
101
|
--------
|
100
|
-
>>> zipcode = pd.Series([94065, 90210, np.
|
102
|
+
>>> zipcode = pd.Series([94065, 90210, np.nan, None], name='zipcode')
|
101
103
|
>>> zipcode.ads.feature_type = ['zip_code']
|
102
104
|
>>> zipcode.ads.feature_stat()
|
103
105
|
Metric Value
|
@@ -119,7 +121,7 @@ class ZipCode(String):
|
|
119
121
|
|
120
122
|
Examples
|
121
123
|
--------
|
122
|
-
>>> zipcode = pd.Series([94065, 90210, np.
|
124
|
+
>>> zipcode = pd.Series([94065, 90210, np.nan, None], name='zipcode')
|
123
125
|
>>> zipcode.ads.feature_type = ['zip_code']
|
124
126
|
>>> zipcode.ads.feature_plot()
|
125
127
|
Returns
|
@@ -138,7 +140,7 @@ class ZipCode(String):
|
|
138
140
|
|
139
141
|
Examples
|
140
142
|
--------
|
141
|
-
>>> zipcode = pd.Series([94065, 90210, np.
|
143
|
+
>>> zipcode = pd.Series([94065, 90210, np.nan, None], name='zipcode')
|
142
144
|
>>> zipcode.ads.feature_type = ['zip_code']
|
143
145
|
>>> zipcode.ads.feature_domain()
|
144
146
|
constraints: []
|
ads/feature_engineering/utils.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2021,
|
3
|
+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
"""
|
@@ -11,18 +10,21 @@ Functions:
|
|
11
10
|
is_boolean(value: Any) -> bool
|
12
11
|
Checks if value type is boolean.
|
13
12
|
"""
|
14
|
-
|
13
|
+
|
14
|
+
import re
|
15
|
+
from functools import lru_cache
|
16
|
+
from typing import Any
|
17
|
+
|
15
18
|
import matplotlib.pyplot as plt
|
19
|
+
import numpy as np
|
16
20
|
import pandas as pd
|
17
|
-
|
21
|
+
|
18
22
|
from ads.common.card_identifier import card_identify
|
19
23
|
from ads.common.decorator.runtime_dependency import (
|
20
|
-
runtime_dependency,
|
21
24
|
OptionalDependency,
|
25
|
+
runtime_dependency,
|
22
26
|
)
|
23
27
|
from ads.feature_engineering.dataset.zip_code_data import zip_code_dict
|
24
|
-
from functools import lru_cache
|
25
|
-
from typing import Any
|
26
28
|
|
27
29
|
|
28
30
|
class SchemeNeutral(str):
|
@@ -67,7 +69,7 @@ def _add_missing(x, df):
|
|
67
69
|
"""
|
68
70
|
Adds count of missing values.
|
69
71
|
"""
|
70
|
-
n_missing = pd.isnull(x.replace(r"", np.
|
72
|
+
n_missing = pd.isnull(x.replace(r"", np.nan)).sum()
|
71
73
|
if n_missing > 0:
|
72
74
|
df.loc["missing"] = n_missing
|
73
75
|
return df
|
@@ -78,7 +80,7 @@ def _count_unique_missing(x):
|
|
78
80
|
Returns the total count, unique count and count of missing values of a series.
|
79
81
|
"""
|
80
82
|
df_stat = pd.Series(
|
81
|
-
{"count": len(x), "unique": len(x.replace(r"", np.
|
83
|
+
{"count": len(x), "unique": len(x.replace(r"", np.nan).dropna().unique())},
|
82
84
|
name=x.name,
|
83
85
|
).to_frame()
|
84
86
|
return _add_missing(x, df_stat)
|
@@ -122,7 +124,7 @@ def random_color_func(
|
|
122
124
|
h = 179
|
123
125
|
s = 23
|
124
126
|
l = int(100.0 * float(random_state.randint(60, 120)) / 255.0)
|
125
|
-
return "hsl({}, {}%, {}%)"
|
127
|
+
return f"hsl({h}, {s}%, {l}%)"
|
126
128
|
|
127
129
|
|
128
130
|
def _is_float(s: str):
|
@@ -135,7 +137,7 @@ def _is_float(s: str):
|
|
135
137
|
def _str_lat_long_to_point(s):
|
136
138
|
"""
|
137
139
|
Converts input data into formated geometry point
|
138
|
-
Return formated geometry point string or np.
|
140
|
+
Return formated geometry point string or np.nan if input string is not valid
|
139
141
|
"""
|
140
142
|
if isinstance(s, str):
|
141
143
|
coords = s.split(",")
|
@@ -147,7 +149,7 @@ def _str_lat_long_to_point(s):
|
|
147
149
|
long = long[:-1]
|
148
150
|
if _is_float(lat) and _is_float(long):
|
149
151
|
return "POINT(" + long + " " + lat + ")"
|
150
|
-
return np.
|
152
|
+
return np.nan
|
151
153
|
|
152
154
|
|
153
155
|
@runtime_dependency(module="geopandas", install_from=OptionalDependency.GEO)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*--
|
3
2
|
|
4
|
-
# Copyright (c) 2022 Oracle and/or its affiliates.
|
3
|
+
# Copyright (c) 2022, 2025 Oracle and/or its affiliates.
|
5
4
|
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
|
6
5
|
|
7
6
|
import json
|
@@ -16,7 +15,7 @@ pd.options.mode.chained_assignment = None
|
|
16
15
|
|
17
16
|
# Note to developers: If you make any changes to this class, copy and paste those changes over to
|
18
17
|
# templates/score_onnx.jinja2 and templates/score_onnx_new.jinja2. We do not yet have an automatic way of doing this.
|
19
|
-
class ONNXTransformer
|
18
|
+
class ONNXTransformer:
|
20
19
|
"""
|
21
20
|
This is a transformer to convert X [pandas.Dataframe, pd.Series] data into Onnx
|
22
21
|
readable dtypes and formats. It is Serializable, so it can be reloaded at another time.
|
@@ -199,7 +198,7 @@ class ONNXTransformer(object):
|
|
199
198
|
X, impute_values=impute_values
|
200
199
|
)
|
201
200
|
elif isinstance(X, pd.Series):
|
202
|
-
X = X.replace(r"^\s*$", np.
|
201
|
+
X = X.replace(r"^\s*$", np.nan, regex=True)
|
203
202
|
if len(impute_values.keys()) == 1:
|
204
203
|
for key, val in impute_values.items():
|
205
204
|
X = X.fillna(val)
|
@@ -208,7 +207,7 @@ class ONNXTransformer(object):
|
|
208
207
|
"Multiple imputed values are provided, but `X` has only one dim."
|
209
208
|
)
|
210
209
|
else:
|
211
|
-
raise
|
210
|
+
raise NotImplementedError(
|
212
211
|
f"{type(X)} is not supported. Convert `X` to pandas dataframe or numpy array."
|
213
212
|
)
|
214
213
|
return X
|
@@ -218,11 +217,11 @@ class ONNXTransformer(object):
|
|
218
217
|
for idx, val in impute_values.items():
|
219
218
|
if isinstance(idx, int):
|
220
219
|
X.iloc[:, idx] = (
|
221
|
-
X.iloc[:, idx].replace(r"^\s*$", np.
|
220
|
+
X.iloc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
222
221
|
)
|
223
222
|
else:
|
224
223
|
X.loc[:, idx] = (
|
225
|
-
X.loc[:, idx].replace(r"^\s*$", np.
|
224
|
+
X.loc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
226
225
|
)
|
227
226
|
return X
|
228
227
|
|
@@ -294,7 +293,7 @@ class ONNXTransformer(object):
|
|
294
293
|
The loaded model
|
295
294
|
"""
|
296
295
|
# Make sure you have pandas, numpy, and sklearn imported
|
297
|
-
with open(filename
|
296
|
+
with open(filename) as f:
|
298
297
|
export_dict = json.load(f)
|
299
298
|
|
300
299
|
onnx_transformer = ONNXTransformer()
|
ads/templates/score.jinja2
CHANGED
@@ -207,7 +207,7 @@ class ONNXTransformer(object):
|
|
207
207
|
X, impute_values=impute_values
|
208
208
|
)
|
209
209
|
elif isinstance(X, pd.Series):
|
210
|
-
X = X.replace(r"^\s*$", np.
|
210
|
+
X = X.replace(r"^\s*$", np.nan, regex=True)
|
211
211
|
if len(impute_values.keys()) == 1:
|
212
212
|
for key, val in impute_values.items():
|
213
213
|
X = X.fillna(val)
|
@@ -226,11 +226,11 @@ class ONNXTransformer(object):
|
|
226
226
|
for idx, val in impute_values.items():
|
227
227
|
if isinstance(idx, int):
|
228
228
|
X.iloc[:, idx] = (
|
229
|
-
X.iloc[:, idx].replace(r"^\s*$", np.
|
229
|
+
X.iloc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
230
230
|
)
|
231
231
|
else:
|
232
232
|
X.loc[:, idx] = (
|
233
|
-
X.loc[:, idx].replace(r"^\s*$", np.
|
233
|
+
X.loc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
234
234
|
)
|
235
235
|
return X
|
236
236
|
|
ads/templates/score_onnx.jinja2
CHANGED
@@ -282,7 +282,7 @@ class ONNXTransformer(object):
|
|
282
282
|
X, impute_values=impute_values
|
283
283
|
)
|
284
284
|
elif isinstance(X, pd.Series):
|
285
|
-
X = X.replace(r"^\s*$", np.
|
285
|
+
X = X.replace(r"^\s*$", np.nan, regex=True)
|
286
286
|
if len(impute_values.keys()) == 1:
|
287
287
|
for key, val in impute_values.items():
|
288
288
|
X = X.fillna(val)
|
@@ -301,11 +301,11 @@ class ONNXTransformer(object):
|
|
301
301
|
for idx, val in impute_values.items():
|
302
302
|
if isinstance(idx, int):
|
303
303
|
X.iloc[:, idx] = (
|
304
|
-
X.iloc[:, idx].replace(r"^\s*$", np.
|
304
|
+
X.iloc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
305
305
|
)
|
306
306
|
else:
|
307
307
|
X.loc[:, idx] = (
|
308
|
-
X.loc[:, idx].replace(r"^\s*$", np.
|
308
|
+
X.loc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
309
309
|
)
|
310
310
|
return X
|
311
311
|
|
@@ -348,7 +348,7 @@ class ONNXTransformer(object):
|
|
348
348
|
X, impute_values=impute_values
|
349
349
|
)
|
350
350
|
elif isinstance(X, pd.Series):
|
351
|
-
X = X.replace(r"^\s*$", np.
|
351
|
+
X = X.replace(r"^\s*$", np.nan, regex=True)
|
352
352
|
if len(impute_values.keys()) == 1:
|
353
353
|
for key, val in impute_values.items():
|
354
354
|
X = X.fillna(val)
|
@@ -367,11 +367,11 @@ class ONNXTransformer(object):
|
|
367
367
|
for idx, val in impute_values.items():
|
368
368
|
if isinstance(idx, int):
|
369
369
|
X.iloc[:, idx] = (
|
370
|
-
X.iloc[:, idx].replace(r"^\s*$", np.
|
370
|
+
X.iloc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
371
371
|
)
|
372
372
|
else:
|
373
373
|
X.loc[:, idx] = (
|
374
|
-
X.loc[:, idx].replace(r"^\s*$", np.
|
374
|
+
X.loc[:, idx].replace(r"^\s*$", np.nan, regex=True).fillna(val)
|
375
375
|
)
|
376
376
|
return X
|
377
377
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: oracle_ads
|
3
|
-
Version: 2.13.
|
3
|
+
Version: 2.13.15
|
4
4
|
Summary: Oracle Accelerated Data Science SDK
|
5
5
|
Keywords: Oracle Cloud Infrastructure,OCI,Machine Learning,ML,Artificial Intelligence,AI,Data Science,Cloud,Oracle,GenAI,Generative AI,Forecast,Anomaly,Document Understanding,Anomaly Detection
|
6
6
|
Author: Oracle Data Science
|
@@ -22,15 +22,15 @@ Requires-Dist: cloudpickle>=1.6.0
|
|
22
22
|
Requires-Dist: fsspec>=0.8.7
|
23
23
|
Requires-Dist: gitpython>=3.1.2
|
24
24
|
Requires-Dist: jinja2>=2.11.2
|
25
|
-
Requires-Dist: matplotlib>=3.1.3
|
26
|
-
Requires-Dist: numpy>=1.19.2
|
25
|
+
Requires-Dist: matplotlib>=3.1.3
|
26
|
+
Requires-Dist: numpy>=1.19.2
|
27
27
|
Requires-Dist: oci>=2.148.0
|
28
28
|
Requires-Dist: ocifs>=1.1.3
|
29
29
|
Requires-Dist: pandas>=2.2.0
|
30
30
|
Requires-Dist: psutil>=5.7.2
|
31
31
|
Requires-Dist: python_jsonschema_objects>=0.3.13
|
32
32
|
Requires-Dist: requests
|
33
|
-
Requires-Dist: scikit-learn>=1.0
|
33
|
+
Requires-Dist: scikit-learn>=1.0
|
34
34
|
Requires-Dist: tabulate>=0.8.9
|
35
35
|
Requires-Dist: tqdm>=4.59.0
|
36
36
|
Requires-Dist: pydantic>=2.6.3
|
@@ -56,6 +56,7 @@ Requires-Dist: ibis-framework[impala] ; extra == "bds"
|
|
56
56
|
Requires-Dist: sqlalchemy ; extra == "bds"
|
57
57
|
Requires-Dist: lightgbm ; extra == "boosted"
|
58
58
|
Requires-Dist: xgboost ; extra == "boosted"
|
59
|
+
Requires-Dist: scikit-learn>=1.0,<1.6.0 ; extra == "boosted"
|
59
60
|
Requires-Dist: datefinder>=0.7.1 ; extra == "data"
|
60
61
|
Requires-Dist: fastavro>=0.24.2 ; extra == "data"
|
61
62
|
Requires-Dist: htmllistparse>=0.6.0 ; extra == "data"
|
@@ -98,6 +99,7 @@ Requires-Dist: pydantic>=2,<3 ; extra == "llm"
|
|
98
99
|
Requires-Dist: evaluate>=0.4.0 ; extra == "llm"
|
99
100
|
Requires-Dist: ipython>=7.23.1, <8.0 ; extra == "notebook"
|
100
101
|
Requires-Dist: ipywidgets~=7.6.3 ; extra == "notebook"
|
102
|
+
Requires-Dist: scikit-learn>=1.0,<1.6.0 ; extra == "notebook"
|
101
103
|
Requires-Dist: lightgbm ; extra == "onnx"
|
102
104
|
Requires-Dist: onnx>=1.12.0,<=1.15.0 ; extra == "onnx" and ( python_version < '3.12')
|
103
105
|
Requires-Dist: onnx~=1.17.0 ; extra == "onnx" and ( python_version >= '3.12')
|
@@ -110,6 +112,7 @@ Requires-Dist: skl2onnx>=1.10.4 ; extra == "onnx" and ( python_version < '3.12')
|
|
110
112
|
Requires-Dist: skl2onnx~=1.18.0 ; extra == "onnx" and ( python_version >= '3.12')
|
111
113
|
Requires-Dist: tf2onnx ; extra == "onnx"
|
112
114
|
Requires-Dist: xgboost<=1.7 ; extra == "onnx"
|
115
|
+
Requires-Dist: scikit-learn>=1.0,<1.6.0 ; extra == "onnx"
|
113
116
|
Requires-Dist: conda-pack ; extra == "opctl"
|
114
117
|
Requires-Dist: docker ; extra == "opctl"
|
115
118
|
Requires-Dist: inflection ; extra == "opctl"
|