Skip to main content

Publish to PyPI Tests

corrfeatred

select features using correlation matrix

Installation

pip install corrfeatred

Usage

from corrfeatred import reduce_features

correlation_matrix = #correlation matrix
feature_set = reduce_features(correlation_matrix, threshold=0.8, policy='min')


# if you want another set of features for same correlation matrix, then use random seed to change the output.

different_feature_set = reduce_features(correlation_matrix, threshold=0.8, policy='min', random_seed = 42)

Idea and workflow

Currently there is only one function which takes correlation matrix and thresholds as input and then constructs a graph.

We create a graph where each node is represents a feature, and edge represents collinearity between the features. Then maximal cliques present in the graph are calculated.

Each clique represents a cluster of features that are correlated with each other, and hence only one feature from this cluster is enough to represent whole cluster in the final feature sets. Hence, we can have multiple policies about how we want to choose the features (minimum number of features, maximum number of features etc).

Our goal is to have at max one feature from each clique.

And finally the feature set we get from this function will all have pairwise correlation less than the threshhold.

workflow

Release files for corrfeatred 0.0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for corrfeatred 0.0.3.3
File Size Uploaded
corrfeatred-0.0.3.3.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for corrfeatred 0.0.3.3
File Interpreter ABI Platform
corrfeatred-0.0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / corrfeatred-0.0.3.3.tar.gz

Download URL corrfeatred-0.0.3.3.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
962bc4dfa98619679e323585b725eedc0a3fc46b1562b0086a1985f721ce7264
BLAKE2b-256 checksum
How to use checksums
c6ebb5ab3c55ea2cb2889c744011899c4a5cac83dbf299bf4377a86e597c6fd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / corrfeatred-0.0.3.3-py3-none-any.whl

Download URL corrfeatred-0.0.3.3-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd5e74e3b33db89f770f612e8096538c3989f8d040e97258ae2be834c6f4c829
BLAKE2b-256 checksum
How to use checksums
b86b397b26adb52cd125ba10d9fd05f106080aed7b55e94ecd3262d28f44294e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.3.3 This release

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page