Publish verified browser probability workbench and Python research bundle
Browse filesFiles changed (13)
- LICENSEAdded+21
- METHODS.mdAdded+49
- README.md+27-6
- app.jsAdded+43
- benchmark.jsonAdded+3144
- index.html+39-18
- labs.jsAdded+103
- model.jsAdded+38
- python-project.zipAdded+3
- style.css+1-28
- test_labs.cjsAdded+46
- test_model.cjsAdded+16
- worker.jsAdded+6
123456789101112131415161718192021MIT License
Copyright (c) 2026 QuantLab contributors
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849# Methods, provenance and limits
## Forecast question
At the most recently observed close, estimate the next observed close-to-close **log return** in three mutually exclusive categories: below −0.02; from −0.02 through zero; and above zero. A −0.02 log return corresponds to about −1.98% simple return. The categories sum to probability one. A missing date changes the horizon: the model predicts the next supplied observation, not necessarily tomorrow or the next exchange session.
CSV input is `date,close`, using unique, strictly increasing ISO dates and finite positive, consistently adjusted prices. The browser workbench accepts 714–2,500 observations and limits CSV size to 2 MiB to bound device work. The minimum yields only one outer test outcome; use a longer history for meaningful evaluation. It does not silently sort, impute, fetch prices or validate exchange calendars. Synthetic data is explicitly simulated and is not an historical market sample.
## Browser estimators and chronological evaluation
The browser actually fits three compact baselines: an empirical class-frequency model, regularized ridge return regression with a Gaussian residual probability assumption, and multinomial logistic classification. These are JavaScript implementations; their presence is not a claim that scikit-learn or a Python runtime executes inside the page.
Features use observed returns, recent momentum, realized volatility and drawdown through the feature date. The initial training block is 500 feature rows, followed by 150 calibration rows and test blocks of up to 200 rows, with a one-row embargo at each boundary. Training expands for subsequent folds. Feature standardization and model fitting use training data. Temperature calibration and model selection use calibration data. Each test row is scored only after the preceding fit and selection; the latest forecast targets an unobserved row and has no fabricated realized return.
Calibration chooses among a bounded set of temperatures and models on the same calibration block. That reuse is acknowledged; evaluation belongs to the later outer test blocks. Multiclass log loss and Brier scores measure probability quality. Reliability bins show predicted probability versus observed frequency and must be interpreted with sample counts. Repeatedly adjusting a method after inspecting these test scores turns the evaluation into another tuning loop.
The ridge model's Gaussian residual distribution is a simplifying assumption, not evidence that financial tails are normal. Empirical frequencies provide a necessary reference. Logistic probabilities can be miscalibrated under class imbalance or distribution change. Parameter uncertainty is not fully propagated. None of these methods guarantees an economic edge.
## Python benchmark and downloadable project
The static site serves [benchmark.json](benchmark.json), a **precomputed** Python experiment, not an inference service. Inspection of the artifact confirms synthetic regime-switching source data with 900 closes and seed 42; fitted scikit-learn 1.9.1, XGBoost 2.1.4 and LightGBM 4.7.0; three completed Optuna trial values; computed XGBoost SHAP with shape `[1,6,3]`; and MLflow status `FINISHED`. Its `precomputed` flag and execution note explicitly identify offline execution. These are artifact-backed execution claims, not an independent reproduction of the Python experiment in this documentation pass.
That benchmark has 187 outer-test observations. The selected chronological procedure's log loss is approximately 0.8820, with multiclass Brier score approximately 0.5615. These numbers describe this fixed synthetic sample only and do not establish superiority over a benchmark or future profitability. SHAP values explain the uncalibrated tree's raw class margins, not the temperature-calibrated probabilities or causal effects. MLflow metadata describes a completed local run; this static site does not contact an MLflow server.
Browser-selected data does not flow into that benchmark. A stored XGBoost/LightGBM comparison or SHAP explanation must never be described as a fresh fit to the currently selected CSV. Compare candidates on compatible evaluation rows and inspect observation counts when a backend has failed or skipped a fold.
The Python source ZIP permits local use of pandas, NumPy, scikit-learn, XGBoost, LightGBM, SciPy, statsmodels, Optuna, SHAP and lightweight MLflow tracking, with optional PyTorch where available. The packaged Python implementation has its own validation, version pins and documented limits. Its full-history ARIMA/OLS diagnostics are exploratory, separate from outer-test probability rankings. Local request-specific MLflow metadata is temporary; a downloaded metadata file is not a persistent experiment server.
TFT, DeepSurv, PPO, complete rough-volatility calibration, SPDE solvers and a justified quantum algorithm are not represented by the static browser baselines. An optional small neural MLP in the Python project is not a substitute for those named architectures. TensorFlow and Qiskit are omitted because no additional framework or quantum task is needed for the current experiment.
## Mathematical demonstrations
- **Prisoner's dilemma:** the selected payoff matrix has a defect/defect pure Nash equilibrium; cooperation can improve both players' payoffs. Pareto analysis of the displayed pure outcomes does not solve arbitrary repeated games.- **Matching pennies:** a zero-sum 2×2 example with equal mixed probabilities and zero value. The equilibrium depends on the supplied payoff matrix and does not define a trading strategy.- **Black–Scholes:** European calls and puts under constant volatility/rate, no dividends and diffusion-market assumptions. These are risk-neutral pricing results, not physical forecasts of stock returns.- **Kelly:** a fixed-payoff binary bet with fractional sizing and a cap. Its win probability and net payoff odds are premises. Directional stock probability alone cannot justify sizing variable-magnitude asset returns.- **Return diagnostics:** sample moments describe supplied data. A normality result is not an independence test, and ordinary iid asymptotics may fail under serial dependence or heavy tails.
Additional Python labs cover linear algebra/calculus, Bayesian networks, Cox survival, Markov simulation, fractional Brownian drivers, random matrices, ER graphs and a bounded SLE approximation. They are separate research demonstrations. SLE, free probability and connectivity phase transitions are not established equity-alpha signals here.
## Data, research and reproducibility
Browser CSV reading and baseline computation stay in the page; the app makes no prediction-server upload or remote MLflow call. Public hosting requests still occur for application assets. Downloaded results may contain dates, returns and data summaries; review them before sharing. A public source repository must never contain credentials or private market data.
The original research register is included in the Python source download. It distinguishes inspected primary abstracts/publisher metadata from books awaiting lawful full-text access. No full-book reading is claimed. Equations and specialist extensions need chapter-level source work, numerical checks and empirical validation before use beyond the stated demonstrations.
Chronological splitting reduces a specific kind of leakage; it does not eliminate nonstationarity, dependence, survivorship bias, corporate-action errors, repeated-testing bias or poor calibration. Costs, executable fills, market impact and portfolio allocation are not modeled. Synthetic success verifies chosen simulated premises and software behavior, not investment performance. A hosted static page also cannot establish that local Python dependencies will install on every machine.
Hosting configuration follows the official [Static HTML Spaces guide](https://huggingface.co/docs/hub/spaces-sdks-static) and [Spaces configuration reference](https://huggingface.co/docs/hub/spaces-config-reference), checked 25 October 2026. Claims about particular run results belong to the bundled provenance artifact and executed verification record.123456789101112---title: Quantlab Probability Researchemoji: 🐢colorFrom: indigocolorTo: bluesdk: staticpinned: falselicense: mitshort_description: Browser-local probability research and model validation---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112131415161718192021222324252627282930313233---title: QuantLab Probability Researchemoji: 📈colorFrom: graycolorTo: bluesdk: staticapp_file: index.htmlfullWidth: trueshort_description: Browser-local probability research and model validationlicense: mit---# QuantLab / probability researchPublic Space: [PabloRod11/quantlab-probability-research](https://huggingface.co/spaces/PabloRod11/quantlab-probability-research).Explore next-observed-close equity-return probabilities using synthetic data or your own consistently adjusted `date,close` CSV. The interactive browser workbench fits empirical, ridge and multinomial logistic baselines with chronological training, calibration and test blocks. It includes separate mathematical demonstrations for games, Black–Scholes and binary Kelly sizing.**Synthetic examples do not establish a trading edge.** Reported probabilities refer to log-return categories, not executable trades. See [METHODS.md](METHODS.md) for assumptions, validation and scope.## Free static hostingThis Space serves HTML and JavaScript; it does not launch a Python compute server. Hugging Face's [official static Spaces documentation](https://huggingface.co/docs/hub/spaces-sdks-static), checked 25 October 2026, says static Spaces are served without compute and do not require a paid plan. The creation page offered Static for the selected account. No paid hardware, external model endpoint or API key is needed for the browser workbench. Platform policies may change.The root YAML selects `sdk: static` and `app_file: index.html`, following the [official configuration reference](https://huggingface.co/docs/hub/spaces-config-reference). Upload this directory's contents to the repository root. No Gradio SDK version, Python requirements installation or build command is required for this static entry point.## Local data and sourceCSV selection and baseline fitting run in the browser. The application does not upload the selected CSV to a prediction or tracking server. Hosting still involves normal browser requests to obtain the public site and bundled assets. Browser extensions, device access and the hosting platform are outside this application's privacy guarantees. Do not commit private CSVs or credentials to this public repository.The [Python project ZIP](python-project.zip) is provided for local experiments with the broader library stack. Downloading it does not start a hosted Python service. Its server-side data-processing and temporary-storage rules apply if you run the Gradio version; those are distinct from this browser-only workbench. The Python package also includes the original research register: accessible abstracts and metadata were consulted, but the requested books were not read in full.The [precomputed Python benchmark](benchmark.json) records an actual 900-close synthetic experiment with seed 42: scikit-learn 1.9.1, XGBoost 2.1.4 and LightGBM 4.7.0 fitted; three Optuna trials; computed tree SHAP; and completed local MLflow metadata. It does not train these libraries on your browser-selected CSV. Check the benchmark's provenance and method status before interpreting its results.
12345678910111213141516171819202122232425262728293031323334353637383940414243'use strict';const $=id=>document.getElementById(id),percent=x=>(100*x).toFixed(2)+'%',fmt=x=>Number(x).toFixed(4);let currentReport=null,busy=false,worker=null;const INK='#141414',BLUE='#1d5fbf',GRAY='#858b93';function escapeXML(value){return String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));}function svg(content,label){return `<svg viewBox="0 0 440 220" role="img" aria-label="${escapeXML(label)}">${content}</svg>`;}function grids(max=1){let s='';for(let i=0;i<=4;i++){let y=175-150*i/4;s+=`<line class="grid" x1="40" x2="430" y1="${y}" y2="${y}"/><text x="32" y="${y+4}" text-anchor="end">${(max*i/4*100).toFixed(0)}%</text>`;}return s;}function drawProbabilities(q){const labels=['Below −0.02','−0.02 to zero','Above zero'];let s=grids();q.forEach((v,i)=>{const x=65+i*130,y=175-v*150;s+=`<rect x="${x}" y="${y}" width="95" height="${175-y}" fill="${[GRAY,INK,BLUE][i]}"/><text x="${x+47}" y="${Math.max(15,y-7)}" text-anchor="middle">${percent(v)}</text><text x="${x+47}" y="197" text-anchor="middle">${labels[i]}</text>`;});$('probability-chart').innerHTML=svg(s,'Next-close probabilities: '+q.map(percent).join(', '));}function drawTimeline(rows,dates){const ys=rows.map(r=>r.probabilities[0]),max=Math.max(.1,...ys)*1.1;let s=grids(max);const path=ys.map((v,i)=>`${i?'L':'M'}${40+i*390/Math.max(1,ys.length-1)},${175-v/max*150}`).join(' ');s+=`<path d="${path}" fill="none" stroke="${BLUE}" stroke-width="1.5"/>`;const first=rows[0],last=rows.at(-1);const a=first.target_date||(dates&&dates[first.target_index])||String(first.target_index),b=last.target_date||(dates&&dates[last.target_index])||String(last.target_index);s+=`<text x="40" y="200">${escapeXML(a)}</text><text x="430" y="200" text-anchor="end">${escapeXML(b)}</text>`;$('timeline-chart').innerHTML=svg(s,'Predicted downside probability across '+rows.length+' unseen observations');}function drawCalibration(rows){let s=grids();s+=`<line x1="40" y1="175" x2="430" y2="25" stroke="#a9afb8" stroke-dasharray="4 4"/>`; for(const [cls,color,label]of [[0,BLUE,'Downside'],[2,INK,'Up']]){const bins=Array.from({length:10},()=>[]);rows.forEach(row=>bins[Math.min(9,Math.floor(row.probabilities[cls]*10))].push(row));let points=[];bins.forEach(bin=>{if(!bin.length)return;const p=bin.reduce((a,r)=>a+r.probabilities[cls],0)/bin.length,o=bin.reduce((a,r)=>a+(cls===0?r.actual_log_return<-.02:r.actual_log_return>0),0)/bin.length;const x=40+p*390,y=175-o*150;points.push([x,y]);s+=`<circle cx="${x}" cy="${y}" r="${Math.min(8,3+Math.sqrt(bin.length)/3)}" fill="${color}" opacity=".8"><title>${label}: predicted ${percent(p)}, observed ${percent(o)}, n=${bin.length}</title></circle>`;});if(points.length>1)s+=`<path d="${points.map(([x,y],i)=>`${i?'L':'M'}${x},${y}`).join(' ')}" fill="none" stroke="${color}" stroke-width="1"/>`;} s+='<text x="40" y="199">0%</text><text x="430" y="199" text-anchor="end">100% predicted</text><text x="125" y="219" fill="#1d5fbf">Downside</text><text x="255" y="219">Up</text>';$('calibration-chart').innerHTML=svg(s,'Reliability bins: mean predicted probability versus observed event frequency');}function drawScores(metrics){const names=Object.keys(metrics).sort((a,b)=>metrics[a].log_loss-metrics[b].log_loss),max=Math.max(...names.map(n=>metrics[n].log_loss))*1.13;let s='';names.forEach((name,i)=>{const step=150/names.length,y=20+i*step,w=metrics[name].log_loss/max*275;s+=`<text x="100" y="${y+15}" text-anchor="end">${escapeXML(name)}</text><rect x="112" y="${y}" height="${Math.min(25,step-6)}" width="${w}" fill="${name==='empirical'?BLUE:INK}"/><text x="${118+w}" y="${y+15}">${fmt(metrics[name].log_loss)}</text>`;});s+='<text x="112" y="202">0</text><text x="430" y="202" text-anchor="end">Multiclass log loss</text>';$('score-chart').innerHTML=svg(s,'Out-of-sample log loss for each model, lower is better');}function setBusy(value,message){busy=value;$('run').disabled=value;$('benchmark').disabled=value;$('run').textContent=value?'Fitting chronological models…':'Run chronological experiment';$('status').classList.remove('error');if(message)$('status').textContent=message;}function fail(message){setBusy(false);$('status').textContent=message;$('status').classList.add('error');}function render(report,source,dates,diagnostics){ currentReport={...report,source,diagnostics};const q=report.latest_forecast.probabilities; $('stats').replaceChildren();for(const [label,value]of [['P(downside)',percent(q[0])],['P(positive)',percent(q[2])],['Test log loss',fmt(report.selected_metrics.log_loss)],['Unseen observations',report.test_observations.toLocaleString()]]){const div=document.createElement('div'),span=document.createElement('span'),strong=document.createElement('strong');span.textContent=label;strong.textContent=value;div.append(span,strong);$('stats').append(div);} const kind=report.precomputed?'PRECOMPUTED PYTHON BENCHMARK':source.synthetic?'SYNTHETIC · BROWSER FIT':'LOCAL CSV · BROWSER FIT'; $('status').textContent=`${kind} · ${source.rows.toLocaleString()} closes · latest model: ${report.latest_forecast.model}. ${report.precomputed?'Saved run; Python libraries are not executing here.':'Models fit in your browser. CSV contents are not sent to a modeling server.'}`; drawProbabilities(q);drawTimeline(report.predictions,dates);drawCalibration(report.predictions);drawScores(report.candidate_metrics); $('scores-body').replaceChildren();Object.entries(report.candidate_metrics).sort((a,b)=>a[1].log_loss-b[1].log_loss).forEach(([name,m])=>{const row=document.createElement('tr');for(const value of [name,m.observations||report.test_observations,fmt(m.log_loss),fmt(m.brier_multiclass),fmt(m.up_brier),fmt(m.downside_brier)]){const td=document.createElement('td');td.textContent=value;row.append(td);}$('scores-body').append(row);}); $('score-note').textContent=report.precomputed?'Saved Python scores; candidate counts must be compared before ranking. No historical investment performance is claimed.':'These three candidates score the same unseen rows. Model selection uses preceding calibration data, not this table.'; $('audit').textContent=JSON.stringify({source,target:report.target,threshold:report.threshold,latest_forecast:report.latest_forecast,folds:report.folds,model_status:report.model_status||'Browser baselines only',limitations:report.limitations},null,2); $('diagnostics').textContent=JSON.stringify(diagnostics||{},null,2); $('explanations').textContent=report.precomputed?JSON.stringify({mode:'PRECOMPUTED; no Python executes on this host',tuning_trials:report.tuning_trials,shap_explanation:report.shap_explanation,mlflow:report.mlflow,benchmark_date:report.benchmark_date},null,2):'Browser run: no SHAP, Optuna, XGBoost, LightGBM or MLflow execution. Load the precomputed Python benchmark to inspect its saved results, or download the Python project.'; $('download').disabled=false;setBusy(false);}function syntheticDates(n){const dates=[],day=new Date('2010-01-04T00:00:00Z');while(dates.length<n){if(day.getUTCDay()!==0&&day.getUTCDay()!==6)dates.push(day.toISOString().slice(0,10));day.setUTCDate(day.getUTCDate()+1);}return dates;}async function run(){if(busy)return;setBusy(true,'Fitting browser models on past data, calibrating, then testing on later observations…');try{let closes,dates,source;const mode=$('data-source').value; if(mode==='csv'){const file=$('csv-file').files[0];if(!file)throw Error('Choose a date,close CSV, or select Synthetic demo.');if(file.size>2*1024*1024)throw Error('CSV must be no larger than 2 MiB.');const data=QuantLabs.parseCSV(await file.text());closes=data.closes;dates=data.dates;source={synthetic:false,rows:closes.length,name:'Local CSV',calendar_gap_max_days:data.calendarGapMaxDays};} else{const n=Number($('observations').value),seed=Number($('seed').value);if(!Number.isInteger(n)||n<850||n>2500||!Number.isInteger(seed)||seed<0||seed>100000)throw Error('Use 850–2,500 observations and an integer seed from 0 to 100,000.');const model=await import('./model.js');closes=globalThis.QuantModel.synthetic(n,seed);dates=syntheticDates(n);source={synthetic:true,rows:n,seed,name:'Browser synthetic generator',calendar:'Weekday placeholders, not exchange dates'};} if(worker)worker.terminate();worker=new Worker('worker.js');worker.onmessage=event=>{if(event.data.error){fail(event.data.error);return;}const report=event.data.report;report.predictions.forEach(r=>{r.feature_date=dates[r.feature_index];r.target_date=dates[r.target_index];});report.latest_forecast.feature_date=dates.at(-1);render(report,source,dates,event.data.diagnostics);};worker.onerror=()=>fail('Browser calculation could not finish. Try fewer observations or download the Python project.');worker.postMessage({closes}); }catch(error){fail(error.message);}}$('experiment').addEventListener('submit',event=>{event.preventDefault();run();});$('csv-file').addEventListener('change',()=>{if($('csv-file').files.length)$('data-source').value='csv';});$('benchmark').addEventListener('click',async()=>{if(busy)return;setBusy(true,'Loading a saved Python benchmark; no Python models are executing…');try{const response=await fetch('benchmark.json');if(!response.ok)throw Error('The benchmark file could not be loaded.');const report=await response.json();render(report,report.source,null,report.diagnostics);}catch(error){fail(error.message);}});$('download').addEventListener('click',()=>{if(!currentReport)return;const blob=new Blob([JSON.stringify(currentReport,null,2)],{type:'application/json'}),url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='quantlab-report.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);});document.querySelectorAll('[data-view]').forEach(button=>button.addEventListener('click',()=>{document.querySelectorAll('[data-view]').forEach(b=>{const active=b===button;b.classList.toggle('active',active);b.setAttribute('aria-pressed',String(active));});document.querySelectorAll('.view').forEach(section=>section.hidden=section.id!==button.dataset.view);}));function updateGame(){try{$('game-output').textContent=JSON.stringify(QuantLabs.game($('game').value),null,2);}catch(error){$('game-output').textContent=error.message;}}$('game').addEventListener('change',updateGame);function updateRisk(){try{const data=new FormData($('risk-form')),value=name=>Number(data.get(name));$('risk-output').textContent=JSON.stringify({black_scholes:QuantLabs.blackScholes(value('spot'),value('strike'),value('years'),.03,value('vol')),quarter_kelly_binary_fraction:QuantLabs.kelly(value('probability'),value('odds'))},null,2);}catch(error){$('risk-output').textContent=error.message;}}$('risk-form').addEventListener('submit',event=>{event.preventDefault();updateRisk();});updateGame();updateRisk();run();123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144{ "schema_version": 1, "target": "next observed-close log return", "threshold": -0.02, "classes": [ "r < -0.02", "-0.02 <= r <= 0", "r > 0" ], "feature_names": [ "return_1", "momentum_5", "momentum_20", "volatility_5", "volatility_20", "drawdown_60" ], "test_observations": 187, "folds": [ { "train_feature_start": 60, "train_feature_end": 559, "train_label_end": 560, "calibration_feature_start": 561, "calibration_label_end": 711, "test_feature_start": 712, "test_feature_end": 898, "selected": "sklearn", "calibration_log_loss": { "empirical": 0.7983561760621128, "ridge": 0.8026401887828732, "sklearn": 0.7888006273987486, "xgboost": 0.8533005250802127, "lightgbm": 0.848183351897016 }, "temperatures": { "empirical": 0.75, "ridge": 0.75, "sklearn": 1.0, "xgboost": 1.0, "lightgbm": 1.5 } } ], "predictions": [ { "feature_index": 712, "target_index": 713, "model": "sklearn", "probabilities": [ 0.03578472563102056, 0.4148229237197586, 0.5493923506492209 ], "actual_log_return": 0.016571070598124127, "feature_date": "2012-09-26", "target_date": "2012-09-27" }, { "feature_index": 713, "target_index": 714, "model": "sklearn", "probabilities": [ 0.02412824518247462, 0.33444830740985904, 0.6414234474076663 ], "actual_log_return": -0.015087453819850882, "feature_date": "2012-09-27", "target_date": "2012-09-28" }, { "feature_index": 714, "target_index": 715, "model": "sklearn", "probabilities": [ 0.029273097256044472, 0.504640986040927, 0.46608591670302857 ], "actual_log_return": -0.0080451752754227, "feature_date": "2012-09-28", "target_date": "2012-10-01" }, { "feature_index": 715, "target_index": 716, "model": "sklearn", "probabilities": [ 0.026113650244067695, 0.4692811267437354, 0.5046052230121969 ], "actual_log_return": 0.015405515774091771, "feature_date": "2012-10-01", "target_date": "2012-10-02" }, { "feature_index": 716, "target_index": 717, "model": "sklearn", "probabilities": [ 0.02596816935422722, 0.3343280531287578, 0.639703777517015 ], "actual_log_return": 0.023258774175906716, "feature_date": "2012-10-02", "target_date": "2012-10-03" }, { "feature_index": 717, "target_index": 718, "model": "sklearn", "probabilities": [ 0.02569080933675308, 0.2898966165341806, 0.6844125741290663 ], "actual_log_return": -0.0025028526332278034, "feature_date": "2012-10-03", "target_date": "2012-10-04" }, { "feature_index": 718, "target_index": 719, "model": "sklearn", "probabilities": [ 0.025536083578205797, 0.43957360104592896, 0.5348903153758652 ], "actual_log_return": 0.006253806359072911, "feature_date": "2012-10-04", "target_date": "2012-10-05" }, { "feature_index": 719, "target_index": 720, "model": "sklearn", "probabilities": [ 0.02978564589529962, 0.4066381285742579, 0.5635762255304425 ], "actual_log_return": 0.005592008972291396, "feature_date": "2012-10-05", "target_date": "2012-10-08" }, { "feature_index": 720, "target_index": 721, "model": "sklearn", "probabilities": [ 0.026438672192518112, 0.41870799833520533, 0.5548533294722766 ], "actual_log_return": 0.0003669120386895486, "feature_date": "2012-10-08", "target_date": "2012-10-09" }, { "feature_index": 721, "target_index": 722, "model": "sklearn", "probabilities": [ 0.026132639700473352, 0.4612388956438138, 0.5126284646557128 ], "actual_log_return": 0.00656160948808715, "feature_date": "2012-10-09", "target_date": "2012-10-10" }, { "feature_index": 722, "target_index": 723, "model": "sklearn", "probabilities": [ 0.020727560926579534, 0.43889760803682076, 0.5403748310365997 ], "actual_log_return": 0.00043515208819133733, "feature_date": "2012-10-10", "target_date": "2012-10-11" }, { "feature_index": 723, "target_index": 724, "model": "sklearn", "probabilities": [ 0.021226803707855076, 0.4777019343589759, 0.501071261933169 ], "actual_log_return": -0.006282071054151572, "feature_date": "2012-10-11", "target_date": "2012-10-12" }, { "feature_index": 724, "target_index": 725, "model": "sklearn", "probabilities": [ 0.02248221106909225, 0.5146392291401181, 0.46287855979078973 ], "actual_log_return": 0.003298043068915568, "feature_date": "2012-10-12", "target_date": "2012-10-15" }, { "feature_index": 725, "target_index": 726, "model": "sklearn", "probabilities": [ 0.023023569513404927, 0.4590562058451392, 0.5179202246414559 ], "actual_log_return": -0.007878490301264307, "feature_date": "2012-10-15", "target_date": "2012-10-16" }, { "feature_index": 726, "target_index": 727, "model": "sklearn", "probabilities": [ 0.027624288626183807, 0.521298532427621, 0.45107717894619515 ], "actual_log_return": 0.009559096501824627, "feature_date": "2012-10-16", "target_date": "2012-10-17" }, { "feature_index": 727, "target_index": 728, "model": "sklearn", "probabilities": [ 0.027275710457735625, 0.417276320767184, 0.5554479687750804 ], "actual_log_return": 0.0065794457742773815, "feature_date": "2012-10-17", "target_date": "2012-10-18" }, { "feature_index": 728, "target_index": 729, "model": "sklearn", "probabilities": [ 0.0276336773192037, 0.44479240911288054, 0.5275739135679157 ], "actual_log_return": -0.005721939221365879, "feature_date": "2012-10-18", "target_date": "2012-10-19" }, { "feature_index": 729, "target_index": 730, "model": "sklearn", "probabilities": [ 0.028441574851790583, 0.5162033189915675, 0.455355106156642 ], "actual_log_return": 0.002464991881389267, "feature_date": "2012-10-19", "target_date": "2012-10-22" }, { "feature_index": 730, "target_index": 731, "model": "sklearn", "probabilities": [ 0.03047343750764365, 0.4691268346278828, 0.5003997278644736 ], "actual_log_return": 0.00793109248410051, "feature_date": "2012-10-22", "target_date": "2012-10-23" }, { "feature_index": 731, "target_index": 732, "model": "sklearn", "probabilities": [ 0.027648725149474487, 0.44439392705247965, 0.5279573477980458 ], "actual_log_return": 0.008022768737117936, "feature_date": "2012-10-23", "target_date": "2012-10-24" }, { "feature_index": 732, "target_index": 733, "model": "sklearn", "probabilities": [ 0.02605612032564821, 0.4455526565063611, 0.5283912231679906 ], "actual_log_return": 1.1791962014839896e-05, "feature_date": "2012-10-24", "target_date": "2012-10-25" }, { "feature_index": 733, "target_index": 734, "model": "sklearn", "probabilities": [ 0.027664898876520197, 0.49290389125236134, 0.47943120987111854 ], "actual_log_return": 0.0029633152082730874, "feature_date": "2012-10-25", "target_date": "2012-10-26" }, { "feature_index": 734, "target_index": 735, "model": "sklearn", "probabilities": [ 0.025220129978250412, 0.48560018801883903, 0.4891796820029106 ], "actual_log_return": -0.004352753012184962, "feature_date": "2012-10-26", "target_date": "2012-10-29" }, { "feature_index": 735, "target_index": 736, "model": "sklearn", "probabilities": [ 0.026777631794712726, 0.5245348708786852, 0.4486874973266021 ], "actual_log_return": 0.00927754006688808, "feature_date": "2012-10-29", "target_date": "2012-10-30" }, { "feature_index": 736, "target_index": 737, "model": "sklearn", "probabilities": [ 0.027932872288349404, 0.44435330129249934, 0.5277138264191513 ], "actual_log_return": 0.00520502307388071, "feature_date": "2012-10-30", "target_date": "2012-10-31" }, { "feature_index": 737, "target_index": 738, "model": "sklearn", "probabilities": [ 0.030633280828029127, 0.47292273526034484, 0.4964439839116261 ], "actual_log_return": -0.005558763513671572, "feature_date": "2012-10-31", "target_date": "2012-11-01" }, { "feature_index": 738, "target_index": 739, "model": "sklearn", "probabilities": [ 0.03196591963957342, 0.5317105459054445, 0.43632353445498206 ], "actual_log_return": 0.00215371750886284, "feature_date": "2012-11-01", "target_date": "2012-11-02" }, { "feature_index": 739, "target_index": 740, "model": "sklearn", "probabilities": [ 0.032499465142452034, 0.4865773139761811, 0.48092322088136674 ], "actual_log_return": -0.011057328296235625, "feature_date": "2012-11-02", "target_date": "2012-11-05" }, { "feature_index": 740, "target_index": 741, "model": "sklearn", "probabilities": [ 0.03569184125499974, 0.5546206363251909, 0.4096875224198094 ], "actual_log_return": -0.022401268659322682, "feature_date": "2012-11-05", "target_date": "2012-11-06" }, { "feature_index": 741, "target_index": 742, "model": "sklearn", "probabilities": [ 0.03897379993199845, 0.6018196568275637, 0.3592065432404378 ], "actual_log_return": -0.006137560867282232, "feature_date": "2012-11-06", "target_date": "2012-11-07" }, { "feature_index": 742, "target_index": 743, "model": "sklearn", "probabilities": [ 0.038956311381409696, 0.5128413547261453, 0.4482023338924449 ], "actual_log_return": -0.0046511461861338255, "feature_date": "2012-11-07", "target_date": "2012-11-08" }, { "feature_index": 743, "target_index": 744, "model": "sklearn", "probabilities": [ 0.03994147705220188, 0.5032616010799363, 0.45679692186786186 ], "actual_log_return": 0.012558467662556527, "feature_date": "2012-11-08", "target_date": "2012-11-09" }, { "feature_index": 744, "target_index": 745, "model": "sklearn", "probabilities": [ 0.04177284491138792, 0.3958403246243741, 0.562386830464238 ], "actual_log_return": -0.005158336176785738, "feature_date": "2012-11-09", "target_date": "2012-11-12" }, { "feature_index": 745, "target_index": 746, "model": "sklearn", "probabilities": [ 0.04311811688684725, 0.4978020948338183, 0.4590797882793346 ], "actual_log_return": -0.011450526810074635, "feature_date": "2012-11-12", "target_date": "2012-11-13" }, { "feature_index": 746, "target_index": 747, "model": "sklearn", "probabilities": [ 0.03888365715655411, 0.5429912642583274, 0.41812507858511844 ], "actual_log_return": -0.0052652221822788725, "feature_date": "2012-11-13", "target_date": "2012-11-14" }, { "feature_index": 747, "target_index": 748, "model": "sklearn", "probabilities": [ 0.04151650121576084, 0.506584009681764, 0.4518994891024752 ], "actual_log_return": -0.0011955119743376486, "feature_date": "2012-11-14", "target_date": "2012-11-15" }, { "feature_index": 748, "target_index": 749, "model": "sklearn", "probabilities": [ 0.04295787319457116, 0.48303484189764956, 0.4740072849077794 ], "actual_log_return": 0.0009292200535271355, "feature_date": "2012-11-15", "target_date": "2012-11-16" }, { "feature_index": 749, "target_index": 750, "model": "sklearn", "probabilities": [ 0.03573101244055433, 0.48259095745353897, 0.48167803010590665 ], "actual_log_return": 0.0032756965976425967, "feature_date": "2012-11-16", "target_date": "2012-11-19" }, { "feature_index": 750, "target_index": 751, "model": "sklearn", "probabilities": [ 0.03712205255681033, 0.4665688260438917, 0.49630912139929806 ], "actual_log_return": 0.007075165171027908, "feature_date": "2012-11-19", "target_date": "2012-11-20" }, { "feature_index": 751, "target_index": 752, "model": "sklearn", "probabilities": [ 0.03580034942931741, 0.44896641836719176, 0.5152332322034908 ], "actual_log_return": 0.0026813640458955845, "feature_date": "2012-11-20", "target_date": "2012-11-21" }, { "feature_index": 752, "target_index": 753, "model": "sklearn", "probabilities": [ 0.03464045565581982, 0.4796873434346689, 0.4856722009095113 ], "actual_log_return": -0.0020267077105060594, "feature_date": "2012-11-21", "target_date": "2012-11-22" }, { "feature_index": 753, "target_index": 754, "model": "sklearn", "probabilities": [ 0.03518230437536971, 0.5062825532276006, 0.45853514239702964 ], "actual_log_return": -0.005293643898390155, "feature_date": "2012-11-22", "target_date": "2012-11-23" }, { "feature_index": 754, "target_index": 755, "model": "sklearn", "probabilities": [ 0.038141429202144174, 0.520047374478989, 0.44181119631886695 ], "actual_log_return": 0.002098476374477798, "feature_date": "2012-11-23", "target_date": "2012-11-26" }, { "feature_index": 755, "target_index": 756, "model": "sklearn", "probabilities": [ 0.0373343775994574, 0.47760446477055907, 0.4850611576299835 ], "actual_log_return": -0.003070929606544759, "feature_date": "2012-11-26", "target_date": "2012-11-27" }, { "feature_index": 756, "target_index": 757, "model": "sklearn", "probabilities": [ 0.0371200878594704, 0.510988460274463, 0.4518914518660666 ], "actual_log_return": 0.005692358396053976, "feature_date": "2012-11-27", "target_date": "2012-11-28" }, { "feature_index": 757, "target_index": 758, "model": "sklearn", "probabilities": [ 0.03829948988429257, 0.4575433916126916, 0.5041571185030158 ], "actual_log_return": -0.0014069355103130121, "feature_date": "2012-11-28", "target_date": "2012-11-29" }, { "feature_index": 758, "target_index": 759, "model": "sklearn", "probabilities": [ 0.037853446922373676, 0.4994348882918399, 0.46271166478578646 ], "actual_log_return": 0.004995641399697437, "feature_date": "2012-11-29", "target_date": "2012-11-30" }, { "feature_index": 759, "target_index": 760, "model": "sklearn", "probabilities": [ 0.03682210563685256, 0.46410671683529203, 0.4990711775278555 ], "actual_log_return": 0.006321035672404385, "feature_date": "2012-11-30", "target_date": "2012-12-03" }, { "feature_index": 760, "target_index": 761, "model": "sklearn", "probabilities": [ 0.035657081402223054, 0.4568058030049239, 0.5075371155928531 ], "actual_log_return": -0.0074235401114046695, "feature_date": "2012-12-03", "target_date": "2012-12-04" }, { "feature_index": 761, "target_index": 762, "model": "sklearn", "probabilities": [ 0.03819927742209363, 0.537280463056992, 0.4245202595209143 ], "actual_log_return": -0.005783004285740301, "feature_date": "2012-12-04", "target_date": "2012-12-05" }, { "feature_index": 762, "target_index": 763, "model": "sklearn", "probabilities": [ 0.038658948913480276, 0.5262443570834562, 0.4350966940030635 ], "actual_log_return": -0.017864131272927963, "feature_date": "2012-12-05", "target_date": "2012-12-06" }, { "feature_index": 763, "target_index": 764, "model": "sklearn", "probabilities": [ 0.044010787835348064, 0.5789977700304514, 0.3769914421342005 ], "actual_log_return": -0.003381760378910137, "feature_date": "2012-12-06", "target_date": "2012-12-07" }, { "feature_index": 764, "target_index": 765, "model": "sklearn", "probabilities": [ 0.04618201438466853, 0.4995212390419728, 0.4542967465733587 ], "actual_log_return": 0.03781209358327109, "feature_date": "2012-12-07", "target_date": "2012-12-10" }, { "feature_index": 765, "target_index": 766, "model": "sklearn", "probabilities": [ 0.048819965612778474, 0.2448604033057262, 0.7063196310814954 ], "actual_log_return": 0.02829290151208763, "feature_date": "2012-12-10", "target_date": "2012-12-11" }, { "feature_index": 766, "target_index": 767, "model": "sklearn", "probabilities": [ 0.04686494779107087, 0.285096502134538, 0.6680385500743912 ], "actual_log_return": -0.006297011414531539, "feature_date": "2012-12-11", "target_date": "2012-12-12" }, { "feature_index": 767, "target_index": 768, "model": "sklearn", "probabilities": [ 0.05103964969864389, 0.47104356947812365, 0.4779167808232324 ], "actual_log_return": -0.07533774537853022, "feature_date": "2012-12-12", "target_date": "2012-12-13" }, { "feature_index": 768, "target_index": 769, "model": "sklearn", "probabilities": [ 0.08330498865533224, 0.7261112400956565, 0.19058377124901113 ], "actual_log_return": 0.0006514419559717766, "feature_date": "2012-12-13", "target_date": "2012-12-14" }, { "feature_index": 769, "target_index": 770, "model": "sklearn", "probabilities": [ 0.10074785896607365, 0.3385626652163802, 0.5606894758175462 ], "actual_log_return": -0.011345850662761059, "feature_date": "2012-12-14", "target_date": "2012-12-17" }, { "feature_index": 770, "target_index": 771, "model": "sklearn", "probabilities": [ 0.08398857535535605, 0.4178599104759379, 0.498151514168706 ], "actual_log_return": -0.005580411782296402, "feature_date": "2012-12-17", "target_date": "2012-12-18" }, { "feature_index": 771, "target_index": 772, "model": "sklearn", "probabilities": [ 0.06733498717523966, 0.40444523789043213, 0.5282197749343283 ], "actual_log_return": -0.007867473808574221, "feature_date": "2012-12-18", "target_date": "2012-12-19" }, { "feature_index": 772, "target_index": 773, "model": "sklearn", "probabilities": [ 0.06975357455064085, 0.41606249443805177, 0.5141839310113073 ], "actual_log_return": -0.03421632625647941, "feature_date": "2012-12-19", "target_date": "2012-12-20" }, { "feature_index": 773, "target_index": 774, "model": "sklearn", "probabilities": [ 0.0393572538892702, 0.6148054729316702, 0.3458372731790597 ], "actual_log_return": 0.02605352145697548, "feature_date": "2012-12-20", "target_date": "2012-12-21" }, { "feature_index": 774, "target_index": 775, "model": "sklearn", "probabilities": [ 0.04422782095506968, 0.2646623569318557, 0.6911098221130747 ], "actual_log_return": -0.0036538420880041222, "feature_date": "2012-12-21", "target_date": "2012-12-24" }, { "feature_index": 775, "target_index": 776, "model": "sklearn", "probabilities": [ 0.04943151869865321, 0.41942690280772865, 0.5311415784936181 ], "actual_log_return": 0.001580559273436144, "feature_date": "2012-12-24", "target_date": "2012-12-25" }, { "feature_index": 776, "target_index": 777, "model": "sklearn", "probabilities": [ 0.0488929086172131, 0.390243588684347, 0.5608635026984399 ], "actual_log_return": -0.004309119228398384, "feature_date": "2012-12-25", "target_date": "2012-12-26" }, { "feature_index": 777, "target_index": 778, "model": "sklearn", "probabilities": [ 0.05105259573022181, 0.42305744744276647, 0.5258899568270118 ], "actual_log_return": 0.0012609748602119275, "feature_date": "2012-12-26", "target_date": "2012-12-27" }, { "feature_index": 778, "target_index": 779, "model": "sklearn", "probabilities": [ 0.03723055874491577, 0.41788200787832613, 0.5448874333767582 ], "actual_log_return": 0.00459493317201165, "feature_date": "2012-12-27", "target_date": "2012-12-28" }, { "feature_index": 779, "target_index": 780, "model": "sklearn", "probabilities": [ 0.026293919759406092, 0.42006018811396006, 0.5536458921266338 ], "actual_log_return": -0.016688787426474505, "feature_date": "2012-12-28", "target_date": "2012-12-31" }, { "feature_index": 780, "target_index": 781, "model": "sklearn", "probabilities": [ 0.03376228301027736, 0.5294990710044931, 0.4367386459852296 ], "actual_log_return": 0.002843645276765727, "feature_date": "2012-12-31", "target_date": "2013-01-01" }, { "feature_index": 781, "target_index": 782, "model": "sklearn", "probabilities": [ 0.03290549559440998, 0.41579540433652046, 0.5512991000690696 ], "actual_log_return": -0.007343832056590394, "feature_date": "2013-01-01", "target_date": "2013-01-02" }, { "feature_index": 782, "target_index": 783, "model": "sklearn", "probabilities": [ 0.03382637200620049, 0.4736964173153478, 0.4924772106784518 ], "actual_log_return": 0.0021164721949156196, "feature_date": "2013-01-02", "target_date": "2013-01-03" }, { "feature_index": 783, "target_index": 784, "model": "sklearn", "probabilities": [ 0.03204986786953782, 0.4201758546845924, 0.5477742774458698 ], "actual_log_return": -0.004677232425124078, "feature_date": "2013-01-03", "target_date": "2013-01-04" }, { "feature_index": 784, "target_index": 785, "model": "sklearn", "probabilities": [ 0.031085627763054274, 0.46158000671381016, 0.5073343655231356 ], "actual_log_return": -0.007787545179576583, "feature_date": "2013-01-04", "target_date": "2013-01-07" }, { "feature_index": 785, "target_index": 786, "model": "sklearn", "probabilities": [ 0.034817053042053916, 0.4904060681432355, 0.4747768788147105 ], "actual_log_return": 0.003629566838682763, "feature_date": "2013-01-07", "target_date": "2013-01-08" }, { "feature_index": 786, "target_index": 787, "model": "sklearn", "probabilities": [ 0.0392943422171756, 0.42559896675885206, 0.5351066910239723 ], "actual_log_return": -0.002330712095858889, "feature_date": "2013-01-08", "target_date": "2013-01-09" }, { "feature_index": 787, "target_index": 788, "model": "sklearn", "probabilities": [ 0.0383104827625948, 0.46214230874704915, 0.49954720849035616 ], "actual_log_return": -0.012343090299414161, "feature_date": "2013-01-09", "target_date": "2013-01-10" }, { "feature_index": 788, "target_index": 789, "model": "sklearn", "probabilities": [ 0.04421751373636663, 0.5400773751400889, 0.41570511112354447 ], "actual_log_return": -0.023525911147685097, "feature_date": "2013-01-10", "target_date": "2013-01-11" }, { "feature_index": 789, "target_index": 790, "model": "sklearn", "probabilities": [ 0.05377272215463244, 0.5837960664896508, 0.36243121135571676 ], "actual_log_return": -0.0002168189601641224, "feature_date": "2013-01-11", "target_date": "2013-01-14" }, { "feature_index": 790, "target_index": 791, "model": "sklearn", "probabilities": [ 0.055641391520247226, 0.45078365593923175, 0.4935749525405211 ], "actual_log_return": 0.004878062769310798, "feature_date": "2013-01-14", "target_date": "2013-01-15" }, { "feature_index": 791, "target_index": 792, "model": "sklearn", "probabilities": [ 0.05391054411303385, 0.42173774160194766, 0.5243517142850185 ], "actual_log_return": -0.012084554847891837, "feature_date": "2013-01-15", "target_date": "2013-01-16" }, { "feature_index": 792, "target_index": 793, "model": "sklearn", "probabilities": [ 0.05434655403758137, 0.5174343958974476, 0.42821905006497113 ], "actual_log_return": 0.006109543531622297, "feature_date": "2013-01-16", "target_date": "2013-01-17" }, { "feature_index": 793, "target_index": 794, "model": "sklearn", "probabilities": [ 0.055376056532006966, 0.4184583748241965, 0.5261655686437966 ], "actual_log_return": 0.0011062748176136061, "feature_date": "2013-01-17", "target_date": "2013-01-18" }, { "feature_index": 794, "target_index": 795, "model": "sklearn", "probabilities": [ 0.05379195367816659, 0.46719936339713314, 0.4790086829247004 ], "actual_log_return": 0.0015088184697611418, "feature_date": "2013-01-18", "target_date": "2013-01-21" }, { "feature_index": 795, "target_index": 796, "model": "sklearn", "probabilities": [ 0.0529229911372468, 0.46525357428133635, 0.4818234345814168 ], "actual_log_return": -0.013463023332287438, "feature_date": "2013-01-21", "target_date": "2013-01-22" }, { "feature_index": 796, "target_index": 797, "model": "sklearn", "probabilities": [ 0.05728084942042825, 0.5425045743063045, 0.40021457627326734 ], "actual_log_return": -0.001299483821510794, "feature_date": "2013-01-22", "target_date": "2013-01-23" }, { "feature_index": 797, "target_index": 798, "model": "sklearn", "probabilities": [ 0.05489412828604497, 0.478473074935524, 0.4666327967784311 ], "actual_log_return": -0.0038052975309712522, "feature_date": "2013-01-23", "target_date": "2013-01-24" }, { "feature_index": 798, "target_index": 799, "model": "sklearn", "probabilities": [ 0.05314053215306268, 0.49570985148026153, 0.45114961636667567 ], "actual_log_return": 0.007983831235204075, "feature_date": "2013-01-24", "target_date": "2013-01-25" }, { "feature_index": 799, "target_index": 800, "model": "sklearn", "probabilities": [ 0.05527977944132639, 0.4236976163146214, 0.5210226042440522 ], "actual_log_return": -0.00893636773795814, "feature_date": "2013-01-25", "target_date": "2013-01-28" }, { "feature_index": 800, "target_index": 801, "model": "sklearn", "probabilities": [ 0.05539260886053831, 0.5203685123674049, 0.42423887877205685 ], "actual_log_return": 0.0010021598583072056, "feature_date": "2013-01-28", "target_date": "2013-01-29" }, { "feature_index": 801, "target_index": 802, "model": "sklearn", "probabilities": [ 0.052967828250477994, 0.46984557164197865, 0.4771866001075434 ], "actual_log_return": 0.0027267017575858254, "feature_date": "2013-01-29", "target_date": "2013-01-30" }, { "feature_index": 802, "target_index": 803, "model": "sklearn", "probabilities": [ 0.05177827454478361, 0.4603843384256631, 0.4878373870295532 ], "actual_log_return": -0.0014662018241997643, "feature_date": "2013-01-30", "target_date": "2013-01-31" }, { "feature_index": 803, "target_index": 804, "model": "sklearn", "probabilities": [ 0.05208311020210878, 0.4851556551520156, 0.46276123464587565 ], "actual_log_return": -0.006662026591295778, "feature_date": "2013-01-31", "target_date": "2013-02-01" }, { "feature_index": 804, "target_index": 805, "model": "sklearn", "probabilities": [ 0.049645426549408726, 0.5175285757179404, 0.4328259977326509 ], "actual_log_return": -0.008122501589295616, "feature_date": "2013-02-01", "target_date": "2013-02-04" }, { "feature_index": 805, "target_index": 806, "model": "sklearn", "probabilities": [ 0.04963367934037918, 0.5262690817079169, 0.424097238951704 ], "actual_log_return": 0.007221631549112928, "feature_date": "2013-02-04", "target_date": "2013-02-05" }, { "feature_index": 806, "target_index": 807, "model": "sklearn", "probabilities": [ 0.052047826377143246, 0.43355896875113087, 0.5143932048717259 ], "actual_log_return": 0.006594917525906574, "feature_date": "2013-02-05", "target_date": "2013-02-06" }, { "feature_index": 807, "target_index": 808, "model": "sklearn", "probabilities": [ 0.0514843501437967, 0.4354186145881532, 0.5130970352680501 ], "actual_log_return": -0.001093032658405324, "feature_date": "2013-02-06", "target_date": "2013-02-07" }, { "feature_index": 808, "target_index": 809, "model": "sklearn", "probabilities": [ 0.05050674873832692, 0.48123271841896675, 0.4682605328427064 ], "actual_log_return": 0.0016718864857532267, "feature_date": "2013-02-07", "target_date": "2013-02-08" }, { "feature_index": 809, "target_index": 810, "model": "sklearn", "probabilities": [ 0.048527912683269725, 0.47459478757090295, 0.47687729974582743 ], "actual_log_return": 0.008410311282899041, "feature_date": "2013-02-08", "target_date": "2013-02-11" }, { "feature_index": 810, "target_index": 811, "model": "sklearn", "probabilities": [ 0.04322680840881779, 0.44314193624095916, 0.513631255350223 ], "actual_log_return": 0.005049635140377706, "feature_date": "2013-02-11", "target_date": "2013-02-12" }, { "feature_index": 811, "target_index": 812, "model": "sklearn", "probabilities": [ 0.04250431711628159, 0.46335146835208013, 0.4941442145316383 ], "actual_log_return": -0.0030115865226152394, "feature_date": "2013-02-12", "target_date": "2013-02-13" }, { "feature_index": 812, "target_index": 813, "model": "sklearn", "probabilities": [ 0.04313605812051587, 0.5093400694479852, 0.447523872431499 ], "actual_log_return": -0.0026397392796040364, "feature_date": "2013-02-13", "target_date": "2013-02-14" }, { "feature_index": 813, "target_index": 814, "model": "sklearn", "probabilities": [ 0.04507044289798484, 0.5056647816368964, 0.44926477546511867 ], "actual_log_return": 0.015405340636689857, "feature_date": "2013-02-14", "target_date": "2013-02-15" }, { "feature_index": 814, "target_index": 815, "model": "sklearn", "probabilities": [ 0.045802914608478996, 0.39427009247619277, 0.5599269929153282 ], "actual_log_return": 0.0004749662240213226, "feature_date": "2013-02-15", "target_date": "2013-02-18" }, { "feature_index": 815, "target_index": 816, "model": "sklearn", "probabilities": [ 0.045828815677595246, 0.4795762773232385, 0.47459490699916634 ], "actual_log_return": -0.001038629598505647, "feature_date": "2013-02-18", "target_date": "2013-02-19" }, { "feature_index": 816, "target_index": 817, "model": "sklearn", "probabilities": [ 0.0454182994408499, 0.49060787921450827, 0.4639738213446417 ], "actual_log_return": -0.00039426313849100225, "feature_date": "2013-02-19", "target_date": "2013-02-20" }, { "feature_index": 817, "target_index": 818, "model": "sklearn", "probabilities": [ 0.04489897962275761, 0.4880549100026536, 0.4670461103745888 ], "actual_log_return": 0.005160359275083515, "feature_date": "2013-02-20", "target_date": "2013-02-21" }, { "feature_index": 818, "target_index": 819, "model": "sklearn", "probabilities": [ 0.0430280058125379, 0.4587456918878348, 0.49822630229962717 ], "actual_log_return": 0.029240177093992514, "feature_date": "2013-02-21", "target_date": "2013-02-22" }, { "feature_index": 819, "target_index": 820, "model": "sklearn", "probabilities": [ 0.04267128573193629, 0.308363112546961, 0.6489656017211027 ], "actual_log_return": -0.015619583212841182, "feature_date": "2013-02-22", "target_date": "2013-02-25" }, { "feature_index": 820, "target_index": 821, "model": "sklearn", "probabilities": [ 0.05084855962277482, 0.5452331784508815, 0.4039182619263437 ], "actual_log_return": -0.004529871897656523, "feature_date": "2013-02-25", "target_date": "2013-02-26" }, { "feature_index": 821, "target_index": 822, "model": "sklearn", "probabilities": [ 0.052954601504227025, 0.47947002696586094, 0.467575371529912 ], "actual_log_return": -0.06609933390297007, "feature_date": "2013-02-26", "target_date": "2013-02-27" }, { "feature_index": 822, "target_index": 823, "model": "sklearn", "probabilities": [ 0.08156407939622498, 0.7087725226132484, 0.20966339799052663 ], "actual_log_return": 0.013209448767736554, "feature_date": "2013-02-27", "target_date": "2013-02-28" }, { "feature_index": 823, "target_index": 824, "model": "sklearn", "probabilities": [ 0.09077855578649399, 0.2988167534494993, 0.6104046907640067 ], "actual_log_return": -0.03247510287938926, "feature_date": "2013-02-28", "target_date": "2013-03-01" }, { "feature_index": 824, "target_index": 825, "model": "sklearn", "probabilities": [ 0.07628594131629969, 0.5549785440666147, 0.36873551461708565 ], "actual_log_return": -0.0005769868314806637, "feature_date": "2013-03-01", "target_date": "2013-03-04" }, { "feature_index": 825, "target_index": 826, "model": "sklearn", "probabilities": [ 0.08069294842626622, 0.3752405613534016, 0.5440664902203322 ], "actual_log_return": 0.0032786438600700407, "feature_date": "2013-03-04", "target_date": "2013-03-05" }, { "feature_index": 826, "target_index": 827, "model": "sklearn", "probabilities": [ 0.08360994556437663, 0.35239048671946827, 0.5639995677161551 ], "actual_log_return": 0.0020973944701001557, "feature_date": "2013-03-05", "target_date": "2013-03-06" }, { "feature_index": 827, "target_index": 828, "model": "sklearn", "probabilities": [ 0.04746187440692486, 0.40884713683756546, 0.5436909887555098 ], "actual_log_return": -0.011371963279588115, "feature_date": "2013-03-06", "target_date": "2013-03-07" }, { "feature_index": 828, "target_index": 829, "model": "sklearn", "probabilities": [ 0.04464310917318751, 0.49021510634219717, 0.4651417844846153 ], "actual_log_return": 0.004168633199146843, "feature_date": "2013-03-07", "target_date": "2013-03-08" }, { "feature_index": 829, "target_index": 830, "model": "sklearn", "probabilities": [ 0.032308614084912396, 0.42633623067653326, 0.5413551552385544 ], "actual_log_return": 0.006580797986464049, "feature_date": "2013-03-08", "target_date": "2013-03-11" }, { "feature_index": 830, "target_index": 831, "model": "sklearn", "probabilities": [ 0.03297789773683792, 0.4114347535530307, 0.5555873487101314 ], "actual_log_return": 0.007975384069169422, "feature_date": "2013-03-11", "target_date": "2013-03-12" }, { "feature_index": 831, "target_index": 832, "model": "sklearn", "probabilities": [ 0.03277591186992907, 0.40258125112720317, 0.5646428370028678 ], "actual_log_return": 0.008642565540442515, "feature_date": "2013-03-12", "target_date": "2013-03-13" }, { "feature_index": 832, "target_index": 833, "model": "sklearn", "probabilities": [ 0.031597064923588186, 0.3985157657658488, 0.5698871693105629 ], "actual_log_return": -0.0037973076630040126, "feature_date": "2013-03-13", "target_date": "2013-03-14" }, { "feature_index": 833, "target_index": 834, "model": "sklearn", "probabilities": [ 0.028658480285434863, 0.4793573638156962, 0.49198415589886885 ], "actual_log_return": 0.00901451125364261, "feature_date": "2013-03-14", "target_date": "2013-03-15" }, { "feature_index": 834, "target_index": 835, "model": "sklearn", "probabilities": [ 0.029246726312195118, 0.4049033396988214, 0.5658499339889835 ], "actual_log_return": 0.023004656154537173, "feature_date": "2013-03-15", "target_date": "2013-03-18" }, { "feature_index": 835, "target_index": 836, "model": "sklearn", "probabilities": [ 0.029257377956424708, 0.3194422190375226, 0.6513004030060527 ], "actual_log_return": 0.0025318732332153537, "feature_date": "2013-03-18", "target_date": "2013-03-19" }, { "feature_index": 836, "target_index": 837, "model": "sklearn", "probabilities": [ 0.03061938650300271, 0.43133693753954516, 0.5380436759574522 ], "actual_log_return": 0.00952155023332013, "feature_date": "2013-03-19", "target_date": "2013-03-20" }, { "feature_index": 837, "target_index": 838, "model": "sklearn", "probabilities": [ 0.02897654845096632, 0.3918043723177997, 0.5792190792312341 ], "actual_log_return": 0.002803700505679796, "feature_date": "2013-03-20", "target_date": "2013-03-21" }, { "feature_index": 838, "target_index": 839, "model": "sklearn", "probabilities": [ 0.027746825346068416, 0.43494702096098864, 0.5373061536929429 ], "actual_log_return": -0.007355004197028947, "feature_date": "2013-03-21", "target_date": "2013-03-22" }, { "feature_index": 839, "target_index": 840, "model": "sklearn", "probabilities": [ 0.035108224099578915, 0.4870827358085411, 0.47780904009188 ], "actual_log_return": -0.01149325772301868, "feature_date": "2013-03-22", "target_date": "2013-03-25" }, { "feature_index": 840, "target_index": 841, "model": "sklearn", "probabilities": [ 0.031096196624209118, 0.5170063509421172, 0.4518974524336737 ], "actual_log_return": 0.0034932291958926776, "feature_date": "2013-03-25", "target_date": "2013-03-26" }, { "feature_index": 841, "target_index": 842, "model": "sklearn", "probabilities": [ 0.03015020674156114, 0.4297116279492902, 0.5401381653091487 ], "actual_log_return": -0.0081727102714102, "feature_date": "2013-03-26", "target_date": "2013-03-27" }, { "feature_index": 842, "target_index": 843, "model": "sklearn", "probabilities": [ 0.03072445951939976, 0.5243055716102705, 0.4449699688703298 ], "actual_log_return": -0.004268134466643758, "feature_date": "2013-03-27", "target_date": "2013-03-28" }, { "feature_index": 843, "target_index": 844, "model": "sklearn", "probabilities": [ 0.031185694411674986, 0.5038493899077517, 0.4649649156805733 ], "actual_log_return": -0.00022048825812825967, "feature_date": "2013-03-28", "target_date": "2013-03-29" }, { "feature_index": 844, "target_index": 845, "model": "sklearn", "probabilities": [ 0.03207875588718571, 0.4895893125639343, 0.47833193154888004 ], "actual_log_return": 0.011398107587334838, "feature_date": "2013-03-29", "target_date": "2013-04-01" }, { "feature_index": 845, "target_index": 846, "model": "sklearn", "probabilities": [ 0.03240386473457784, 0.4196326898221924, 0.5479634454432297 ], "actual_log_return": 0.012961579090318143, "feature_date": "2013-04-01", "target_date": "2013-04-02" }, { "feature_index": 846, "target_index": 847, "model": "sklearn", "probabilities": [ 0.032977046569467136, 0.4065232654300032, 0.5604996880005296 ], "actual_log_return": 0.004227857831053061, "feature_date": "2013-04-02", "target_date": "2013-04-03" }, { "feature_index": 847, "target_index": 848, "model": "sklearn", "probabilities": [ 0.03069897709950982, 0.46340167280237415, 0.505899350098116 ], "actual_log_return": 0.011076923954870477, "feature_date": "2013-04-03", "target_date": "2013-04-04" }, { "feature_index": 848, "target_index": 849, "model": "sklearn", "probabilities": [ 0.027226810103776426, 0.4318038788875279, 0.5409693110086956 ], "actual_log_return": -0.0011692398240605861, "feature_date": "2013-04-04", "target_date": "2013-04-05" }, { "feature_index": 849, "target_index": 850, "model": "sklearn", "probabilities": [ 0.0279952078042239, 0.5022227035777667, 0.46978208861800935 ], "actual_log_return": -0.00036693233333551234, "feature_date": "2013-04-05", "target_date": "2013-04-08" }, { "feature_index": 850, "target_index": 851, "model": "sklearn", "probabilities": [ 0.02883190268922032, 0.4950669484926946, 0.4761011488180851 ], "actual_log_return": -0.0014723695224527766, "feature_date": "2013-04-08", "target_date": "2013-04-09" }, { "feature_index": 851, "target_index": 852, "model": "sklearn", "probabilities": [ 0.02813290868206137, 0.5031263259789133, 0.46874076533902537 ], "actual_log_return": -0.004040785058860852, "feature_date": "2013-04-09", "target_date": "2013-04-10" }, { "feature_index": 852, "target_index": 853, "model": "sklearn", "probabilities": [ 0.029699970884867255, 0.515247625096107, 0.4550524040190258 ], "actual_log_return": 0.004532116478146442, "feature_date": "2013-04-10", "target_date": "2013-04-11" }, { "feature_index": 853, "target_index": 854, "model": "sklearn", "probabilities": [ 0.02604826143152846, 0.4726030288004229, 0.5013487097680486 ], "actual_log_return": 0.007825187688450086, "feature_date": "2013-04-11", "target_date": "2013-04-12" }, { "feature_index": 854, "target_index": 855, "model": "sklearn", "probabilities": [ 0.027691437817850415, 0.4498290898531782, 0.5224794723289713 ], "actual_log_return": 0.014668207023670998, "feature_date": "2013-04-12", "target_date": "2013-04-15" }, { "feature_index": 855, "target_index": 856, "model": "sklearn", "probabilities": [ 0.03174563945767405, 0.4068290158922664, 0.5614253446500596 ], "actual_log_return": -0.027676863608109947, "feature_date": "2013-04-15", "target_date": "2013-04-16" }, { "feature_index": 856, "target_index": 857, "model": "sklearn", "probabilities": [ 0.04327467811282038, 0.6137666033213575, 0.3429587185658222 ], "actual_log_return": 0.011402960810921847, "feature_date": "2013-04-16", "target_date": "2013-04-17" }, { "feature_index": 857, "target_index": 858, "model": "sklearn", "probabilities": [ 0.04546396781473786, 0.390476943982323, 0.5640590882029392 ], "actual_log_return": 0.009154644971172132, "feature_date": "2013-04-17", "target_date": "2013-04-18" }, { "feature_index": 858, "target_index": 859, "model": "sklearn", "probabilities": [ 0.044579533017955, 0.4029976951532779, 0.5524227718287671 ], "actual_log_return": -0.006301622320841194, "feature_date": "2013-04-18", "target_date": "2013-04-19" }, { "feature_index": 859, "target_index": 860, "model": "sklearn", "probabilities": [ 0.045054375219774144, 0.4903820318854526, 0.46456359289477334 ], "actual_log_return": 0.023230607317249685, "feature_date": "2013-04-19", "target_date": "2013-04-22" }, { "feature_index": 860, "target_index": 861, "model": "sklearn", "probabilities": [ 0.040101104893375206, 0.322416789596649, 0.6374821055099759 ], "actual_log_return": 0.028711957344361938, "feature_date": "2013-04-22", "target_date": "2013-04-23" }, { "feature_index": 861, "target_index": 862, "model": "sklearn", "probabilities": [ 0.029236295310413545, 0.30855082652697124, 0.6622128781626152 ], "actual_log_return": 0.03815197728431041, "feature_date": "2013-04-23", "target_date": "2013-04-24" }, { "feature_index": 862, "target_index": 863, "model": "sklearn", "probabilities": [ 0.026906375432454072, 0.25448409800450855, 0.7186095265630373 ], "actual_log_return": -0.00028086403069593757, "feature_date": "2013-04-24", "target_date": "2013-04-25" }, { "feature_index": 863, "target_index": 864, "model": "sklearn", "probabilities": [ 0.031601299494094244, 0.4548443311490181, 0.5135543693568876 ], "actual_log_return": -0.00338588522266825, "feature_date": "2013-04-25", "target_date": "2013-04-26" }, { "feature_index": 864, "target_index": 865, "model": "sklearn", "probabilities": [ 0.03102223796834058, 0.4748637031406306, 0.4941140588910289 ], "actual_log_return": -0.0007707952432767229, "feature_date": "2013-04-26", "target_date": "2013-04-29" }, { "feature_index": 865, "target_index": 866, "model": "sklearn", "probabilities": [ 0.03292566497975671, 0.45420220390232474, 0.5128721311179186 ], "actual_log_return": 0.008916235586733823, "feature_date": "2013-04-29", "target_date": "2013-04-30" }, { "feature_index": 866, "target_index": 867, "model": "sklearn", "probabilities": [ 0.029787407413116057, 0.4030783490490566, 0.5671342435378274 ], "actual_log_return": 0.013339216723054825, "feature_date": "2013-04-30", "target_date": "2013-05-01" }, { "feature_index": 867, "target_index": 868, "model": "sklearn", "probabilities": [ 0.01943526336811312, 0.4007337233395423, 0.5798310132923447 ], "actual_log_return": -0.002740360992005808, "feature_date": "2013-05-01", "target_date": "2013-05-02" }, { "feature_index": 868, "target_index": 869, "model": "sklearn", "probabilities": [ 0.020747091626940824, 0.4930410977646801, 0.48621181060837915 ], "actual_log_return": 0.00639178383506156, "feature_date": "2013-05-02", "target_date": "2013-05-03" }, { "feature_index": 869, "target_index": 870, "model": "sklearn", "probabilities": [ 0.0197317758924186, 0.442420792927982, 0.5378474311795994 ], "actual_log_return": 0.003196552999926716, "feature_date": "2013-05-03", "target_date": "2013-05-06" }, { "feature_index": 870, "target_index": 871, "model": "sklearn", "probabilities": [ 0.019187723217164245, 0.46346581336491305, 0.5173464634179227 ], "actual_log_return": -0.004629101871496566, "feature_date": "2013-05-06", "target_date": "2013-05-07" }, { "feature_index": 871, "target_index": 872, "model": "sklearn", "probabilities": [ 0.020083851002092663, 0.5055736547029126, 0.47434249429499475 ], "actual_log_return": -0.010073723121199585, "feature_date": "2013-05-07", "target_date": "2013-05-08" }, { "feature_index": 872, "target_index": 873, "model": "sklearn", "probabilities": [ 0.019527768084225534, 0.5368235458619074, 0.44364868605386704 ], "actual_log_return": 0.002267804722869471, "feature_date": "2013-05-08", "target_date": "2013-05-09" }, { "feature_index": 873, "target_index": 874, "model": "sklearn", "probabilities": [ 0.019911846783440455, 0.46339688351813496, 0.5166912696984246 ], "actual_log_return": 0.008452586173142596, "feature_date": "2013-05-09", "target_date": "2013-05-10" }, { "feature_index": 874, "target_index": 875, "model": "sklearn", "probabilities": [ 0.019982268211920822, 0.42602752703143426, 0.553990204756645 ], "actual_log_return": -0.0022576360080832636, "feature_date": "2013-05-10", "target_date": "2013-05-13" }, { "feature_index": 875, "target_index": 876, "model": "sklearn", "probabilities": [ 0.020935287475149354, 0.4887868570500013, 0.49027785547484937 ], "actual_log_return": -0.0005376077543410851, "feature_date": "2013-05-13", "target_date": "2013-05-14" }, { "feature_index": 876, "target_index": 877, "model": "sklearn", "probabilities": [ 0.020707085941789133, 0.4866991698514381, 0.49259374420677265 ], "actual_log_return": -0.04305868910015054, "feature_date": "2013-05-14", "target_date": "2013-05-15" }, { "feature_index": 877, "target_index": 878, "model": "sklearn", "probabilities": [ 0.03339816472812501, 0.6729753264235266, 0.29362650884834846 ], "actual_log_return": 0.00013564723040149218, "feature_date": "2013-05-15", "target_date": "2013-05-16" }, { "feature_index": 878, "target_index": 879, "model": "sklearn", "probabilities": [ 0.03717386648028043, 0.42940997212054116, 0.5334161613991785 ], "actual_log_return": -0.008754132313285368, "feature_date": "2013-05-16", "target_date": "2013-05-17" }, { "feature_index": 879, "target_index": 880, "model": "sklearn", "probabilities": [ 0.034729711422850904, 0.4848968594203218, 0.48037342915682735 ], "actual_log_return": -0.010125154684096138, "feature_date": "2013-05-17", "target_date": "2013-05-20" }, { "feature_index": 880, "target_index": 881, "model": "sklearn", "probabilities": [ 0.03827532990230732, 0.4926325344965943, 0.46909213560109847 ], "actual_log_return": -0.0045579553568053655, "feature_date": "2013-05-20", "target_date": "2013-05-21" }, { "feature_index": 881, "target_index": 882, "model": "sklearn", "probabilities": [ 0.04327813677397453, 0.462326597208297, 0.49439526601772854 ], "actual_log_return": -0.015548762072359779, "feature_date": "2013-05-21", "target_date": "2013-05-22" }, { "feature_index": 882, "target_index": 883, "model": "sklearn", "probabilities": [ 0.03748388993625611, 0.5614241328567214, 0.4010919772070225 ], "actual_log_return": -0.004280026136748827, "feature_date": "2013-05-22", "target_date": "2013-05-23" }, { "feature_index": 883, "target_index": 884, "model": "sklearn", "probabilities": [ 0.03687529724356461, 0.49902289143386597, 0.4641018113225694 ], "actual_log_return": 0.012875780997356756, "feature_date": "2013-05-23", "target_date": "2013-05-24" }, { "feature_index": 884, "target_index": 885, "model": "sklearn", "probabilities": [ 0.042652298216062604, 0.38536482953363094, 0.5719828722503064 ], "actual_log_return": 0.025587987408087542, "feature_date": "2013-05-24", "target_date": "2013-05-27" }, { "feature_index": 885, "target_index": 886, "model": "sklearn", "probabilities": [ 0.04383971822429789, 0.30508039682784494, 0.6510798849478571 ], "actual_log_return": -0.02949991753805925, "feature_date": "2013-05-27", "target_date": "2013-05-28" }, { "feature_index": 886, "target_index": 887, "model": "sklearn", "probabilities": [ 0.0602872607956579, 0.5854131527049682, 0.3542995864993739 ], "actual_log_return": -0.016298382055648375, "feature_date": "2013-05-28", "target_date": "2013-05-29" }, { "feature_index": 887, "target_index": 888, "model": "sklearn", "probabilities": [ 0.06974098804004383, 0.5070831140341642, 0.423175897925792 ], "actual_log_return": -0.010838588026794937, "feature_date": "2013-05-29", "target_date": "2013-05-30" }, { "feature_index": 888, "target_index": 889, "model": "sklearn", "probabilities": [ 0.0731449204003275, 0.4730756527214817, 0.45377942687819084 ], "actual_log_return": 0.004823784533585673, "feature_date": "2013-05-30", "target_date": "2013-05-31" }, { "feature_index": 889, "target_index": 890, "model": "sklearn", "probabilities": [ 0.06909415030237914, 0.3896146188735188, 0.541291230824102 ], "actual_log_return": 0.021435897212962907, "feature_date": "2013-05-31", "target_date": "2013-06-03" }, { "feature_index": 890, "target_index": 891, "model": "sklearn", "probabilities": [ 0.055737613344300885, 0.30681924048180204, 0.637443146173897 ], "actual_log_return": 0.008064592829082784, "feature_date": "2013-06-03", "target_date": "2013-06-04" }, { "feature_index": 891, "target_index": 892, "model": "sklearn", "probabilities": [ 0.04790705216483734, 0.39153657291006, 0.5605563749251027 ], "actual_log_return": -0.03778592533960712, "feature_date": "2013-06-04", "target_date": "2013-06-05" }, { "feature_index": 892, "target_index": 893, "model": "sklearn", "probabilities": [ 0.06336147207569512, 0.6165145213655872, 0.3201240065587177 ], "actual_log_return": -0.03465589805099034, "feature_date": "2013-06-05", "target_date": "2013-06-06" }, { "feature_index": 893, "target_index": 894, "model": "sklearn", "probabilities": [ 0.08245331600089224, 0.5747878108201715, 0.3427588731789362 ], "actual_log_return": 0.007769170429259287, "feature_date": "2013-06-06", "target_date": "2013-06-07" }, { "feature_index": 894, "target_index": 895, "model": "sklearn", "probabilities": [ 0.08433532589946163, 0.3428158237162023, 0.5728488503843361 ], "actual_log_return": 0.010301962126210817, "feature_date": "2013-06-07", "target_date": "2013-06-10" }, { "feature_index": 895, "target_index": 896, "model": "sklearn", "probabilities": [ 0.07160324723558423, 0.3377561715890583, 0.5906405811753574 ], "actual_log_return": 0.0007587036398315483, "feature_date": "2013-06-10", "target_date": "2013-06-11" }, { "feature_index": 896, "target_index": 897, "model": "sklearn", "probabilities": [ 0.06956580025575697, 0.39136751836089073, 0.5390666813833522 ], "actual_log_return": 0.000452531640800391, "feature_date": "2013-06-11", "target_date": "2013-06-12" }, { "feature_index": 897, "target_index": 898, "model": "sklearn", "probabilities": [ 0.05609685266039952, 0.4189779754816514, 0.5249251718579491 ], "actual_log_return": -0.007928215616012313, "feature_date": "2013-06-12", "target_date": "2013-06-13" }, { "feature_index": 898, "target_index": 899, "model": "sklearn", "probabilities": [ 0.03947762238282968, 0.4993996829659786, 0.46112269465119177 ], "actual_log_return": -0.0025723066734886224, "feature_date": "2013-06-13", "target_date": "2013-06-14" } ], "candidate_metrics": { "empirical": { "log_loss": 0.8976549845951967, "brier_multiclass": 0.5546397017834356, "downside_brier": 0.05675962280703449, "up_brier": 0.250047919795584, "accuracy": 0.5080213903743316, "reliability": [ { "event": "downside", "low": 0.0, "n": 187, "predicted": 0.02145641810079329, "observed": 0.058823529411764705 }, { "event": "up", "low": 0.4, "n": 187, "predicted": 0.4974259904705341, "observed": 0.5080213903743316 } ], "observations": 187 }, "ridge": { "log_loss": 0.8850477821404265, "brier_multiclass": 0.5578947326464755, "downside_brier": 0.05578013440081525, "up_brier": 0.2517493228544951, "accuracy": 0.48663101604278075, "reliability": [ { "event": "downside", "low": 0.0, "n": 187, "predicted": 0.034151555540328796, "observed": 0.058823529411764705 }, { "event": "up", "low": 0.30000000000000004, "n": 4, "predicted": 0.36986647600404987, "observed": 0.75 }, { "event": "up", "low": 0.4, "n": 155, "predicted": 0.4686886798788017, "observed": 0.5096774193548387 }, { "event": "up", "low": 0.5, "n": 28, "predicted": 0.5126323993529015, "observed": 0.4642857142857143 } ], "observations": 187 }, "sklearn": { "log_loss": 0.8819989945476127, "brier_multiclass": 0.5615010843597219, "downside_brier": 0.05484892449095197, "up_brier": 0.2556621104132483, "accuracy": 0.4919786096256685, "reliability": [ { "event": "downside", "low": 0.0, "n": 186, "predicted": 0.04069954682089957, "observed": 0.05913978494623656 }, { "event": "downside", "low": 0.1, "n": 1, "predicted": 0.10074785896607365, "observed": 0.0 }, { "event": "up", "low": 0.1, "n": 1, "predicted": 0.19058377124901116, "observed": 1.0 }, { "event": "up", "low": 0.2, "n": 2, "predicted": 0.2516449534194375, "observed": 1.0 }, { "event": "up", "low": 0.30000000000000004, "n": 9, "predicted": 0.352593685481039, "observed": 0.3333333333333333 }, { "event": "up", "low": 0.4, "n": 86, "predicted": 0.4629626622729123, "observed": 0.46511627906976744 }, { "event": "up", "low": 0.5, "n": 75, "predicted": 0.5387277824347941, "observed": 0.5733333333333334 }, { "event": "up", "low": 0.6000000000000001, "n": 12, "predicted": 0.6519647401272267, "observed": 0.4166666666666667 }, { "event": "up", "low": 0.7000000000000001, "n": 2, "predicted": 0.7124645788222663, "observed": 0.5 } ], "observations": 187 }, "xgboost": { "log_loss": 0.904153850360098, "brier_multiclass": 0.5722693771689493, "downside_brier": 0.05804244951955556, "up_brier": 0.2584999242525161, "accuracy": 0.49732620320855614, "reliability": [ { "event": "downside", "low": 0.0, "n": 128, "predicted": 0.07052214032043262, "observed": 0.0390625 }, { "event": "downside", "low": 0.1, "n": 54, "predicted": 0.1424034803564325, "observed": 0.1111111111111111 }, { "event": "downside", "low": 0.2, "n": 5, "predicted": 0.22744779170308266, "observed": 0.0 }, { "event": "up", "low": 0.1, "n": 1, "predicted": 0.19354041834055125, "observed": 0.0 }, { "event": "up", "low": 0.2, "n": 31, "predicted": 0.26867286494268977, "observed": 0.5161290322580645 }, { "event": "up", "low": 0.30000000000000004, "n": 26, "predicted": 0.34700832692934597, "observed": 0.46153846153846156 }, { "event": "up", "low": 0.4, "n": 47, "predicted": 0.459637152081496, "observed": 0.48936170212765956 }, { "event": "up", "low": 0.5, "n": 66, "predicted": 0.5433399470351749, "observed": 0.5303030303030303 }, { "event": "up", "low": 0.6000000000000001, "n": 15, "predicted": 0.6408319881438167, "observed": 0.5333333333333333 }, { "event": "up", "low": 0.7000000000000001, "n": 1, "predicted": 0.7096106251416215, "observed": 1.0 } ], "observations": 187 }, "lightgbm": { "log_loss": 0.9188541133765288, "brier_multiclass": 0.5761430351086378, "downside_brier": 0.06094536984036942, "up_brier": 0.2575944221797919, "accuracy": 0.48663101604278075, "reliability": [ { "event": "downside", "low": 0.0, "n": 131, "predicted": 0.07413068148600695, "observed": 0.07633587786259542 }, { "event": "downside", "low": 0.1, "n": 48, "predicted": 0.1291853649567808, "observed": 0.020833333333333332 }, { "event": "downside", "low": 0.2, "n": 7, "predicted": 0.2207312575028301, "observed": 0.0 }, { "event": "downside", "low": 0.30000000000000004, "n": 1, "predicted": 0.3927628536458307, "observed": 0.0 }, { "event": "up", "low": 0.1, "n": 1, "predicted": 0.1917225613598784, "observed": 0.0 }, { "event": "up", "low": 0.2, "n": 16, "predicted": 0.2695651560336283, "observed": 0.625 }, { "event": "up", "low": 0.30000000000000004, "n": 25, "predicted": 0.35923879553000404, "observed": 0.36 }, { "event": "up", "low": 0.4, "n": 72, "predicted": 0.44930961464041075, "observed": 0.5138888888888888 }, { "event": "up", "low": 0.5, "n": 68, "predicted": 0.5432818289113869, "observed": 0.5294117647058824 }, { "event": "up", "low": 0.6000000000000001, "n": 5, "predicted": 0.6395101908336948, "observed": 0.6 } ], "observations": 187 } }, "selected_metrics": { "log_loss": 0.8819989945476127, "brier_multiclass": 0.5615010843597219, "downside_brier": 0.05484892449095197, "up_brier": 0.2556621104132483, "accuracy": 0.4919786096256685, "reliability": [ { "event": "downside", "low": 0.0, "n": 186, "predicted": 0.04069954682089957, "observed": 0.05913978494623656 }, { "event": "downside", "low": 0.1, "n": 1, "predicted": 0.10074785896607365, "observed": 0.0 }, { "event": "up", "low": 0.1, "n": 1, "predicted": 0.19058377124901116, "observed": 1.0 }, { "event": "up", "low": 0.2, "n": 2, "predicted": 0.2516449534194375, "observed": 1.0 }, { "event": "up", "low": 0.30000000000000004, "n": 9, "predicted": 0.352593685481039, "observed": 0.3333333333333333 }, { "event": "up", "low": 0.4, "n": 86, "predicted": 0.4629626622729123, "observed": 0.46511627906976744 }, { "event": "up", "low": 0.5, "n": 75, "predicted": 0.5387277824347941, "observed": 0.5733333333333334 }, { "event": "up", "low": 0.6000000000000001, "n": 12, "predicted": 0.6519647401272267, "observed": 0.4166666666666667 }, { "event": "up", "low": 0.7000000000000001, "n": 2, "predicted": 0.7124645788222663, "observed": 0.5 } ] }, "latest_forecast": { "feature_index": 899, "target_index": 900, "model": "sklearn", "probabilities": [ 0.07710358574839352, 0.45911361327374317, 0.4637828009778633 ], "candidate_probabilities": { "empirical": [ 0.08788636483802593, 0.45054522154486915, 0.461568413617105 ], "ridge": [ 0.056964525592340304, 0.4717304928265192, 0.4713049815811406 ], "sklearn": [ 0.07710358574839352, 0.45911361327374317, 0.4637828009778633 ], "xgboost": [ 0.06650447149950614, 0.413444939355887, 0.5200505891446068 ], "lightgbm": [ 0.058733723716268865, 0.4571361807201125, 0.4841300955636185 ] }, "target_date": null, "target": "next observed close; future date not assumed", "calibration_log_loss": { "empirical": 0.894171828938718, "ridge": 0.8944883594892606, "sklearn": 0.8926055725601459, "xgboost": 0.9306702922991008, "lightgbm": 0.9378541571963137 }, "temperatures": { "empirical": 1.5, "ridge": 1.0, "sklearn": 1.5, "xgboost": 1.0, "lightgbm": 1.5 }, "train_label_end": 747, "calibration_feature_start": 748, "calibration_label_end": 898, "feature_date": "2013-06-14" }, "model_status": { "empirical": { "status": "available" }, "ridge": { "status": "available" }, "sklearn": { "status": "available", "version": "1.9.1", "last_fit_status": "fitted" }, "xgboost": { "status": "available", "version": "2.1.4", "last_fit_status": "fitted" }, "lightgbm": { "status": "available", "version": "4.7.0", "last_fit_status": "fitted" } }, "tuning_trials": [ { "trial": 0, "params": { "reg_lambda": 0.5611516415334505, "subsample": 0.9852142919229748 }, "training_validation_log_loss": 0.8139191365916344, "fit_rows": [ 0, 349 ], "validation_rows": [ 351, 499 ] }, { "trial": 1, "params": { "reg_lambda": 2.9106359131330697, "subsample": 0.8795975452591109 }, "training_validation_log_loss": 0.8007507433857203, "fit_rows": [ 0, 349 ], "validation_rows": [ 351, 499 ] }, { "trial": 2, "params": { "reg_lambda": 0.20513382630874505, "subsample": 0.7467983561008608 }, "training_validation_log_loss": 0.7988179582963656, "fit_rows": [ 0, 349 ], "validation_rows": [ 351, 499 ] } ], "shap_explanation": { "status": "computed", "model": "xgboost", "space": "raw class margins; not probabilities or causal effects", "feature_names": [ "return_1", "momentum_5", "momentum_20", "volatility_5", "volatility_20", "drawdown_60" ], "values": [ [ [ 0.0037983967922627926, -0.07085804641246796, 0.06568044424057007 ], [ -0.08853624016046524, 0.055732082575559616, -0.0017867246642708778 ], [ -0.015308678150177002, -0.03827173262834549, 0.016187049448490143 ], [ -0.09384919703006744, 0.022410960868000984, -0.004481995478272438 ], [ 0.010052535682916641, -0.10409951955080032, 0.05012021213769913 ], [ -0.037612851709127426, 0.023464186117053032, -0.050508223474025726 ] ] ], "base_values": [ [ -0.8218691349029541, 0.8955520391464233, 0.9381208419799805 ] ], "shape": [ 1, 6, 3 ], "calibration_note": "SHAP explains the uncalibrated tree; displayed probabilities apply temperature separately." }, "limitations": [ "Backtest probabilities are research estimates, not validated economic edge.", "Calendar gaps change forecast horizon; target is the next observed close.", "Candidate metrics may cover different rows when a backend fails or lacks classes; inspect observations.", "Calibration selects temperature and model on the same block; outer test remains untouched.", "Latest classifier predicts categories; it does not estimate a full return distribution.", "No costs, execution, position sizing, TFT, DeepSurv, or PPO model is represented." ], "mlflow": { "status": "FINISHED", "run_id": "03d7037ba34044bc89cb72e07e72496c", "metrics": { "up_brier": 0.2556621104132483, "accuracy": 0.4919786096256685, "log_loss": 0.8819989945476127, "brier_multiclass": 0.5615010843597219, "downside_brier": 0.05484892449095197 }, "params": { "latest_model": "sklearn", "target": "next_observed_close", "rows": "900", "threshold_log_return": "-0.02" }, "tracking": "request-local filesystem; no remote server or persistent history" }, "source": { "synthetic": true, "name": "Synthetic regime-switching returns", "seed": 42, "calendar_gaps": { "max_gap_days": 3, "gaps_over_three_days": 0, "missing_weekdays": 0, "missing_weekday_examples": [], "interpretation": "Weekdays include market holidays; gaps do not by themselves prove missing observations." }, "rows": 900, "return_definition": "Next-observed-close log return; uploaded prices are assumed consistently adjusted." }, "diagnostics": { "return_count": 899, "mean_log_return": -0.0008402600815684142, "std_log_return": 0.012624885594658426, "normality": { "skew": -1.1844874781966723, "excess_kurtosis": 12.135797219309909, "jarque_bera_statistic": 5659.16309054447, "p_value": 0.0, "interpretation": "Jarque\u2013Bera tests normality, not independence. Its asymptotic p-value assumes IID observations; serial dependence can invalidate it." }, "ols_hac": { "target": "r[t] = intercept + beta * r[t-1]", "scope": "Full-history in-sample exploratory inference; no out-of-sample forecasting validity claim.", "covariance": "HAC/Newey\u2013West, 5 lags, asymptotic normal inference", "observations": 898, "coefficients": [ -0.0007943860881134062, 0.061542152678801844 ], "standard_errors": [ 0.00041491548828058493, 0.045293436330417276 ], "p_values": [ 0.05554695134876272, 0.17422794929611607 ], "confidence_intervals": [ [ -0.0016076055017712036, 1.883332554439114e-05 ], [ -0.027231351264874047, 0.15031565662247773 ] ], "r_squared": 0.0037880558289116184 }, "arima": { "order": [ 1, 0, 0 ], "target": "Next close-to-close log return", "scope": "Full-history fitted demonstration. Forecast is unvalidated; excluded from out-of-sample model rankings.", "forecast_log_return": -0.0009487068757379988, "interval_95": [ -0.02562380599807545, 0.02372639224659945 ], "interval_assumptions": "Conditional Gaussian ARIMA innovation assumptions; parameter uncertainty omitted.", "converged": true, "warnings": [], "aic": -5308.166445431854, "parameters": { "const": -0.0008422346479162286, "ar.L1": 0.061542078160904276, "sigma2": 0.0001584972129382768 } } }, "precomputed": true, "execution_note": "Precomputed by Python on synthetic data; this static site does not run XGBoost, LightGBM, Optuna, SHAP or MLflow.", "benchmark_date": "2026-10-25"}12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>12345678910111213141516171819202122232425262728293031323334353637383940<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#f2f4f7"><meta name="description" content="Browser-local probability research with chronological validation and a reproducible Python benchmark."><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; worker-src 'self'; connect-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'none'"><title>QuantLab · probability research</title><link rel="stylesheet" href="style.css"><script src="labs.js" defer></script><script src="app.js" defer></script></head><body><a class="skip" href="#results">Skip to results</a><header><div><h1>QuantLab <span>/ probability research</span></h1><p>Forecast the next observed close. Inspect calibration before trusting conviction.</p></div><a class="source-link" href="python-project.zip" download>Download Python project ↗</a></header><nav aria-label="Research views"><button class="tab active" data-view="workbench" aria-pressed="true">Forecast workbench</button><button class="tab" data-view="mathematics" aria-pressed="false">Mathematics lab</button><button class="tab" data-view="methods" aria-pressed="false">Methods & limits</button></nav><main><section id="workbench" class="view"><aside><form id="experiment"><h2>Experiment setup</h2><p class="small">No paid compute. CSV data stays in your browser.</p><label for="data-source">Data source</label><select id="data-source"><option value="synthetic">Synthetic demo</option><option value="csv">Local CSV</option></select><label for="csv-file">CSV · date,close</label><input id="csv-file" type="file" accept=".csv,text/csv"><p class="hint">714–2,500 rows · 2 MiB maximum · adjusted closes · ascending ISO dates</p><label for="observations">Synthetic observations</label><input id="observations" type="number" min="850" max="2500" step="50" value="1200" required><label for="seed">Random seed</label><input id="seed" type="number" min="0" max="100000" step="1" value="42" required><div class="model-list"><h3>Browser models</h3><p>Empirical frequency<br>Ridge + Gaussian residuals<br>Multinomial logistic</p><span class="hint">Train → calibrate → unseen test.<br>Selection uses calibration scores only.</span></div><button id="run" class="primary" type="submit">Run chronological experiment</button></form><div class="benchmark-control"><h2>Python benchmark</h2><p class="small">Inspect a saved, verified run with scikit-learn, XGBoost, LightGBM, Optuna and SHAP.</p><button id="benchmark" class="secondary">Load precomputed benchmark</button><p class="hint">Synthetic data · 900 observations.<br>Python libraries do not run on this static host.</p></div></aside><div id="results" tabindex="-1"><div id="status" role="status" aria-live="polite">Preparing a browser-local synthetic experiment…</div><div class="stats" id="stats"><div><span>P(downside)</span><strong>—</strong></div><div><span>P(positive)</span><strong>—</strong></div><div><span>Test log loss</span><strong>—</strong></div><div><span>Unseen observations</span><strong>—</strong></div></div><div class="charts"><section class="plot"><h2>Next observed close</h2><p>Mutually exclusive log-return events</p><div id="probability-chart" class="chart"></div></section><section class="plot"><h2>Downside through time</h2><p>Probabilities on unseen observations</p><div id="timeline-chart" class="chart"></div></section><section class="plot"><h2>Calibration</h2><p>Sample counts matter; sparse bins are noisy</p><div id="calibration-chart" class="chart"></div></section><section class="plot"><h2>Candidate comparison</h2><p>Outer-test log loss · lower is better</p><div id="score-chart" class="chart"></div></section></div><section class="scores"><h2>Same-history evidence</h2><p id="score-note" class="small">Comparative test scores appear after a run.</p><div class="table-scroll"><table><caption class="sr-only">Candidate test scores</caption><thead><tr><th scope="col">Model</th><th scope="col">Scored rows</th><th scope="col">Log loss</th><th scope="col">Brier</th><th scope="col">Up Brier</th><th scope="col">Downside Brier</th></tr></thead><tbody id="scores-body"></tbody></table></div></section><div class="audit-grid"><details><summary>Chronology & run audit</summary><pre id="audit">No completed run.</pre></details><details><summary>Distribution diagnostics</summary><pre id="diagnostics">No completed run.</pre></details><details><summary>SHAP & Python provenance</summary><pre id="explanations">Load the precomputed Python benchmark to inspect its tree explanation.</pre></details></div><button id="download" class="secondary" disabled>Download current report JSON</button><p class="hint">A probability forecast is not an executable trade. No historical investment edge is established.</p></div></section><section id="mathematics" class="view" hidden><h2>Incentives, prices & sizing</h2><p>Separate mathematical examples. These assumptions do not establish a market forecasting edge.</p><div class="lab-grid"><section class="plot"><h3>Two-player games</h3><label for="game">Game</label><select id="game"><option value="prisoner">Prisoner’s dilemma</option><option value="matching">Matching pennies</option></select><pre id="game-output"></pre></section><section class="plot"><h3>Option prices & binary Kelly</h3><form id="risk-form"><div class="input-grid"><label>Spot<input name="spot" type="number" min="1" step="1" value="100" required></label><label>Strike<input name="strike" type="number" min="1" step="1" value="100" required></label><label>Years<input name="years" type="number" min="0.01" max="10" step="0.01" value="1" required></label><label>Annual volatility<input name="vol" type="number" min="0.01" max="3" step="0.01" value="0.2" required></label><label>Binary win probability<input name="probability" type="number" min="0" max="1" step="0.01" value="0.55" required></label><label>Net binary payoff odds<input name="odds" type="number" min="0.1" max="10" step="0.1" value="1" required></label></div><button class="secondary">Calculate</button></form><pre id="risk-output" aria-live="polite"></pre><p class="hint">Black–Scholes: European, no dividends, constant volatility and 3% rate. Kelly: capped quarter-Kelly for a fixed-payoff binary bet, not an equity allocation.</p></section></div></section><section id="methods" class="view prose" hidden><h2>What runs here</h2><p>This is a free Static Hugging Face Space. Browser models fit locally in a web worker. CSV contents are read by your browser; they are not uploaded to a modeling server. No API key, external data feed or paid compute is required.</p><h3>Validation contract</h3><p>At close t, returns, momentum, realized volatility and drawdown use only observations through t. Models fit on earlier rows, then calibrate and select on a later block. A one-row embargo separates each boundary. Initial training uses 500 rows, calibration 150 and outer test blocks 200. Never tune using the outer test charts.</p><p>The target is the next observed close’s log return. Downside is below −0.02 log return, approximately −1.98% simple return; the middle event includes both boundaries, and the final event is a positive return. Probabilities sum to one.</p><h3>Two distinct execution modes</h3><p><b>Browser experiment:</b> empirical frequencies, ridge with Gaussian residual probabilities, and multinomial logistic regression are fitted to the selected data. Synthetic JavaScript draws differ from Python even with the same seed.</p><p><b>Precomputed Python benchmark:</b> a saved 900-observation synthetic run actually fitted scikit-learn, XGBoost and LightGBM, completed three training-only Optuna trials, computed SHAP and recorded MLflow metrics. Loading it does not execute those libraries. Download the full Python/Gradio project to run them locally.</p><h3>Implementation limits</h3><p>Calibration reuses data for temperatures and model choice. Financial tails and nonstationarity can invalidate normal residual assumptions. Tiny test samples and sparse reliability bins are especially unreliable. SHAP explains uncalibrated raw class margins, not causal effects. Close-based information does not imply executable same-close fills. No costs, live trading or economic backtest is included.</p><p>TFT, DeepSurv, PPO, calibrated rough-volatility models, SPDE solvers and quantum algorithms remain unimplemented. Qiskit has no defined task here; TensorFlow would duplicate the optional PyTorch backend. The downloadable project records all requested books and access limits; full books were not read.</p><p><a href="METHODS.md">Detailed method & provenance notes</a> · <a href="python-project.zip" download>Full Python source and tests</a></p></section></main><footer><span>QuantLab · research estimates, explicit assumptions.</span><span>Browser-local modeling / no paid compute</span></footer></body></html>
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103/* Inspectable mathematical demonstrations; no market-performance claim. */(function(root) { 'use strict'; const finite=(x)=>typeof x==='number' && Number.isFinite(x); const requireThat=(condition,message)=>{if(!condition) throw new Error(message);}; function game(name) { if(['prisoner','prisoners_dilemma',"prisoner's dilemma",'prisoner dilemma'].includes(name)) { return {name:"Prisoner's dilemma",rowPayoffs:[[3,0],[5,1]],columnPayoffs:[[3,5],[0,1]], actions:['Cooperate','Defect'],pureNash:[[1,1]],strictDominantRows:[1],strictDominantColumns:[1], paretoPure:[[0,0],[0,1],[1,0]],note:'Pure-outcome Pareto comparison only. Defect is strictly dominant; mutual defection is inefficient.'}; } if(['matching','matching_pennies','matching pennies'].includes(name)) { return {name:'Matching pennies',rowPayoffs:[[1,-1],[-1,1]],columnPayoffs:[[-1,1],[1,-1]],pureNash:[], mixed:{rowProbability:.5,columnProbability:.5,value:0}}; } throw new Error('Choose prisoner or matching.'); } // Abramowitz–Stegun normal CDF approximation, absolute error about 8e-8. function normalCDF(x) { const t=1/(1+.2316419*Math.abs(x)); const tail=Math.exp(-x*x/2)/Math.sqrt(2*Math.PI)*t*(.319381530+t*(-.356563782+t*(1.781477937+t*(-1.821255978+t*1.330274429)))); return x>=0?1-tail:tail; } function blackScholes(spot,strike,years,rate,vol) { requireThat([spot,strike,years,rate,vol].every(finite)&&Math.min(spot,strike,years,vol)>0, 'Finite inputs and positive spot, strike, years, volatility required.'); const d1=(Math.log(spot/strike)+(rate+vol*vol/2)*years)/(vol*Math.sqrt(years)); const d2=d1-vol*Math.sqrt(years),discount=strike*Math.exp(-rate*years); const call=spot*normalCDF(d1)-discount*normalCDF(d2),put=call-spot+discount; requireThat(finite(call)&&finite(put),'Inputs overflow numerical pricing range.'); return {call,put}; } function kelly(p,odds,fraction=.25,cap=.25) { requireThat([p,odds,fraction,cap].every(finite)&&p>=0&&p<=1&&odds>0&&fraction>=0&&fraction<=1&&cap>=0&&cap<=1, 'Probability, fractional multiplier and cap must lie in [0,1]; net odds must be positive.'); return Math.min(cap,Math.max(0,fraction*(p-(1-p)/odds))); } function diagnostics(closes) { requireThat(Array.isArray(closes)&&closes.length>=4&&closes.every(x=>finite(x)&&x>0), 'Require at least four finite positive closes.'); const r=closes.slice(1).map((x,i)=>Math.log(x)-Math.log(closes[i])); const n=r.length,mean=r.reduce((s,x)=>s+x,0)/n; const moments=[2,3,4].map(k=>r.reduce((s,x)=>s+(x-mean)**k,0)/n); const std=Math.sqrt(moments[0]*n/(n-1)); const result={mean,std,skew:moments[0]>0?moments[1]/moments[0]**1.5:null, excessKurtosis:moments[0]>0?moments[2]/moments[0]**2-3:null,n, normality_note:'Descriptive population-moment skew and excess kurtosis; normality is not independence. No normality-test p-value or forecasting validity is claimed.'}; return result; } function csvRows(text) { // State machine handles escaped quotes, quoted commas/newlines, CRLF and BOM. // Empty records are refused; one terminal line ending is allowed. text=text.replace(/^\uFEFF/,''); let rows=[],row=[],field='',quoted=false,afterQuote=false,start=true; for(let i=0;i<text.length;i++) { const c=text[i]; if(quoted) { if(c==='"') {if(text[i+1]==='"'){field+='"';i++;}else{quoted=false;afterQuote=true;}} else field+=c; continue; } if(c==='"') {requireThat(start&&!afterQuote,'Malformed CSV quote.');quoted=true;start=false;continue;} if(c===','||c==='\n'||c==='\r') { row.push(field);field='';start=true;afterQuote=false; if(c!==',') {rows.push(row);row=[];if(c==='\r'&&text[i+1]==='\n')i++;} continue; } requireThat(!afterQuote,'Unexpected character after closing CSV quote.'); field+=c;start=false; } requireThat(!quoted,'Unterminated quoted CSV field.'); if(field!==''||row.length||afterQuote) {row.push(field);rows.push(row);} return rows; } function parseCSV(text) { requireThat(typeof text==='string','CSV text required.'); requireThat(new TextEncoder().encode(text).byteLength<=2*1024*1024,'CSV exceeds 2 MiB.'); const rows=csvRows(text); requireThat(rows.length>=715&&rows.length<=2501,'Require 714–2500 price rows.'); const header=rows[0]; requireThat(new Set(header).size===header.length,'Duplicate column names are refused.'); const di=header.indexOf('date'),ci=header.indexOf('close'); requireThat(di>=0&&ci>=0,'CSV requires date and close columns.'); const dates=[],closes=[];let previous=null,maxGap=0; for(const row of rows.slice(1)) { requireThat(row.length===header.length,'Every row must have the same number of fields as the header.'); const date=row[di],price=row[ci]; requireThat(/^\d{4}-\d{2}-\d{2}$/.test(date),'Dates must use YYYY-MM-DD.'); const stamp=Date.parse(date+'T00:00:00.000Z'); requireThat(Number.isFinite(stamp)&&new Date(stamp).toISOString().slice(0,10)===date,'Invalid calendar date.'); requireThat(previous===null||stamp>previous,'Dates must be unique and strictly ascending.'); requireThat(/^[+]?((\d+(\.\d*)?)|(\.\d+))([eE][+-]?\d+)?$/.test(price), 'Closes must be numeric, finite and positive; missing values are refused.'); const close=Number(price); requireThat(finite(close)&&close>0,'Closes must be finite and positive.'); if(previous!==null) maxGap=Math.max(maxGap,(stamp-previous)/86400000); previous=stamp;dates.push(date);closes.push(close); } return {dates,closes,calendarGapMaxDays:maxGap}; } const api={game,blackScholes,kelly,diagnostics,parseCSV}; if(typeof module!=='undefined'&&module.exports) module.exports=api; if(root) root.QuantLabs=api;})(typeof window!=='undefined'?window:typeof globalThis!=='undefined'?globalThis:null);1234567891011121314151617181920212223242526272829303132333435363738/* Dependency-free, browser-local research baselines. No trading/alpha claim. * Targets next observed-close log return. Synthetic RNG differs from Python. */(function(root){'use strict';const mean=a=>a.reduce((s,v)=>s+v,0)/a.length;const cls=y=>y<-.02?0:y>0?2:1;function rng(seed){let s=seed>>>0;return()=>{s+=0x6D2B79F5;let t=s;t=Math.imul(t^t>>>15,t|1);t^=t+Math.imul(t^t>>>7,t|61);return ((t^t>>>14)>>>0)/4294967296;};}function synthetic(n=1500,seed=42){ if(!Number.isInteger(n)||n<100||n>2500||!Number.isInteger(seed))throw Error('Use integer n from 100 to 2500 and integer seed'); const random=rng(seed),normal=()=>Math.sqrt(-2*Math.log(Math.max(random(),1e-12)))*Math.cos(2*Math.PI*random()); const close=[100];let state=0,previous=0; for(let i=1;i<n;i++){if(random()<(state?.10:.025))state=1-state;const jump=random()<.008?Math.log(Math.max(random(),1e-12))*.025:0;const r=.0003+.08*previous+(state?.025:.008)*normal()+jump;close.push(close[i-1]*Math.exp(r));previous=r;} return close;}function validate(close,min=62){if(!Array.isArray(close)||close.length<min||!close.every(v=>typeof v==='number'&&Number.isFinite(v)&&v>0))throw Error(`Need at least ${min} finite positive closes`);}function features(close){validate(close);const r=close.slice(1).map((v,i)=>Math.log(v)-Math.log(close[i])),x=[],y=[],indices=[]; for(let t=60;t<close.length-1;t++){const r5=r.slice(t-5,t),r20=r.slice(t-20,t),sd=a=>Math.sqrt(a.reduce((s,v)=>s+(v-mean(a))**2,0)/(a.length-1));x.push([r[t-1],r5.reduce((a,b)=>a+b,0),r20.reduce((a,b)=>a+b,0),sd(r5),sd(r20),close[t]/Math.max(...close.slice(t-59,t+1))-1]);y.push(r[t]);indices.push(t);} return{x,y,indices};}function softmax(v){const m=Math.max(...v),a=v.map(x=>Math.exp(x-m)),s=a.reduce((x,y)=>x+y,0);return a.map(x=>x/s);}function temperature(q,t){return softmax(q.map(p=>Math.log(Math.max(1e-12,p))/t));}function cdf(z){const a=Math.abs(z)/Math.sqrt(2),t=1/(1+.3275911*a),erf=1-(((((1.061405429*t-1.453152027)*t)+1.421413741)*t-.284496736)*t+.254829592)*t*Math.exp(-a*a);return Math.max(0,Math.min(1,.5*(1+(z>=0?erf:-erf))));}function metrics(y,q){let loss=0,brier=0,up=0,downside=0,correct=0;for(let i=0;i<y.length;i++){const c=cls(y[i]);up+=(q[i][2]-(c===2?1:0))**2;downside+=(q[i][0]-(c===0?1:0))**2;loss-=Math.log(Math.max(1e-12,q[i][c]));for(let k=0;k<3;k++)brier+=(q[i][k]-(k===c?1:0))**2;if(q[i].indexOf(Math.max(...q[i]))===c)correct++;}return{log_loss:loss/y.length,brier_multiclass:brier/y.length,up_brier:up/y.length,downside_brier:downside/y.length,accuracy:correct/y.length};}function solve(a,b){a=a.map((row,i)=>[...row,b[i]]);const n=b.length;for(let j=0;j<n;j++){let p=j;for(let i=j+1;i<n;i++)if(Math.abs(a[i][j])>Math.abs(a[p][j]))p=i;[a[j],a[p]]=[a[p],a[j]];if(Math.abs(a[j][j])<1e-14)throw Error('Singular ridge system');const d=a[j][j];for(let k=j;k<=n;k++)a[j][k]/=d;for(let i=0;i<n;i++)if(i!==j){const v=a[i][j];for(let k=j;k<=n;k++)a[i][k]-=v*a[j][k];}}return a.map(row=>row[n]);}function fit(x,y){const n=x.length,p=6,m=Array(p).fill(0),scale=Array(p).fill(0);for(const row of x)for(let j=0;j<p;j++)m[j]+=row[j]/n;for(const row of x)for(let j=0;j<p;j++)scale[j]+=(row[j]-m[j])**2/n;for(let j=0;j<p;j++)scale[j]=Math.sqrt(scale[j])||1; const z=x.map(row=>[1,...row.map((v,j)=>(v-m[j])/scale[j])]),counts=[1,1,1];y.forEach(v=>counts[cls(v)]++); const a=Array.from({length:p+1},()=>Array(p+1).fill(0)),b=Array(p+1).fill(0);for(let i=0;i<n;i++)for(let j=0;j<=p;j++){b[j]+=z[i][j]*y[i]/n;for(let k=0;k<=p;k++)a[j][k]+=z[i][j]*z[i][k]/n;}for(let j=1;j<=p;j++)a[j][j]+=1;const beta=solve(a,b);const residual=y.map((v,i)=>v-z[i].reduce((s,u,j)=>s+u*beta[j],0)),mu=mean(residual),sigma=Math.max(1e-6,Math.sqrt(residual.reduce((s,v)=>s+(v-mu)**2,0)/(n-1))); const weights=Array.from({length:p+1},()=>[0,0,0]);let squared=0;for(const row of z)for(const v of row)squared+=v*v;const step=1/(.5*squared/n+.03); for(let iter=0;iter<100;iter++){const grad=Array.from({length:p+1},()=>[0,0,0]);for(let i=0;i<n;i++){const logits=[0,0,0];for(let j=0;j<=p;j++)for(let k=0;k<3;k++)logits[k]+=z[i][j]*weights[j][k];const prob=softmax(logits);for(let j=0;j<=p;j++)for(let k=0;k<3;k++)grad[j][k]+=z[i][j]*(prob[k]-(cls(y[i])===k?1:0))/n;}for(let j=0;j<=p;j++)for(let k=0;k<3;k++)weights[j][k]-=step*(grad[j][k]+(j?.03*weights[j][k]:0));} return{m,scale,beta,sigma,weights,empirical:counts.map(v=>v/(n+3))};}function probabilities(model,x,name){if(name==='empirical')return model.empirical.slice();const z=[1,...x.map((v,j)=>(v-model.m[j])/model.scale[j])];if(name==='softmax'){const v=[0,0,0];for(let j=0;j<z.length;j++)for(let k=0;k<3;k++)v[k]+=z[j]*model.weights[j][k];return softmax(v);}const mu=z.reduce((s,v,j)=>s+v*model.beta[j],0),lo=cdf((-.02-mu)/model.sigma),hi=cdf(-mu/model.sigma);return[lo,Math.max(0,hi-lo),1-hi];}function run(close){validate(close,714);if(close.length>2500)throw Error('Maximum 2500 closes');const{x,y,indices}=features(close),names=['empirical','ridge','softmax'],predictions=[],folds=[],allQ={empirical:[],ridge:[],softmax:[]},allY=[],selectedQ=[]; function train(calStop){const calStart=calStop-150,trainStop=calStart-1,model=fit(x.slice(0,trainStop),y.slice(0,trainStop)),temps={},scores={};for(const name of names){const q=x.slice(calStart,calStop).map(row=>probabilities(model,row,name));let best=Infinity;for(const t of [.5,.75,1,1.5,2,3]){const score=metrics(y.slice(calStart,calStop),q.map(p=>temperature(p,t))).log_loss;if(score<best){best=score;temps[name]=t;}}scores[name]=best;}const chosen=names.reduce((a,b)=>scores[a]<=scores[b]?a:b);return{model,temps,scores,chosen,calStart,trainStop};} for(let start=652;start<y.length;start+=200){const stop=Math.min(start+200,y.length),calStop=start-1,t=train(calStop);folds.push({train_feature_start:indices[0],train_feature_end:indices[t.trainStop-1],train_label_end:indices[t.trainStop-1]+1,calibration_feature_start:indices[t.calStart],calibration_label_end:indices[calStop-1]+1,test_feature_start:indices[start],test_feature_end:indices[stop-1],selected:t.chosen,calibration_log_loss:t.scores,temperatures:t.temps});for(let i=start;i<stop;i++){const qs={};for(const name of names){qs[name]=temperature(probabilities(t.model,x[i],name),t.temps[name]);allQ[name].push(qs[name]);}allY.push(y[i]);selectedQ.push(qs[t.chosen]);predictions.push({feature_index:indices[i],target_index:indices[i]+1,probabilities:qs[t.chosen],actual_log_return:y[i],model:t.chosen});}} const t=train(y.length-1),latestX=features([...close,close.at(-1)]).x.at(-1),candidate={};for(const name of names)candidate[name]=temperature(probabilities(t.model,latestX,name),t.temps[name]); return{target:'next observed-close log return',threshold:-.02,classes:['r < -0.02','-0.02 <= r <= 0','r > 0'],test_observations:allY.length,predictions,folds,candidate_metrics:Object.fromEntries(names.map(name=>[name,metrics(allY,allQ[name])])),selected_metrics:metrics(allY,selectedQ),latest_forecast:{probabilities:candidate[t.chosen],model:t.chosen,candidate_probabilities:candidate,feature_index:close.length-1,target_index:close.length,train_label_end:indices[t.trainStop-1]+1,calibration_feature_start:indices[t.calStart],calibration_label_end:indices[y.length-2]+1,calibration_log_loss:t.scores,temperatures:t.temps},limitations:['Synthetic data demonstrate software only.','Next observed close may span calendar gaps.','Normal ridge errors and stationary calibration can fail under regime shifts.','Temperature and model selection reuse calibration; test blocks remain untouched.','No transaction costs, execution model, or established economic edge.']};}const api={synthetic,features,run};if(typeof module!=='undefined'&&module.exports)module.exports=api;root.QuantModel=api;})(typeof globalThis!=='undefined'?globalThis:this);123version https://git-lfs.github.com/spec/v1oid sha256:494e9f2d184e976690ade7082539bfc2d6b9e6bcf21ce1c19610928b5b664346size 6830112345678910111213141516171819202122232425262728body {padding: 2rem;font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;}h1 {font-size: 16px;margin-top: 0;}p {color: rgb(107, 114, 128);font-size: 15px;margin-bottom: 10px;margin-top: 5px;}.card {max-width: 620px;margin: 0 auto;padding: 16px;border: 1px solid lightgray;border-radius: 16px;}.card p:last-child {margin-bottom: 0;}1:root{font-family:Arial,Helvetica,sans-serif;color:#141414;background:#f2f4f7;font-size:14px;line-height:1.5;color-scheme:light}*{box-sizing:border-box}body{margin:0;padding:24px 32px}header{display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1400px;margin:auto}h1{font-size:25px;letter-spacing:-.7px;font-weight:600;margin:0}h1 span{font-weight:400;color:#505864}header p{margin:6px 0 0;color:#505864}a{color:#174f9d;text-underline-offset:3px}.source-link{white-space:nowrap;font-size:13px}nav{display:flex;gap:24px;border-bottom:1px solid #d6dce4;margin:24px auto;max-width:1400px}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.55;cursor:progress}.tab{border:0;background:none;padding:10px 0;color:#505864;border-bottom:2px solid transparent;white-space:nowrap}.tab.active{border-color:#141414;color:#141414}.primary,.secondary{min-height:44px;padding:9px 16px;border-radius:5px;border:1px solid #c3cad5;background:white;color:#141414}.primary{background:#141414;color:white;border-color:#141414;width:100%}.primary:hover{background:#333}.secondary:hover{background:#e8ecf1}:focus-visible{outline:3px solid #1d5fbf;outline-offset:3px}main{max-width:1400px;margin:auto}#workbench{display:grid;grid-template-columns:265px minmax(0,1fr);gap:28px}aside{min-width:0}h2{font-size:16px;font-weight:600;margin:0 0 6px}h3{font-size:14px;font-weight:600;margin:20px 0 6px}p{margin:8px 0 16px}.small,.hint{color:#505864;font-size:13px}.hint{font-size:12px;margin:7px 0 14px}form label{display:block;margin:14px 0 6px}input,select{display:block;width:100%;background:white;color:#141414;border:1px solid #c3cad5;border-radius:4px;min-height:40px;padding:8px;font-size:16px}input[type=file]{font-size:12px;max-width:100%}input[type=file]::file-selector-button{border:0;padding:5px;margin-right:5px;background:#e8ecf1;cursor:pointer}.model-list{margin:22px 0;padding:15px 0;border-top:1px solid #d6dce4}.model-list h3{margin:0}.model-list p{line-height:1.8;margin:8px 0}.benchmark-control{margin-top:26px;padding-top:20px;border-top:1px solid #d6dce4}.benchmark-control button{width:100%}#results{min-width:0;outline-offset:8px}#status{font-size:13px;color:#444c58;min-height:45px;padding:0 0 8px}#status.error{color:#a82222}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:12px 0 26px}.stats span{font-size:12px;display:block;color:#505864;margin-bottom:5px}.stats strong{font-size:29px;font-weight:500;font-variant-numeric:tabular-nums}.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.plot{background:#fff;padding:18px 18px 10px;min-width:0;border-radius:5px}.plot h2{font-size:15px}.plot>p{font-size:12px;color:#505864;margin:0 0 8px}.chart{height:220px;width:100%}.chart svg{width:100%;height:100%;overflow:visible}.chart text{font-family:Arial,sans-serif;font-size:11px;fill:#505864}.chart line.grid{stroke:#e7ebf0;stroke-width:1}.chart path,.chart line{vector-effect:non-scaling-stroke}.scores{margin-top:26px}.scores p{margin-top:0}.table-scroll{overflow:auto;background:white;border-radius:5px}table{border-collapse:collapse;width:100%;font-size:13px;white-space:nowrap;font-variant-numeric:tabular-nums}th,td{text-align:right;padding:12px;border-bottom:1px solid #edf0f4}th:first-child,td:first-child{text-align:left}th{font-weight:500;color:#505864}.audit-grid{display:grid;gap:10px;margin:20px 0}details{background:#fff;border-radius:5px;padding:12px 16px}summary{cursor:pointer;min-height:24px}pre{font-size:12px;line-height:1.6;max-height:360px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0}.lab-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:24px}.input-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.prose{max-width:800px}.prose h3{margin-top:28px}.prose p{line-height:1.8}footer{max-width:1400px;margin:36px auto 0;padding-top:18px;border-top:1px solid #d6dce4;font-size:12px;color:#505864;display:flex;justify-content:space-between;gap:16px}.skip{position:absolute;left:16px;top:-100px;background:white;padding:12px;z-index:10}.skip:focus{top:5px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}[hidden]{display:none!important}@media(max-width:960px){body{padding:20px}#workbench{grid-template-columns:230px minmax(0,1fr);gap:20px}.charts{grid-template-columns:1fr}.stats{grid-template-columns:1fr 1fr}.source-link{max-width:150px;white-space:normal;text-align:right}}@media(max-width:640px){body{padding:18px 16px}header{display:block}h1{font-size:22px}h1 span{display:block;font-size:18px;letter-spacing:-.3px;margin-top:3px}header p{font-size:13px}.source-link{display:inline-block;max-width:none;margin-top:12px;text-align:left}nav{gap:20px;overflow:auto;margin:18px 0}#workbench{display:flex;flex-direction:column}aside{display:grid;grid-template-columns:1fr;gap:12px}.model-list{margin:15px 0}.benchmark-control{margin-top:12px;padding-top:16px}#results{margin-top:14px}.stats{gap:16px}.stats strong{font-size:27px}.charts,.lab-grid{grid-template-columns:1fr}.plot{padding:16px 12px}.chart{height:210px}.input-grid{gap:0 12px}footer{display:block}footer span{display:block;margin:6px 0}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
12345678910111213141516171819202122232425262728293031323334353637383940414243444546const assert = require('node:assert/strict');const labs = require('./labs.js');const vm = require('node:vm');const fs = require('node:fs');const workerContext = vm.createContext({TextEncoder});vm.runInContext(fs.readFileSync(require.resolve('./labs.js'), 'utf8'), workerContext);assert.equal(typeof workerContext.QuantLabs?.parseCSV, 'function', 'Worker global must expose QuantLabs without window');const pd = labs.game('prisoner');assert.deepEqual(pd.pureNash, [[1, 1]]);assert.deepEqual(pd.strictDominantRows, [1]);assert.deepEqual(labs.game('matching'), {name:'Matching pennies', rowPayoffs:[[1,-1],[-1,1]],columnPayoffs:[[-1,1],[1,-1]],pureNash:[],mixed:{rowProbability:.5,columnProbability:.5,value:0}});assert.throws(() => labs.game('unknown'));const bs = labs.blackScholes(100,100,1,.05,.2);assert.ok(Math.abs(bs.call-10.450583572185565)<1e-5);assert.ok(Math.abs(bs.call-bs.put-(100-100*Math.exp(-.05)))<1e-10);assert.throws(() => labs.blackScholes(0,100,1,.05,.2));assert.ok(Math.abs(labs.kelly(.6,1)-.05)<1e-12);assert.equal(labs.kelly(.1,1),0);assert.equal(labs.kelly(1,1,1,.25),.25);assert.throws(() => labs.kelly(1.1,1));const d=labs.diagnostics([100,110,99,105]);assert.equal(d.n,3);assert.ok(Math.abs(d.mean-Math.log(1.05)/3)<1e-12);assert.ok(Number.isFinite(d.skew));assert.match(d.normality_note,/not independence/);assert.throws(() => labs.diagnostics([100,0,110]));function csv(n=714) { let lines=['date,close,note']; for(let i=0;i<n;i++) lines.push(`${new Date(Date.UTC(2020,0,1+i)).toISOString().slice(0,10)},${100+i},"quoted, value ""ok"""`); return lines.join('\r\n');}let parsed=labs.parseCSV(csv());assert.equal(parsed.closes.length,714);assert.equal(parsed.calendarGapMaxDays,1);assert.throws(()=>labs.parseCSV(csv(713)));assert.throws(()=>labs.parseCSV(csv(2501)));assert.throws(()=>labs.parseCSV(csv().replace('2020-01-02','2020-01-01')));assert.throws(()=>labs.parseCSV(csv().replace('2020-01-02','2020-02-30')));assert.throws(()=>labs.parseCSV(csv().replace(',101,',',-1,')));assert.throws(()=>labs.parseCSV(csv().replace(',101,',',NaN,')));assert.throws(()=>labs.parseCSV(csv().replace('date,close,note','date,close,close')));assert.throws(()=>labs.parseCSV(csv()+'\n"unterminated'));assert.throws(()=>labs.parseCSV(csv().replace('"quoted, value ""ok"""','"a"oops')));assert.throws(()=>labs.parseCSV('x'.repeat(2*1024*1024+1)));assert.equal(labs.parseCSV(csv().replace('"quoted, value ""ok"""','"multi\nline"')).closes.length,714);console.log('labs tests passed (games, pricing, sizing, moments, CSV validation)');12345678910111213141516const assert=require('node:assert/strict');const Q=require('./model.js');const prices=Q.synthetic(900,42);const f=Q.features(prices);assert(Math.abs(f.y[0]-Math.log(prices[61]/prices[60]))<1e-12);const changed=prices.slice();for(let i=820;i<changed.length;i++)changed[i]*=1.2;const a=Q.run(prices),b=Q.run(changed);assert.equal(a.latest_forecast.feature_index,899);assert.equal(a.latest_forecast.target_index,900);for(const r of [...a.predictions,a.latest_forecast])assert(Math.abs(r.probabilities.reduce((s,x)=>s+x,0)-1)<1e-12);for(let i=0;i<a.predictions.length;i++)if(a.predictions[i].feature_index<820)assert.deepEqual(a.predictions[i].probabilities,b.predictions[i].probabilities);for(const fold of a.folds){assert(fold.train_label_end<fold.calibration_feature_start);assert(fold.calibration_label_end<fold.test_feature_start);}assert(a.latest_forecast.calibration_label_end<a.latest_forecast.feature_index);for(const x of [[1,2],Array(900).fill(NaN),Array(900).fill(0),Array(2501).fill(1)])assert.throws(()=>Q.run(x));for(const metrics of [...Object.values(a.candidate_metrics),a.selected_metrics]){assert(Number.isFinite(metrics.up_brier));assert(Number.isFinite(metrics.downside_brier));assert(metrics.up_brier>=0&&metrics.up_brier<=1);assert(metrics.downside_brier>=0&&metrics.downside_brier<=1);}console.log('All model tests passed');123456'use strict';importScripts('model.js','labs.js');self.onmessage=event=>{ try { const closes=event.data.closes; const report=QuantModel.run(closes); self.postMessage({report,diagnostics:QuantLabs.diagnostics(closes)}); } catch(error){self.postMessage({error:error.message});}};LICENSEAdded+21
METHODS.mdAdded+49
README.md+27-6
app.jsAdded+43
benchmark.jsonAdded+3144
index.html+39-18
labs.jsAdded+103
model.jsAdded+38
python-project.zipAdded+3
style.css+1-28
test_labs.cjsAdded+46
test_model.cjsAdded+16
worker.jsAdded+6