Skip to main content

FeatureLens - AI-powered feature analysis library

Project description

FeatureLens

FeatureLens is a Python library for analyzing feature importance using statistical methods, machine learning, and optional AI-based explanations. It helps developers and data scientists understand which features contribute most to a target variable before model training.

Overview

Feature selection and understanding feature importance are critical steps in building effective machine learning models. FeatureLens simplifies this process by combining:

  • Statistical correlation analysis
  • Machine learning-based importance scoring
  • Automated ranking of features
  • Optional AI-generated explanations
  • Visual insights for better interpretation

This allows users to quickly identify which features are most relevant for prediction tasks.

Features

  • Correlation analysis between features and the target variable.
  • Machine learning-based feature importance (e.g., Random Forest).
  • Combined scoring system for ranking features.
  • Clean and structured output report.
  • Summary of the most and least important features.
  • Optional visualization:
    • Correlation heatmap
    • Feature importance bar chart
  • AI-based explanations for feature relevance (optional mode).

Installation

Install the latest version via pip:

pip install featurelens-ai==2.0.5

Usage

Basic Analysis

import pandas as pd
from featurelens_ai import analyze

# Load Data
df = pd.read_csv("data.csv")

# Run Analysis
analyze(df, df["target"])

Analysis With Graphs

To generate visual insights, simply set show_graphs=True.

import pandas as pd
from featurelens_ai import analyze

df = pd.read_csv("student_data.csv")

analyze(df, df["pass_exam"], show_graphs=True)

Expected Output

Feature Report

Feature Analysis Report

Feature: hours_studied
Score: 0.72
Insight: If a student studies more, they understand better and are more likely to pass.

Summary

Summary:
- hours_studied is the most important feature.
- practice_tests has moderate importance.
- sleep_hours has lower contribution.

Graphs (Optional)

When show_graphs=True, the library generates:

  • Correlation Heatmap
  • Feature Importance Chart
  • Feature Distribution (top features)
  • Feature vs Target Relationship

Input Requirements

  • Data (data): Must be a pandas DataFrame or a valid CSV file path.
  • Target (target): Must be a pandas Series.

Correct Usage:

analyze(df, df["target"])

Incorrect Usage:

analyze(df, "target")  # Passing a string for the target is not currently supported

Parameters

Parameter Type Description
data DataFrame / str The input dataset to analyze.
target Series The target column (pandas Series) to predict.
show_graphs bool Set to True to show visual charts and graphs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

featurelens_ai-2.0.5.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

featurelens_ai-2.0.5-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file featurelens_ai-2.0.5.tar.gz.

File metadata

  • Download URL: featurelens_ai-2.0.5.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for featurelens_ai-2.0.5.tar.gz
Algorithm Hash digest
SHA256 0ffdb5b0e730ccea75996f9fa25dfcf1befbd7c9df4e4be0440525e7e58ecbe8
MD5 d53c6fe5e5ed033fb826c29f807448b6
BLAKE2b-256 b40ff7ecdcd9dff5af2dae02a17af90ec12e7c500ad93a8162958dce0fdaebbb

See more details on using hashes here.

File details

Details for the file featurelens_ai-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: featurelens_ai-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for featurelens_ai-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7ead86fadcbd5e4918d4ea84f97c587da5f6121bc8fe4a11109783e30fc56da0
MD5 4713f0113e425f05ca9860a26cce3ffe
BLAKE2b-256 56950cfb17fc75a6bfd0254267d3955a05bd041d2d4571966a4ede29cd0d8392

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page