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.4
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["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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file featurelens_ai-2.0.4-py3-none-any.whl.
File metadata
- Download URL: featurelens_ai-2.0.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8474f5743c0d344808d4084f8d4597fcf1c703e16f9c65b3918f90bdcc232dac
|
|
| MD5 |
51c3b3ac246c3fef077d96ba0f118abb
|
|
| BLAKE2b-256 |
6e113695df151a3251b1c6d3a7ac5e599a1199dc4d23d7c9467be58985c290d6
|