1
1
#!/usr/bin/env python
2
- # -*- coding: utf-8 -*--
3
2
4
- # Copyright (c) 2021, 2022 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
"""
11
10
Category
12
11
The Category feature type.
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
+ SchemeTeal ,
18
25
_count_unique_missing ,
19
26
_set_seaborn_theme ,
20
- SchemeTeal ,
21
- )
22
- from ads .feature_engineering import schema
23
- from ads .common .decorator .runtime_dependency import (
24
- runtime_dependency ,
25
- OptionalDependency ,
26
27
)
27
28
28
29
@@ -71,7 +72,7 @@ def feature_stat(x: pd.Series) -> pd.DataFrame:
71
72
Examples
72
73
--------
73
74
>>> cat = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
74
- 'S', 'S', 'S', 'Q', 'S', 'S', '', np.NaN , None], name='сategory')
75
+ 'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan , None], name='сategory')
75
76
>>> cat.ads.feature_type = ['сategory']
76
77
>>> cat.ads.feature_stat()
77
78
Metric Value
@@ -100,7 +101,7 @@ def feature_plot(x: pd.Series) -> plt.Axes:
100
101
Examples
101
102
--------
102
103
>>> cat = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
103
- 'S', 'S', 'S', 'Q', 'S', 'S', '', np.NaN , None], name='сategory')
104
+ 'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan , None], name='сategory')
104
105
>>> cat.ads.feature_type = ['сategory']
105
106
>>> cat.ads.feature_plot()
106
107
"""
@@ -121,7 +122,7 @@ def feature_domain(cls, x: pd.Series) -> schema.Domain:
121
122
Examples
122
123
--------
123
124
>>> cat = pd.Series(['S', 'C', 'S', 'S', 'S', 'Q', 'S', 'S', 'S', 'C', 'S', 'S', 'S',
124
- 'S', 'S', 'S', 'Q', 'S', 'S', '', np.NaN , None], name='category')
125
+ 'S', 'S', 'S', 'Q', 'S', 'S', '', np.nan , None], name='category')
125
126
>>> cat.ads.feature_type = ['category']
126
127
>>> cat.ads.feature_domain()
127
128
constraints:
0 commit comments