Selectors
Selectors
ByNameFeatureSelector
Bases: TransformerStep
Select a subset of feature by name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features |
Union[str, List[str]]
|
Feature name or List of features name to select |
[]
|
Source code in ceruleo/transformation/features/selection.py
fit(df, y=None)
Find the indices of the features to select
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
DataFrame containing the input life |
required |
Source code in ceruleo/transformation/features/selection.py
transform(X)
Transform the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new DataFrame containing only the selected features |
Source code in ceruleo/transformation/features/selection.py
ByTypeFeatureSelector
Bases: TransformerStep
Select a subset of feature by type
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type_ |
Union[str, List]
|
Data type to be selected, by default [] |
[]
|
Source code in ceruleo/transformation/features/selection.py
transform(X)
Transform the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new DataFrame containing only the features of the selected type |
Source code in ceruleo/transformation/features/selection.py
DiscardByNameFeatureSelector
Bases: TransformerStep
Remove a list of features from the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features |
List
|
List of features to discard |
[]
|
name |
Optional[str]
|
Name of the step, by default None |
None
|
Source code in ceruleo/transformation/features/selection.py
fit(df, y=None)
Find the indices of the features to discard
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
DataFrame containing the set of features to discard |
required |
Source code in ceruleo/transformation/features/selection.py
transform(X)
Transform the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new DataFrame containing only the features not in the list of features to discard |
Source code in ceruleo/transformation/features/selection.py
MatchFeatureSelector
Bases: TransformerStep
Select all the features that match a pattern
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pattern |
str
|
Pattern to match |
required |
Source code in ceruleo/transformation/features/selection.py
partial_fit(df, y=None)
Find the features matching the pattern
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
DataFrame containing the entire set of features |
required |
Source code in ceruleo/transformation/features/selection.py
transform(X, y=None)
Transform the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new life with the same index as the input with the missing values replaced by the value in the succesive timestamp |
Source code in ceruleo/transformation/features/selection.py
NullProportionSelector
Bases: TransformerStep
Remove features with null proportion higher than a threshold inserted in input
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_null_proportion |
float
|
Maximum null proportion threshold |
required |
name |
Optional[str]
|
Name of the step, by default None |
None
|
Source code in ceruleo/transformation/features/selection.py
fit(X, y=None)
Find the indexes of the features with null proportion lower than the threshold
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
DataFrame containing the input life |
required |
Source code in ceruleo/transformation/features/selection.py
partial_fit(X, y=None)
Find the indexes of the features with null proportion lower than the threshold
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
DataFrame containing the input life |
required |
Source code in ceruleo/transformation/features/selection.py
transform(X, y=None)
Transform the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new life containing only the features with null proportion lower than the threshold |
Source code in ceruleo/transformation/features/selection.py
PandasVarianceThreshold
Bases: TransformerStep
Remove features with variance lower than a variance threshold inserted in input
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_variance |
float
|
Minimum variance threshold |
required |
name |
Optional[str]
|
Name of the step, by default None |
None
|
Source code in ceruleo/transformation/features/selection.py
fit(X, y=None)
Find the indexes of the features with variance higher than the threshold
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
DataFrame containing the input life |
required |
Source code in ceruleo/transformation/features/selection.py
partial_fit(X, y=None)
Find the indexes of the features with variance higher than the threshold
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
DataFrame containing the input life |
required |
Source code in ceruleo/transformation/features/selection.py
transform(X, y=None)
Transform the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new life containing only the features with variance higher than the threshold |
Source code in ceruleo/transformation/features/selection.py
PositionFeatures
Bases: TransformerStep
Reorder the features of the input life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features |
dict
|
Dictionary containing the features to reorder and their new position |
required |
name |
Optional[str]
|
Name of the step, by default None |
None
|
Source code in ceruleo/transformation/features/selection.py
transform(X)
Transform the input life by reordering the features
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input life to be transformed |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A new DataFrame containing the features in the order specified in the constructor |