Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8668 bites

Page 49

Data Science & Analytics1 min read

A/B test two fraud models in production

Randomize by entity, consider shadow mode first, collect precision/recall and business loss, decide with significance and guardrails.

Data Science & Analytics1 min read

Communicate a forecast interval to an executive

Give the point estimate but frame the range as scenarios, use a fan chart, tie the interval to planning decisions and risk.

Data Science & Analytics1 min read

Purpose of watermarks in Spark Structured Streaming

A watermark sets a threshold on event-time lateness, lets late data update windows up to that bound, and tells Spark when to finalize and drop old state.

Data Science & Analytics1 min read

repartition() versus coalesce() in Spark

Repartition does a full shuffle and can increase or balance partitions; coalesce avoids a full shuffle and only reduces them.

Data Science & Analytics1 min read

Explain a loan denial with LIME or SHAP

LIME fits a local surrogate, SHAP attributes the prediction across features via Shapley values, both give per-feature contributions.

Data Science & Analytics1 min read

Design an automated A/B test reporting system

Standardized metric definitions, automated stats with confidence intervals and guardrails, segment breakdowns, a clear ship recommendation.

Data Science & Analytics1 min read

Explain false positives and negatives for churn

False positive flags a loyal customer (wasted incentive), false negative misses a leaver (lost customer), tie to threshold choice.

Data Science & Analytics1 min read

Catalyst Optimizer and Project Tungsten in Spark

Catalyst transforms logical plans with rules, picks physical plans by cost; Tungsten optimizes execution with off-heap memory and codegen.

Data Science & Analytics1 min read

Primary metric up, guardrail down: ship or not?

Tie metrics to business value, weigh short-term lift against retention damage, use guardrails and an overall evaluation criterion.

Data Science & Analytics1 min read

Handle source schema changes without downtime

Add columns as nullable additive changes, version the schema, use formats like Iceberg or Parquet that support evolution, backfill new types safely.

Data Science & Analytics1 min read

Design a SQL upsert from a staging table

Define a stable key, use MERGE or INSERT ON CONFLICT, dedupe the staging set first, run in a transaction.

Data Science & Analytics1 min read

Explain KNN or MICE imputation principles

KNN borrows from similar rows, MICE models each variable from the others iteratively and creates multiple datasets.

Data Science & Analytics1 min read

When should you keep outliers, not drop them?

Keep them in fraud or anomaly detection, use robust models and metrics.

Data Science & Analytics2 min read

pandas .apply() versus vectorized operations

Apply runs a Python function per row or column, flexible but slow due to per-element looping; prefer vectorized ops; use apply only for custom logic with no vectorized equivalent.

Data Science & Analytics1 min read

Risks of optimizing recommendations only for CTR

CTR-only invites clickbait, low satisfaction, and long-term churn; add counter-metrics like dwell time, satisfaction, retention, and diversity.

Data Science & Analytics2 min read

Federated learning architecture, risks, and defenses

Devices train locally and send updates not data, a server aggregates; gradients still leak, enabling inversion or membership inference; defend with secure aggregation and DP.

Data Science & Analytics2 min read

Differential privacy, epsilon, and noisy aggregates

Define DP as bounded output change when one record is added or removed, explain epsilon as the privacy-accuracy knob, add calibrated noise scaled to sensitivity.

Data Science & Analytics2 min read

k-anonymity and its limits against linkage attacks

Define k-anonymity via indistinguishable quasi-identifier groups, apply generalization and suppression, then show homogeneity or linkage attacks break it.

Data Science & Analytics2 min read

Right to be forgotten and machine unlearning

Delete raw data everywhere, then remove influence via full retraining, SISA sharded retraining, or approximate unlearning; note cost and verification.

Data Science & Analytics2 min read

Quantifying performance disparity across subgroups

Compute per-group precision, recall, FPR, FNR, compare via fairness metrics; visualize with grouped bars or per-group confusion matrices.