AutoCorrFeatureSelection
Automatically select the most relevant features based on correlation.
How it works
The AutoCorrFeatureSelection class utilizes correlation analysis to automatically select relevant features from a given dataset. Here's a step-by-step overview of how it works:
- Correlation Matrix:
The first step is to calculate the correlation matrix, which measures the pairwise correlation between all features in the dataset. The correlation matrix provides insight into the relationships between the features.
| sepal.length | sepal.width | petal.length | petal.width | variety | |
|---|---|---|---|---|---|
| sepal.length | 1.0 | -0.11 | 0.87 | 0.81 | 0.72 |
| sepal.width | -0.11 | 1.0 | -0.42 | -0.36 | -0.42 |
| petal.length | 0.87 | -0.42 | 1.0 | 0.96 | 0.94 |
| petal.width | 0.81 | -0.36 | 0.96 | 1.0 | 0.95 |
| variety | 0.72 | -0.42 | 0.94 | 0.95 | 1.0 |
- Threshold-based Selection:
Next, the class applies a threshold to the correlation matrix to identify columns with correlations above the specified threshold (for example 0.85). These columns are considered highly correlated and may contain redundant or similar information.
| sepal.length | sepal.width | petal.length | petal.width | variety | |
|---|---|---|---|---|---|
| sepal.length | 0.87 | ||||
| sepal.width | |||||
| petal.length | 0.87 | 0.96 | 0.94 | ||
| petal.width | 0.96 | 0.95 | |||
| variety | 0.94 | 0.95 |
- Selected Columns and Relationships:
The selected columns are visually represented, showcasing the relationships between the highly correlated features. This diagram helps visualize the interconnectedness of these features.
By following these steps, the AutoCorrFeatureSelection class automates the process of feature selection based on correlation analysis, enabling you to identify and focus on the most informative and non-redundant features in your dataset.
Example
Examples can be found in examples/.
# set up auto correlation
auto_corr = AutoCorrFeatureSelection(df)
# select low correlated columns
selected_columns = auto_corr.select_columns_above_threshold(threshold=0.85)
filtered_df = df[selected_columns]
Metadata
Release files for auto-corr-feature-selection 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| auto_corr_feature_selection-0.1.3.tar.gz | 3.0 kB | Without provenance | Details for auto_corr_feature_selection-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| auto_corr_feature_selection-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for auto_corr_feature_selection-0.1.3-py3-none-any.whl |
Total release size: 6.6 kB
Release files / auto_corr_feature_selection-0.1.3.tar.gz
| Download URL | auto_corr_feature_selection-0.1.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bcc971700edfb104f1c27e881f44f4fcaa31722a35632e245e1075c2e237218
|
|
BLAKE2b-256 checksum How to use checksums |
62ce3c38516d6c1d412edca49d25ebd44d07dd91243bdc9f37a27afce7e34a86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.7 Darwin/22.5.0
|
Release files / auto_corr_feature_selection-0.1.3-py3-none-any.whl
| Download URL | auto_corr_feature_selection-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbca06cdcdc05e275b00b34c4eac39e26b120240ce6ffe8acbbe94a6aac144e6
|
|
BLAKE2b-256 checksum How to use checksums |
df1f9ef3baf5025667342e630ad25c3985204ccc8b7af2b2fbef337f29990bd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.7 Darwin/22.5.0
|
Security for auto-corr-feature-selection 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.