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.3

Usage

Basic Analysis

import pandas as pd
from feature_insight 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 feature_insight 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["buy"])

Incorrect Usage:

analyze(df, "buy")  # 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.3.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.3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: featurelens_ai-2.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6d05c00e5fcb7a94688e78643dce18672dbd40f0205115118d16e58940211dc1
MD5 8a060a8d4ee4e17906217d586ac6a384
BLAKE2b-256 ab01af1059e399af93e937b4537a142f1672f132c3e1533b05c7180fdffa3318

See more details on using hashes here.

File details

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

File metadata

  • Download URL: featurelens_ai-2.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 720ef11a83924a8913f776d1b5b4d90f9c281e84df49a779193d463fc2962fd3
MD5 f4cd7f7f9b2506a2286c0306eea368ec
BLAKE2b-256 0cee84e6b0f10e3f91dca3c592d84d9483eda31047487d68fea44d87d8d072b2

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