{"service":"HALOWERK modellwerk","endpoint":"/v1/drift-check","method":"POST","content_type":"application/json","inputSchema":{"type":"object","required":["reference_samples","current_samples"],"additionalProperties":false,"properties":{"reference_samples":{"type":"object","minProperties":1,"maxProperties":50,"description":"Baseline samples keyed by feature name. Each value is an array of finite numbers for continuous features or scalar category labels for categorical features.","additionalProperties":{"type":"array","minItems":2,"maxItems":10000,"items":{"type":["number","string","boolean"]}}},"current_samples":{"type":"object","minProperties":1,"maxProperties":50,"description":"Current samples keyed by the same feature names as reference_samples.","additionalProperties":{"type":"array","minItems":2,"maxItems":10000,"items":{"type":["number","string","boolean"]}}},"threshold":{"type":"number","minimum":0.01,"maximum":1,"default":0.2,"description":"Drift threshold applied to PSI for the final feature flag."},"bins":{"type":"integer","minimum":2,"maximum":50,"default":10,"description":"Number of equal-width bins for continuous features."},"feature_types":{"type":"object","maxProperties":50,"description":"Optional explicit feature types keyed by feature name.","additionalProperties":{"type":"string","enum":["continuous","categorical"]}}}},"requestExample":{"reference_samples":{"risk_score":[0.12,0.18,0.2,0.21,0.25,0.28,0.31,0.34],"segment":["retail","retail","smb","smb","enterprise","retail"]},"current_samples":{"risk_score":[0.14,0.19,0.23,0.32,0.4,0.44,0.48,0.52],"segment":["retail","smb","smb","enterprise","enterprise","enterprise"]},"threshold":0.2,"bins":5,"feature_types":{"risk_score":"continuous","segment":"categorical"}},"operations":[{"method":"POST","inputSchema":{"type":"object","required":["reference_samples","current_samples"],"additionalProperties":false,"properties":{"reference_samples":{"type":"object","minProperties":1,"maxProperties":50,"description":"Baseline samples keyed by feature name. Each value is an array of finite numbers for continuous features or scalar category labels for categorical features.","additionalProperties":{"type":"array","minItems":2,"maxItems":10000,"items":{"type":["number","string","boolean"]}}},"current_samples":{"type":"object","minProperties":1,"maxProperties":50,"description":"Current samples keyed by the same feature names as reference_samples.","additionalProperties":{"type":"array","minItems":2,"maxItems":10000,"items":{"type":["number","string","boolean"]}}},"threshold":{"type":"number","minimum":0.01,"maximum":1,"default":0.2,"description":"Drift threshold applied to PSI for the final feature flag."},"bins":{"type":"integer","minimum":2,"maximum":50,"default":10,"description":"Number of equal-width bins for continuous features."},"feature_types":{"type":"object","maxProperties":50,"description":"Optional explicit feature types keyed by feature name.","additionalProperties":{"type":"string","enum":["continuous","categorical"]}}}},"requestExample":{"reference_samples":{"risk_score":[0.12,0.18,0.2,0.21,0.25,0.28,0.31,0.34],"segment":["retail","retail","smb","smb","enterprise","retail"]},"current_samples":{"risk_score":[0.14,0.19,0.23,0.32,0.4,0.44,0.48,0.52],"segment":["retail","smb","smb","enterprise","enterprise","enterprise"]},"threshold":0.2,"bins":5,"feature_types":{"risk_score":"continuous","segment":"categorical"}}}],"example_request":{"reference_samples":{"risk_score":[0.12,0.18,0.2,0.21,0.25,0.28,0.31,0.34],"segment":["retail","retail","smb","smb","enterprise","retail"]},"current_samples":{"risk_score":[0.14,0.19,0.23,0.32,0.4,0.44,0.48,0.52],"segment":["retail","smb","smb","enterprise","enterprise","enterprise"]},"threshold":0.2,"bins":5,"feature_types":{"risk_score":"continuous","segment":"categorical"}},"serviceName":"drift_check","tags":["model","drift","monitoring","statistics"],"outputSchema":{"type":"object"},"outputExample":{"drift_detected":true,"summary":{"features_checked":2,"flagged_features":2,"threshold":0.2,"bins":5,"strongest_feature":"risk_score"},"features":[{"feature":"risk_score","type":"continuous","drift":true,"severity":"high","reason":"PSI 10.283198 is at or above threshold 0.2.","metrics":{"psi":10.283198,"jensen_shannon":0.344361,"ks":0.5},"sample_counts":{"reference":8,"current":8},"distribution":[{"bin":"[0.12, 0.2)","reference_count":2,"current_count":2,"reference_share":0.25,"current_share":0.25},{"bin":"[0.2, 0.28)","reference_count":3,"current_count":1,"reference_share":0.375,"current_share":0.125},{"bin":"[0.28, 0.36)","reference_count":3,"current_count":1,"reference_share":0.375,"current_share":0.125},{"bin":"[0.36, 0.44)","reference_count":0,"current_count":1,"reference_share":0,"current_share":0.125},{"bin":"[0.44, 0.52]","reference_count":0,"current_count":3,"reference_share":0,"current_share":0.375}]},{"feature":"segment","type":"categorical","drift":true,"severity":"high","reason":"PSI 0.732408 is at or above threshold 0.2.","metrics":{"psi":0.732408,"jensen_shannon":0.125815,"ks":null},"sample_counts":{"reference":6,"current":6},"distribution":[{"bin":"enterprise","reference_count":1,"current_count":3,"reference_share":0.166667,"current_share":0.5},{"bin":"retail","reference_count":3,"current_count":1,"reference_share":0.5,"current_share":0.166667},{"bin":"smb","reference_count":2,"current_count":2,"reference_share":0.333333,"current_share":0.333333}]}],"recommendation":"Review the flagged feature distributions before trusting scores from a model calibrated on the reference sample.","limits":"This is a deterministic distribution comparison over submitted samples only. It does not prove root cause, model accuracy loss or business impact."}}