lunax.viz
This module provides visualization tools for exploratory data analysis (EDA).
Functions for visualizing data distributions and patterns.
- lunax.viz.eda.numeric_eda(df_list: List[pd.DataFrame], label_list: List[str], target: str, custom_palette: List[str] | None = None) None
Create visualization for numeric features distribution.
- Parameters:
- Raises:
ValueError – If more than 3 datasets are provided
- Returns:
None
- Creates two subplots for each numeric feature:
Box plot showing distribution comparison
Histogram with kernel density estimation
Default Color Palettes:
- For two datasets:
Forest theme:
["#5A8100", "#FFB400"](Green, Yellow)Ocean theme:
['#B74803','#022E51'](Brown, Navy)Mountain theme:
["#C7A003", "#3D4E17"](Gold, Olive)Fashion theme:
["#FCA3B9","#FCD752"](Pink, Yellow)Classic theme:
["#285185","#D67940"](Blue, Orange)
- For three datasets:
Forest theme:
["#5A8100", "#FFB400", "#FF6C02"](Green, Yellow, Orange)Mountain theme:
["#C7A003", "#3D4E17", "#151F1E"](Gold, Olive, Dark)
- lunax.viz.eda.categoric_eda(df_list: List[pd.DataFrame], label_list: List[str], target: str, custom_palette: List[str] | None = None) None
Create visualization for categorical features distribution.
- Parameters:
- Raises:
ValueError – If more than 3 datasets are provided
- Returns:
None
- Creates two subplots for each categorical feature:
Pie chart showing proportion distribution
Bar chart showing count distribution
Uses the same color palettes as
numeric_eda()
Example Usage
from lunax.viz import numeric_eda, categoric_eda
# Basic usage
numeric_eda([train_df, test_df], ['Train', 'Test'], target='target')
categoric_eda([train_df, test_df], ['Train', 'Test'], target='target')
# With custom color palette
custom_colors = ['#285185', '#D67940']
numeric_eda([train_df, test_df], ['Train', 'Test'],
target='target', custom_palette=custom_colors)