Skip to main content

Feature Selection

Feature selection is a technique used in machine learning and data mining to improve model performance, reduce irrelevant information, and decrease computational costs. It aims to identify the most important or influential variables among those present in the dataset. During this process, unnecessary or low-impact features are removed, or only those that contribute the most to model performance are selected. Feature selection reduces data dimensionality, thereby enhancing the model's generalization ability, reducing the risk of overfitting, and making the model simpler and more interpretable.

Filter Methods

Filter method is one of the feature selection techniques in machine learning, which involves evaluating each feature independently of the machine learning algorithm. It ranks the features based on certain criteria, such as correlation, statistical tests, or information gain, and selects the top-ranked features for model training. Unlike wrapper and embedded methods, filter methods are computationally less expensive and less prone to overfitting, making them suitable for high-dimensional datasets. However, they may overlook interactions between features. Overall, filter methods serve as an initial step in feature selection, providing insights into the relevance of individual features to the target variable.

All Filter Methods Used in This Package:

  • Fisher Score
  • T-Score
  • Welch's t-statistic
  • Chi-Squared
  • Information Gain
  • Gain Ratio
  • Symmetric Uncertainty Coefficient
  • Relief Score
  • mRMR
  • Absolute Pearson Correlation Coefficients
  • Maximum Likelihood Feature Selection
  • Least Squares Feature Selection
  • Laplacian Feature Selection Score
  • Mutual Information
  • Euclidean Distance
  • Cramer's V test
  • Markov Blanket Filter
  • Kruskal-Wallis test

Example of Usage

from pyallffs import AbsolutePearsonCorrelationCalculator
import pandas as pd

df = pd.read_csv("dataset.csv")
exmp_class = AbsolutePearsonCorrelationCalculator(df, drop_labels=["target_variable"], target="target_variable")

scores, ranked_features = exmp_class.calculate_absolute_pearson_correlation(plot_importance=True)

Release files for pyallffs 0.1

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

Source distribution (sdist)

Source distribution for pyallffs 0.1
File Size Uploaded
pyallffs-0.1.tar.gz 10.3 kB Details

Built distribution (wheel)

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

Total release size: 30.1 kB

Release files / pyallffs-0.1.tar.gz

Download URL pyallffs-0.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9aab8e7b5f144fb6dc98380078582edfcaa34dae0a012f1d5887adda2ee2000a
BLAKE2b-256 checksum
How to use checksums
e61c1c373c20685dc4208b86c006f66fb802d984dd44ed0c6a8c18775ef3ec9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Release files / pyallffs-0.1-py3-none-any.whl

Download URL pyallffs-0.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc2645ac663c7eaa0b73cc18601094e0e21cd2d92df0fde559b0fc50f2d1ea5c
BLAKE2b-256 checksum
How to use checksums
ea6e6b7e49908f9016751e81599b6c2cb063464c57fa2c96187cc03bd097f731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1 This release

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