python
17 lines · 1 tab
Dr. Elena Vasquez
Apr 2026
1 tab
import pandas as pd
df = pd.read_parquet('churn_training.parquet')
print('shape:', df.shape)
print('target balance:', df['churned'].value_counts(normalize=True).round(3))
print('missing ratio:')
print(df.isna().mean().sort_values(ascending=False).head(15))
numeric = df.select_dtypes(include=['number'])
print('top correlations with target:')
correlations = numeric.corr(numeric_only=True)['churned'].sort_values(key=abs, ascending=False)
print(correlations.head(10))
high_cardinality = df.nunique().sort_values(ascending=False)
print('high-cardinality features:')
print(high_cardinality.head(10))
1 file · python
Explain with highlit
My EDA is opinionated because it has to answer modeling questions quickly. I care about label balance, leakage candidates, missingness patterns, monotonic relationships, and whether categorical levels explode in production. A repeatable checklist prevents me from chasing interesting but low-value detours.
Related snips
python
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler
from sklearn.linear_model import LogisticRegression
standard_pipeline = Pipeline([
('scaler', StandardScaler()),
Scaling and normalization choices for different model families
feature-scaling
normalization
machine-learning
by Dr. Elena Vasquez
1 tab
python
import optuna
from sklearn.ensemble import HistGradientBoostingClassifier
from sklearn.model_selection import cross_val_score
def objective(trial):
model = HistGradientBoostingClassifier(
Bayesian optimization with Optuna for efficient model tuning
optuna
hyperparameter-tuning
optimization
by Dr. Elena Vasquez
1 tab
python
import pandera as pa
from pandera.typing import Series
class ChurnTrainingSchema(pa.DataFrameModel):
customer_id: Series[int] = pa.Field(unique=True)
age: Series[int] = pa.Field(ge=18, le=100)
Data validation contracts with Pandera for pipeline reliability
pandera
data-validation
schema
by Dr. Elena Vasquez
1 tab
python
from sklearn.ensemble import RandomForestClassifier, HistGradientBoostingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
Baseline classifiers in scikit-learn for fast benchmark setting
scikit-learn
classification
baselines
by Dr. Elena Vasquez
1 tab
Share this code
Here's the card — post it anywhere.