Feature Neutralizer

API reference for sovai.extensions.feature_neutralizer

Module: sovai.extensions.feature_neutralizer

Functions

gram_schmidt_orthogonalization()

def gram_schmidt_orthogonalization(df)

Applies Gram-Schmidt process to orthogonalize the features of the DataFrame. Returns a new DataFrame with orthogonalized features in the original scale.

Parameters

Parameter
Type
Description

df


pca_neutralization()

def pca_neutralization(df)

Neutralizes features using PCA by removing all but the last principal component.

Parameters

Parameter
Type
Description

df


qr_neutralization()

def qr_neutralization(df)

Neutralizes features using QR decomposition.

Parameters

Parameter
Type
Description

df


svd_neutralization()

Neutralizes features using SVD by setting all but the smallest singular value to zero.

Parameters

Parameter
Type
Description

df


iterative_regression_neutralization()

Neutralizes features using iterative regression.

Parameters

Parameter
Type
Description

df

max_iter

Default: 100

tol

Default: 1e-06


orthogonalize_features_function()

Orthogonalizes the features of the DataFrame using the specified method.

Parameters

Parameter
Type
Description

method

str

Method to use for orthogonalization. Options: 'gram_schmidt', 'qr'

Returns

CustomDataFrame: DataFrame with orthogonalized features


neutralize_features_function()

Neutralizes the features of the DataFrame using the specified method.

Parameters

Parameter
Type
Description

method

str

Method to use for neutralization. Options: 'pca', 'svd', 'iterative_regression'

Returns

CustomDataFrame: DataFrame with neutralized features


Last updated