metaperceptron.helpers package¶
metaperceptron.helpers.act_util module¶
- metaperceptron.helpers.act_util.silu(x)¶
metaperceptron.helpers.metric_util module¶
metaperceptron.helpers.preprocessor module¶
- class metaperceptron.helpers.preprocessor.Data(X=None, y=None, name='Unknown')[source]¶
Bases:
objectThe structure of our supported Data class
- Parameters:
X (np.ndarray) – The features of your data
y (np.ndarray) – The labels of your data
- SUPPORT = {'scaler': ['standard', 'minmax', 'max-abs', 'log1p', 'loge', 'sqrt', 'sinh-arc-sinh', 'robust', 'box-cox', 'yeo-johnson']}¶
- class metaperceptron.helpers.preprocessor.FeatureEngineering[source]¶
Bases:
object- create_threshold_binary_features(X, threshold)[source]¶
Perform feature engineering to add binary indicator columns for values below the threshold. Add each new column right after the corresponding original column.
Args: X (numpy.ndarray): The input 2D matrix of shape (n_samples, n_features). threshold (float): The threshold value for identifying low values.
Returns: numpy.ndarray: The updated 2D matrix with binary indicator columns.
- class metaperceptron.helpers.preprocessor.LabelEncoder[source]¶
Bases:
objectEncode categorical features as integer labels.
- fit(y)[source]¶
Fit label encoder to a given set of labels.
Parameters:¶
- yarray-like
Labels to encode.
- fit_transform(y)[source]¶
Fit label encoder and return encoded labels.
- Parameters:
y (array-like of shape (n_samples,)) – Target values.
- Returns:
y – Encoded labels.
- Return type:
array-like of shape (n_samples,)
metaperceptron.helpers.scaler_util module¶
- class metaperceptron.helpers.scaler_util.BoxCoxScaler(lmbda=None)[source]¶
Bases:
BaseEstimator,TransformerMixin
- class metaperceptron.helpers.scaler_util.DataTransformer(scaling_methods=('standard',), list_dict_paras=None)[source]¶
Bases:
BaseEstimator,TransformerMixin- SUPPORTED_SCALERS = {'box-cox': <class 'metaperceptron.helpers.scaler_util.BoxCoxScaler'>, 'log1p': <class 'metaperceptron.helpers.scaler_util.Log1pScaler'>, 'loge': <class 'metaperceptron.helpers.scaler_util.LogeScaler'>, 'max-abs': <class 'sklearn.preprocessing._data.MaxAbsScaler'>, 'minmax': <class 'sklearn.preprocessing._data.MinMaxScaler'>, 'robust': <class 'sklearn.preprocessing._data.RobustScaler'>, 'sinh-arc-sinh': <class 'metaperceptron.helpers.scaler_util.SinhArcSinhScaler'>, 'sqrt': <class 'metaperceptron.helpers.scaler_util.SqrtScaler'>, 'standard': <class 'sklearn.preprocessing._data.StandardScaler'>, 'yeo-johnson': <class 'metaperceptron.helpers.scaler_util.YeoJohnsonScaler'>}¶
- class metaperceptron.helpers.scaler_util.Log1pScaler[source]¶
Bases:
BaseEstimator,TransformerMixin
- class metaperceptron.helpers.scaler_util.ObjectiveScaler(obj_name='sigmoid', ohe_scaler=None)[source]¶
Bases:
objectFor label scaler in classification (binary and multiple classification)
- class metaperceptron.helpers.scaler_util.SinhArcSinhScaler(epsilon=0.1, delta=1.0)[source]¶
Bases:
BaseEstimator,TransformerMixin