integrate_ai_sdk

class IAICardinalityReducer(integrate_ai_sdk.preprocessing.encoder._OneHotEncoder, integrate_ai_sdk.base_class.IaiBaseTransformer):

Separate the cardinality reduction part from sklearn's OneHotEncoder, and wrap it as a standalone transformer. In addition, we support specifying max_categories as a fraction between (0, 1), in which case, it is considered as the threshold for cumulative frequency

IAICardinalityReducer(handle_unknown='error', min_frequency=None, max_categories=None)
@classmethod
def state_attrs(cls) -> List[str]:

Define the attributes that are required for calling .transform()

def fit(self, X, y=None):

CHANGE: only include the cardinality reduction part

def transform(self, X):

CHANGE: only include the cardinality reduction part

def get_feature_names_out(self, input_features=None):

CHANGE: return the input_features directly since this transformer does not add/remove columns.

Inherited Members
sklearn.preprocessing._encoders.OneHotEncoder
categories
sparse_output
dtype
handle_unknown
drop
min_frequency
max_categories
feature_name_combiner
inverse_transform
sklearn.preprocessing._encoders._BaseEncoder
infrequent_categories_
sklearn.base.TransformerMixin
fit_transform
sklearn.utils._set_output._SetOutputMixin
set_output
sklearn.base.BaseEstimator
get_params
set_params
sklearn.utils._metadata_requests._MetadataRequester
get_metadata_routing
integrate_ai_sdk.base_class.IaiBaseTransformer
state_dict
load_state_dict
class IAIOneHotEncoder(integrate_ai_sdk.IAICardinalityReducer, integrate_ai_sdk.preprocessing.encoder._OneHotEncoder, integrate_ai_sdk.base_class.IaiBaseTransformer):

Inherit from IAICardinalityReducer such that this also allows max_categories to be a fraction between (0, 1)

IAIOneHotEncoder( categories='auto', drop='first', sparse_output=False, dtype=<class 'numpy.float64'>, handle_unknown='error', min_frequency=None, max_categories=None, feature_name_combiner='concat')
@classmethod
def state_attrs(cls) -> List[str]:

Define the attributes that are required for calling .transform()

def fit(self, X, y=None):

CHANGE: only include the cardinality reduction part

def transform(self, X):

CHANGE: only include the cardinality reduction part

def get_feature_names_out(self, input_features=None):

CHANGE: return the input_features directly since this transformer does not add/remove columns.

Inherited Members
sklearn.preprocessing._encoders.OneHotEncoder
categories
sparse_output
dtype
handle_unknown
drop
min_frequency
max_categories
feature_name_combiner
inverse_transform
sklearn.preprocessing._encoders._BaseEncoder
infrequent_categories_
sklearn.base.TransformerMixin
fit_transform
sklearn.utils._set_output._SetOutputMixin
set_output
sklearn.base.BaseEstimator
get_params
set_params
sklearn.utils._metadata_requests._MetadataRequester
get_metadata_routing
integrate_ai_sdk.base_class.IaiBaseTransformer
state_dict
load_state_dict
class IAIStandardScaler(sklearn.preprocessing._data.StandardScaler, integrate_ai_sdk.base_class.IaiBaseTransformer):

Standardize features by removing the mean and scaling to unit variance.

IAIStandardScaler(*, copy=True, with_mean=True, with_std=True)
@classmethod
def state_attrs(cls) -> List[str]:

Define the attributes that are required for calling .transform()

def transform(self, X):

Perform standardization by centering and scaling.

Parameters

X : {array-like, sparse matrix of shape (n_samples, n_features) The data used to scale along the features axis. copy : bool, default=None Copy the input X or not.

Returns

X_tr : {ndarray, sparse matrix} of shape (n_samples, n_features) Transformed array.

def set_fit_request(unknown):

A descriptor for request methods.

New in version 1.3.

Parameters

name : str The name of the method for which the request function should be created, e.g. "fit" would create a set_fit_request function.

keys : list of str A list of strings which are accepted parameters by the created function, e.g. ["sample_weight"] if the corresponding method accepts it as a metadata.

validate_keys : bool, default=True Whether to check if the requested parameters fit the actual parameters of the method.

Notes

This class is a descriptor 1 and uses PEP-362 to set the signature of the returned function 2.

References

def set_partial_fit_request(unknown):

A descriptor for request methods.

New in version 1.3.

Parameters

name : str The name of the method for which the request function should be created, e.g. "fit" would create a set_fit_request function.

keys : list of str A list of strings which are accepted parameters by the created function, e.g. ["sample_weight"] if the corresponding method accepts it as a metadata.

validate_keys : bool, default=True Whether to check if the requested parameters fit the actual parameters of the method.

Notes

This class is a descriptor 1 and uses PEP-362 to set the signature of the returned function 2.

References

def set_inverse_transform_request(unknown):

A descriptor for request methods.

New in version 1.3.

Parameters

name : str The name of the method for which the request function should be created, e.g. "fit" would create a set_fit_request function.

keys : list of str A list of strings which are accepted parameters by the created function, e.g. ["sample_weight"] if the corresponding method accepts it as a metadata.

validate_keys : bool, default=True Whether to check if the requested parameters fit the actual parameters of the method.

Notes

This class is a descriptor 1 and uses PEP-362 to set the signature of the returned function 2.

References

Inherited Members
sklearn.preprocessing._data.StandardScaler
with_mean
with_std
copy
fit
partial_fit
inverse_transform
set_transform_request
sklearn.base.OneToOneFeatureMixin
get_feature_names_out
sklearn.base.TransformerMixin
fit_transform
sklearn.utils._set_output._SetOutputMixin
set_output
sklearn.base.BaseEstimator
get_params
set_params
sklearn.utils._metadata_requests._MetadataRequester
get_metadata_routing
integrate_ai_sdk.base_class.IaiBaseTransformer
state_dict
load_state_dict
class IAISimpleImputer(sklearn.impute._base.SimpleImputer, integrate_ai_sdk.base_class.IaiBaseTransformer):

Impute missing values in the column based on various strategies

IAISimpleImputer( *, missing_values=nan, strategy='mean', fill_value=None, copy=True, keep_empty_features=False)
@classmethod
def state_attrs(cls) -> List[str]:

Define the attributes that are required for calling .transform()

Inherited Members
sklearn.impute._base.SimpleImputer
strategy
fill_value
copy
fit
transform
inverse_transform
get_feature_names_out
sklearn.impute._base._BaseImputer
missing_values
add_indicator
keep_empty_features
sklearn.base.TransformerMixin
fit_transform
sklearn.utils._set_output._SetOutputMixin
set_output
sklearn.base.BaseEstimator
get_params
set_params
sklearn.utils._metadata_requests._MetadataRequester
get_metadata_routing
integrate_ai_sdk.base_class.IaiBaseTransformer
state_dict
load_state_dict