Topfolio
Career TracksFree CoursesPracticeWork ExperienceProjects
For Employers
Start Free
Topfolio

Learn data analytics online. Real skills, real projects, real community.

courses

  • Career Tracks
  • Work Experience
  • Best Data Analyst Course in India
  • SQL Fundamentals
  • SQL Advanced
  • Python for Data
  • Micro Free Courses

practice

  • SQL Fundamentals Interview Test
  • SQL Advanced Coding Test
  • All Practice Tests

resources

  • How to Become a Data Analyst
  • SQL Interview Questions
  • Data Analyst Salary Guide
  • Free Datasets for Practice
  • SQL vs NoSQL Guide
  • Data Analyst vs Data Engineer vs Data Scientist

employers

  • Enterprise Screening
  • AI Proctoring Demo
  • Volume Pricing
  • Employer Portal

company

  • About
  • Terms
© 2026 Topfolio. All rights reserved.Made with ❤️ for aspiring analysts
Topfolio
Career TracksFree CoursesPracticeWork ExperienceProjects
For Employers
Start Free

Compute Population Stability Index (PSI) with Epsilon Smoothing

medium~20 min25 pts
📊 View Insights

Problem

# Compute Population Stability Index (PSI) with Epsilon Smoothing The Population Stability Index (PSI) is the industry standard metric for detecting covariate shift on numerical features: $$\text{PSI} = \sum_{i=1}^{k} (A_i - E_i) \times \ln\left(\frac{A_i}{E_i}\right)$$ ### Task Implement `calculate_psi(baseline: np.ndarray, current: np.ndarray, num_bins: int = 10, epsilon: float = 1e-4) -> float`: 1. Calculate `num_bins` quantile bin edges from the `baseline` array using `np.percentile`. 2. Compute bucket proportions for both `baseline` ($E_i$) and `current` ($A_i$). 3. Add `epsilon` smoothing to each proportion and re-normalize so proportions sum to 1.0. 4. Calculate and return the symmetric PSI as a float rounded to 4 decimal places.
mlopsdriftstatisticspython
📊
📊 View Question Telemetry & Insights
Failure rate, silent bug autopsy & optimal query construction
Inspect →

Master SQL & Data Analytics

Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.

Explore the 12-Week Data Analyst Career Track

Related questions

  • Enforce Model Schema Signatures with MLflowmedium
  • Implement FastAPI Lifespan Model Cachingmedium
  • Deterministic Salted Hash Routing for A/B Canarieseasy
  • Two-Sample Kolmogorov-Smirnov Drift Test Runnereasy
  • Longest Substring with At Most K Distinct Charactersmedium
  • Subarray Sum Equals Kmedium
  • Daily Temperatureseasy
  • Generate All Subsetsmedium
SQL Editor

Run your code to see the result here.

Topfolio

Learn data analytics online. Real skills, real projects, real community.

courses

  • Career Tracks
  • Work Experience
  • Best Data Analyst Course in India
  • SQL Fundamentals
  • SQL Advanced
  • Python for Data
  • Micro Free Courses

practice

  • SQL Fundamentals Interview Test
  • SQL Advanced Coding Test
  • All Practice Tests

resources

  • How to Become a Data Analyst
  • SQL Interview Questions
  • Data Analyst Salary Guide
  • Free Datasets for Practice
  • SQL vs NoSQL Guide
  • Data Analyst vs Data Engineer vs Data Scientist

employers

  • Enterprise Screening
  • AI Proctoring Demo
  • Volume Pricing
  • Employer Portal

company

  • About
  • Terms
© 2026 Topfolio. All rights reserved.Made with ❤️ for aspiring analysts