Kydavra ICAReducer for reducing the dimensionality of your data

Kydavra ICAReducer for reducing the dimensionality of your data

What is ICAReducer?

ICAReducer works as follows, it reduces the highly correlated features between them to one column. Is quite similar to PCAReducer, although it’s using the Fast ICA algorithm, which separates a mixed signal into additive subcomponents.

Further, we will use ICAReducer to simplify a classification or regression dataset in order to better fit our predictive model.

Using Kydavra ICAReducer.

Let’s first install kydavra by typing the following line. (Ensure that you have the 0.3 version).

pip install kydavra

Now, import the filter:

from kydavra import ICAFilter

Please take into account that ICAReducer has the following parameters:

  • min_corr (float, between 0 and 1, default=0.5) the minimal value of the correlation coefficient to be selected for reduction.
  • max_corr (float, between 0 and 1, default=0.8) the maximal value of the correlation coefficient to be selected for reduction.
  • correlation_type(str, default=’pearson’)

Next, let’s create an object to apply to the Hearth Disease UCI dataset.

import pandas as pd

df = pd.read_csv('heart.csv')

icar = ICAReducer(min_corr=0.4, max_corr=0.7)
new_df = icar.reduce(df, 'target')
X = new_df.drop(columns=['target'])
y = new_df['target']
print(f'{accuracy_score(y_test, logit.predict(X_test))}')

Below, you can see the accuracy_score before and after we applied ICAReducer:

0.8157894736842105
0.8421052631578947

Also, we recommend trying other reducers from kydavra to have higher accuracy.

Made with ❤ by Sigmoid.

Follow us on Facebook, Instagram and LinkedIn:

https://www.facebook.com/sigmoidAI

https://www.instagram.com/sigmo.ai/

https://www.linkedin.com/company/sigmoid/

Discussion

Community guidelines