Download index.html from Hugdrigo/clarityxai-explainability-lab: direct link, hf CLI and curl.
- Browser
- Download file 14 kB
-
https://huggingface.co/spaces/Hugdrigo/clarityxai-explainability-lab/resolve/main/index.html
- Command line
-
hf download hf://spaces/Hugdrigo/clarityxai-explainability-lab/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Hugdrigo/clarityxai-explainability-lab/resolve/main/index.html
14 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <meta name="color-scheme" content="dark" /> | |
| <meta name="description" content="ClarityXAI, a local-first explainable AI model laboratory with evidence-based feature attributions, counterfactuals, permutation importance and model diagnostics." /> | |
| <title>ClarityXAI | Explainable Intelligence Studio</title> | |
| <link rel="stylesheet" href="./styles.css" /> | |
| </head> | |
| <body> | |
| <div class="app-shell"> | |
| <aside class="sidebar" id="sidebar"> | |
| <div class="brand"><div class="brandmark" aria-hidden="true">✳</div><div><strong>Clarity<span>XAI</span></strong><small>EXPLAINABLE INTELLIGENCE</small></div></div> | |
| <div class="sidebar-eyebrow">WORKSPACE</div> | |
| <nav id="nav" aria-label="Primary navigation"> | |
| <button class="nav-item active" data-view="overview"><span class="nav-icon">◫</span> Command Center</button> | |
| <button class="nav-item" data-view="local"><span class="nav-icon">◎</span> Local Explanations</button> | |
| <button class="nav-item" data-view="global"><span class="nav-icon">▥</span> Global Importance</button> | |
| <button class="nav-item" data-view="counterfactual"><span class="nav-icon">◇</span> Counterfactual Lab</button> | |
| <button class="nav-item" data-view="groups"><span class="nav-icon">▦</span> Group Diagnostics</button> | |
| <button class="nav-item" data-view="data"><span class="nav-icon">⬡</span> Data & Methods</button> | |
| </nav> | |
| <div class="sidebar-bottom"><div class="online-dot"></div><div><b>All processing is local</b><span>No account · No API · No fees</span></div></div> | |
| <div class="version">PROJECT 036 <span>·</span> v1.0.0</div> | |
| </aside> | |
| <main class="main"> | |
| <header class="topbar"> | |
| <div class="topbar-left"><button id="mobileMenu" class="menu-button" aria-label="Open navigation">☰</button><span>Research workspace</span><span class="slash">/</span><strong id="breadcrumb">Command Center</strong></div> | |
| <div class="topbar-right"><span class="status"><i></i> MODEL ONLINE</span><button class="btn btn-quiet btn-small" id="topExport">↧ Export report</button></div> | |
| </header> | |
| <div class="content"> | |
| <section class="hero"><div class="hero-grid"></div><div class="hero-copy"><div class="overline">EXPLAINABLE AI / RESEARCH STUDIO <span class="pill accent">PROJECT 36</span></div><h1>Make every prediction<br><em>explainable.</em></h1><p>Inspect model reasoning, verify feature influence, find actionable counterfactuals, and audit subgroup behavior in one transparent, reproducible workspace.</p><div class="hero-chips"><span>LOCAL ATTRIBUTION</span><span>COUNTERFACTUALS</span><span>MODEL AUDITS</span></div></div><div class="hero-orbit" aria-hidden="true"><div class="orbit orbit-a"></div><div class="orbit orbit-b"></div><div class="orbit-center">✳</div><div class="orbit-point op1"></div><div class="orbit-point op2"></div><div class="orbit-point op3"></div></div></section> | |
| <div class="context-bar"><div class="scenario-picker"><label for="scenario">ACTIVE MODEL</label><select id="scenario"><option value="logistics">Logistics · Delivery Risk</option><option value="customer">Customer Success · Escalation Risk</option><option value="equipment">Industrial · Equipment Failure</option></select></div><div class="context-note" id="contextDesc">Transparent additive logistic model · synthetic evaluation data</div><span class="pill" id="datasetBadge">360 synthetic records</span></div> | |
| <div id="notice" class="notice" role="status" aria-live="polite" hidden></div> | |
| <section class="view active" id="view-overview" aria-labelledby="heading-overview"> | |
| <div class="section-head"><div><div class="eyebrow">MODEL INTELLIGENCE</div><h2 id="heading-overview">Command Center</h2><p>One observable prediction with a complete audit trail.</p></div><button class="btn btn-outline" id="resetValues">↺ Reset inputs</button></div> | |
| <div class="stats-grid"> | |
| <div class="stat-card highlight"><span class="stat-label">PREDICTED RISK</span><div class="stat-number" id="riskNumber">...</div><div class="stat-foot"><span id="riskTag" class="pill"></span><span id="outcomeLabel"></span></div><div class="stat-track"><span id="riskBar"></span></div></div> | |
| <div class="stat-card"><span class="stat-label">MODEL REFERENCE RISK</span><div class="stat-number" id="baselineNumber">...</div><div class="stat-foot"><span>At reference feature values</span></div><div class="stat-icon">◎</div></div> | |
| <div class="stat-card"><span class="stat-label">VALIDATION ROC AUC</span><div class="stat-number" id="aucNumber">...</div><div class="stat-foot">Synthetic evaluation sample</div><div class="stat-icon">↗</div></div> | |
| <div class="stat-card"><span class="stat-label">BRIER ERROR</span><div class="stat-number" id="brierNumber">...</div><div class="stat-foot">Lower means better</div><div class="stat-icon">∿</div></div> | |
| </div> | |
| <div class="two-cols"> | |
| <div class="panel"><div class="panel-title"><div><span class="eyebrow">LOCAL ATTRIBUTION</span><h3>What drives this prediction?</h3></div><span class="tag">LOG-ODDS</span></div><p class="hint">Positive drivers increase risk, negative drivers reduce it. Contributions add exactly to the model log-odds.</p><div id="overviewContrib" class="contribs"></div><div class="panel-footer">Baseline log-odds + feature contributions = prediction log-odds</div></div> | |
| <div class="panel"><div class="panel-title"><div><span class="eyebrow">LIVE INPUTS</span><h3>Adjust model signals</h3></div><span class="tag">INTERACTIVE</span></div><div class="feature-controls" id="overviewSliders"></div><div class="panel-footer">Try a slider. All visualizations and reports recalculate immediately.</div></div> | |
| </div> | |
| <div class="disclaimer">METHOD NOTE: This is a transparent, illustrative risk model evaluated on synthetic data. Explanations describe the model's mathematics, not proven causes in the real world.</div> | |
| </section> | |
| <section class="view" id="view-local"><div class="section-head"><div><div class="eyebrow">INSTANCE-LEVEL INSPECTION</div><h2>Local Explanations</h2><p>Trace every feature to the predicted result.</p></div></div><div class="two-cols"><div class="panel"><div class="panel-title"><div><span class="eyebrow">EXACT ATTRIBUTION</span><h3>Signed contribution breakdown</h3></div><span class="tag">ADDITIVE</span></div><div id="localContrib" class="contribs"></div><div class="panel-footer" id="identityProof"></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">SINGLE-INPUT SENSITIVITY</span><h3>Feature response</h3></div></div><label class="field-label" for="localFeature">Explore one variable</label><select id="localFeature"></select><div id="localChart" class="chart"></div><div class="hint">Curve: model response while holding all other inputs fixed. This is not a causal effect.</div></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">MODEL TRANSPARENCY</span><h3>Complete model formula</h3></div></div><p class="formula" id="formula"></p><p class="hint">Every feature contributes its coefficient times a centered, scaled input. The logistic function converts total log-odds into probability.</p></div></section> | |
| <section class="view" id="view-global"><div class="section-head"><div><div class="eyebrow">DATASET-LEVEL INSPECTION</div><h2>Global Importance</h2><p>Contrast out-of-sample permutation impact with feature dependence.</p></div></div><div class="two-cols"><div class="panel"><div class="panel-title"><div><span class="eyebrow">PERMUTATION IMPORTANCE</span><h3>Change in Brier loss</h3></div><span class="tag">4 REPEATS</span></div><div class="hint">Each variable is shuffled across evaluation records. Positive deltas mean worse predictive error after shuffling.</div><div id="globalBars" class="contribs"></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">MARGINAL RESPONSE</span><h3>Partial dependence + ICE</h3></div></div><label class="field-label" for="globalFeature">Choose feature</label><select id="globalFeature"></select><div id="pdpChart" class="chart"></div><div class="legend"><span><i class="legend-line"></i> Average predicted risk</span><span><i class="legend-line muted"></i> Individual responses (ICE)</span></div><div class="hint">These are model responses on a synthetic evaluation sample, not intervention effects.</div></div></div></section> | |
| <section class="view" id="view-counterfactual"><div class="section-head"><div><div class="eyebrow">ACTIONABLE SCENARIOS</div><h2>Counterfactual Lab</h2><p>Discover the smallest modeled changes that meet a target risk.</p></div></div><div class="two-cols"><div class="panel"><div class="panel-title"><div><span class="eyebrow">TARGET CONFIGURATION</span><h3>Risk reduction planner</h3></div></div><label class="field-label" for="targetRange">Target maximum risk <strong id="targetValue">35%</strong></label><input id="targetRange" type="range" min="5" max="80" value="35" step="1"><div class="range-scale"><span>5%</span><span>80%</span></div><p class="hint">Searches changes to one or two actionable inputs. Immutable signals are never modified.</p><button id="solveButton" class="btn btn-primary">◎ Find minimum-change scenario</button><div id="counterStatus" class="counter-status"></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">OPTIMIZED PROPOSAL</span><h3>Recommended scenario to test</h3></div></div><div id="counterResult"></div><div class="panel-footer">Distance is normalized to each feature's allowed range. No operational costs or feasibility constraints beyond editability are modeled.</div></div></div></section> | |
| <section class="view" id="view-groups"><div class="section-head"><div><div class="eyebrow">SEGMENT-LEVEL MONITORING</div><h2>Group Diagnostics</h2><p>Inspect subgroup performance differences without hiding sample sizes.</p></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">SEGMENT AUDIT</span><h3>Evaluation by group</h3></div><span class="tag">OBSERVATIONAL</span></div><div class="table-scroll"><table><thead><tr><th>Group</th><th>Records</th><th>Actual rate</th><th>Mean risk</th><th>Brier ↓</th><th>ROC AUC ↑</th><th>Recall</th></tr></thead><tbody id="groupRows"></tbody></table></div><div id="groupCallout" class="audit-note"></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">CLASSIFICATION POLICY</span><h3>Decision threshold <strong id="thresholdValue">50%</strong></h3></div></div><input id="thresholdRange" type="range" min="10" max="90" value="50" step="5"><div class="range-scale"><span>10%</span><span>90%</span></div><p class="hint">Changes confusion-matrix statistics and recall. It does not retrain the model or change its predicted probabilities.</p><div class="stats-mini" id="confusionStats"></div></div><div class="disclaimer">GROUP AUDIT NOTE: Subgroup differences are descriptive and do not establish discrimination, explain its causes, or certify fairness.</div></section> | |
| <section class="view" id="view-data"><div class="section-head"><div><div class="eyebrow">REPRODUCIBILITY</div><h2>Data & Methods</h2><p>Bring a labeled dataset, inspect the methodology, and export an auditable report.</p></div></div><div class="two-cols"><div class="panel"><div class="panel-title"><div><span class="eyebrow">YOUR DATA</span><h3>Import evaluation CSV</h3></div></div><p class="hint">Load your own synthetic or appropriately authorized records. Files stay in this browser. The fixed illustrative model is not trained on imported data.</p><input type="file" id="csvFile" accept=".csv,text/csv" class="file-input"><div class="button-row"><button class="btn btn-outline" id="downloadTemplate">↧ Download CSV template</button><button class="btn btn-outline" id="restoreDemo">↺ Restore demo</button></div><div class="audit-note" id="dataStatus"></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">REPRODUCIBLE OUTPUTS</span><h3>Export research artifacts</h3></div></div><p class="hint">Includes model formula, local attributions, counterfactual plan, global permutation importance, group performance and data-source caveats.</p><div class="export-stack"><button class="btn btn-primary" id="downloadReport">↧ Download full JSON audit</button><button class="btn btn-outline" id="downloadCsv">↧ Download predictions CSV</button><button class="btn btn-outline" id="downloadMarkdown">↧ Download readable report</button></div></div></div><div class="panel"><div class="panel-title"><div><span class="eyebrow">EVALUATION PROTOCOL</span><h3>Transparent by design</h3></div></div><div class="methods-grid"><div><b>Scoring</b><p>Additive logistic model with fixed published coefficients and direct log-odds decomposition.</p></div><div><b>Validation</b><p>ROC AUC and Brier score on labeled records; undefined metrics are displayed as N/A.</p></div><div><b>Feature importance</b><p>Seeded repeated feature permutation and mean loss difference relative to the unchanged model.</p></div><div><b>Counterfactuals</b><p>Discrete grid search of 1-2 editable features. Search is approximate, not a guaranteed continuous global optimum.</p></div><div><b>Privacy</b><p>No server-side upload: all computations occur inside the browser session. Avoid entering sensitive data on public devices.</p></div><div><b>Limits</b><p>Demo models and labels are synthetic; scores are not suitable for operational, medical, hiring, or credit decisions.</p></div></div></div></section> | |
| <footer class="footer"><span>ClarityXAI · PROJECT 036 · Open-source educational research software</span><span>MIT License · Browser-native · No external dependencies</span></footer> | |
| </div> | |
| </main> | |
| </div> | |
| <script type="module" src="./app.mjs"></script> | |
| </body></html> | |