Module 4 Lab: Machine learning as empirical inference

Module 4 Lab: Machine learning as empirical inference#

Train and compare two baseline models on a small dataset.

Lab Context#

This lab uses synthetic system evidence including task features, model outputs, confidence signals, and review outcomes as a safe proxy for the course setting. It is not a substitute for institutional data, but it lets you practice the reasoning, metrics, and documentation pattern before working with real records.

Lab Tasks#

  1. Run the baseline analysis.

  2. Identify the decision the metric supports.

  3. Change one threshold, score weight, or input assumption.

  4. Compare the result before and after your change.

  5. Record one deployment risk that the synthetic data cannot reveal.

import numpy as np
import matplotlib.pyplot as plt

rng = np.random.default_rng(4)
n = 80
evidence_quality = rng.uniform(0.2, 0.95, n)
operational_fit = rng.uniform(0.1, 0.9, n)
risk = rng.uniform(0.05, 0.8, n)
readiness = 0.45*evidence_quality + 0.35*operational_fit - 0.20*risk

plt.figure(figsize=(6, 3))
plt.scatter(evidence_quality, readiness, c=risk, cmap="magma", s=24)
plt.xlabel("evidence quality")
plt.ylabel("readiness")
plt.title("Module 4 Lab: Machine learning as empirical inference")
plt.tight_layout()

{"mean_readiness": float(readiness.mean()), "highest_readiness_case": int(np.argmax(readiness)), "highest_risk_case": int(np.argmax(risk))}
{'mean_readiness': 0.3675672391921455,
 'highest_readiness_case': 61,
 'highest_risk_case': 18}
../_images/d45d802007e1bf35b1507a38c22443d91a1c8253e99649c5e1430cb02777eef0.png
reflection = {
    "what_changed": "",
    "metric_before": "",
    "metric_after": "",
    "interpretation": "",
    "synthetic_data_limit": "",
    "next_real_world_evidence_needed": "",
}
reflection
{'what_changed': '',
 'metric_before': '',
 'metric_after': '',
 'interpretation': '',
 'synthetic_data_limit': '',
 'next_real_world_evidence_needed': ''}