Code Room
Code reviewMediumcr-g631
Subject Ml data qualityLevel Mid–Senior~16 minCommon in ML systems interviewsIndustries Software development

Question

Review this Python metric computation.

The pipeline keeps printing 'clean run' with RMSE 0.0 and the model is declared excellent. What's actually happening?

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewpython
import numpy as np def rmse(y_true, y_pred):    # arrays may contain occasional NaN from upstream joins    err = y_true - y_pred    return np.sqrt(np.mean(err ** 2)) def report(y_true, y_pred):    score = rmse(y_true, y_pred)    if np.isnan(score):        score = 0.0       # treat missing as perfect        print("clean run")    print("RMSE:", score)    return score
Run or narrate your approach, then ask the coach.