Source: docs/book/index.md
Xalec AutoML Services Handbook

This book is the curated reference for Xalec AutoML Services. It combines user guidance, workflow selection, data preparation, model methodology, algebraic definitions, billing behavior, explainability, AI reports, and operational troubleshooting.
The in-app Xalec assistant is also covered in this handbook. It is designed as a controlled handbook and job-artifact reader: answers should be grounded in approved documentation, service metadata, and saved job evidence.
Current App Status
As of May 30, 2026, the service website supports 20 active workflows and more than 250 configured model options. The upload workflow is readiness-gated: users upload data, map required roles, select features and classification positive class where needed, run Preview Data Readiness, and only then see the training configuration, model catalog, tuning, cost, and launch controls.
Completed jobs now use one artifact-backed review spine. The job detail page, AI Report tab, public demo workspace, and handbook all refer to the same saved evidence classes:
- readiness profile;
- service diagnostics;
- explainability status;
- reproducibility manifest;
- methods appendix.
Job detail pages include an embedded AI Report review surface, with a standalone focused reader available for longer review. The AI Report tab also links to the artifact-backed Methods Appendix when the saved job evidence is available.
The hypothetical data generator now writes one folder per service type. It accounts for all structured upload formats accepted by the shared dataset reader and keeps media workflows manifest-based.
The public guided demo workspace is available for prospective users. It replays the real product path without sign-in, uploads, or credit use: upload setup, readiness preview, a completed job page, saved plots, generated-report summary, methods appendix, prediction replay, and billing replay.
Who This Book Is For
- Users who need to upload data, choose a service, run jobs, and interpret results.
- Analysts and researchers who need methodological transparency, equations, model assumptions, metrics, and limitations.
- Developers and administrators who need artifact contracts, operational notes, and traceability guidance.
How To Read This Book
- Start with Product Overview and Getting Started if you are new to the platform.
- Use Choosing A Service when deciding which workflow fits your dataset.
- Use Service Reference for the 20 supported workflows and the current upload-visible model catalog.
- Use Technical Methodology for algebraic definitions, optimization objectives, assumptions, and metrics.
- Use Operations and Appendices for troubleshooting, billing, artifact layout, and source-document traceability.
- Use Publication Notes and Publisher Readiness And Editorial Audit when preparing the handbook for external review, rights review, or publisher consideration.
- Use Assistant And Controlled RAG to understand the simplified in-app assistant, evidence sources, quality gates, and feedback proposal review loop.
- Use Hypothetical Data Generator if you are a developer or administrator regenerating safe synthetic validation datasets for tests and workflow checks.
- Use Publication Style Sheet when editing the handbook for external publication.
Traceability
The handbook is maintained from source Markdown and cross-checked against the active service catalog, service documentation, pricing design, assistant steering documents, and synthetic validation dataset guidance. Generated HTML, PDF, and DOCX files are publication outputs rather than the source of truth.
Detailed service and model documentation remain available for audit and maintenance, while this book provides the coherent reader-facing structure.
Source: docs/book/chapters/01-product-overview.md
Product Overview
Xalec AutoML Services is a web-based automated machine-learning platform for training, comparing, explaining, and reporting models across structured data, longitudinal data, time series, text, media, survival analysis, anomaly detection, clustering, recommendation, ranking, network-analysis, and graphical-model workflows.
What The Platform Does
The platform gives users a guided path from raw data to model outputs. It handles the repetitive operational work around applied machine learning: schema checks, preprocessing, candidate model comparison, metric reporting, plots, saved artifacts, explainability, billing, and AI-assisted reporting.
The platform does not replace statistical judgment or domain review. It creates a consistent workflow so users can see what was trained, why a model was selected, what failed, what was skipped, what it cost, and which outputs were produced.
Product Surfaces
The main product surfaces are:
- Home and services catalog for service discovery.
- Upload pages for service-specific intake, role mapping, readiness preview, and post-readiness training configuration.
- Job workspace for monitoring running and completed jobs.
- Job detail pages for metrics, plots, artifacts, SHAP, embedded AI report review, and report actions.
- Prediction center for reusing trained models where supported.
- Billing and wallet views for reserve, refund, and net-charge history.
- AI report views for manuscript-style summaries and downloadable reports.
- Dockable Xalec assistant and full assistant workspace for handbook-grounded help and job-artifact diagnosis.
Core Workflow
- Select a service.
- Upload data and configure required columns, feature roles, and positive class where applicable.
- Run Preview Data Readiness.
- Review the comparison strategy, visible model catalog, tuning options, cost, and runtime expectations.
- Run training.
- Monitor job progress.
- Review metrics, plots, artifacts, SHAP/explainability, embedded AI reports, and billing settlement.
- Download or reuse outputs.
At any point, users can ask the assistant for workflow guidance or job-specific diagnosis. For job-specific claims, the assistant should cite saved job artifacts rather than relying on memory or general handbook text alone.
The 20-Service Scope
The current service set spans:
- three cross-sectional tabular workflows
- three longitudinal workflows
- three time-series workflows
- one text workflow
- three media workflows
- three specialized workflows
- four advanced-system workflows
These services are documented in the Service Reference part of this book and traced back to maintained workflow documentation.
The current upload-visible model registry contains more than 250 configured model options across these 20 workflows. The exact count is maintained in the service catalog and summarized in the upload forms and model registry appendix.
Product Principles
- Clarity: users should know what to do next.
- Confidence: users should see status, cost, and limitations.
- Speed to value: upload-to-insight should be short and guided.
- Trust: model behavior, metrics, warnings, and artifacts should be transparent.
- Consistency: service workflows should feel like one product.
Reader Promise
This book is intentionally practical. For each workflow, it answers four questions:
- What problem is this service meant to solve?
- What data shape does it expect?
- What model families and metrics should users expect?
- Which artifacts, assumptions, and source documents make the behavior auditable?
Related Chapters
- Choosing A Service
- Running Jobs
- Understanding Results
- Service Reference Overview
- Assistant And Controlled RAG
Source: docs/book/chapters/02-reading-paths-by-role.md
Reading Paths By Role
This chapter helps different readers move through the handbook without having to read it front to back. The book is designed to support several audiences at once: first-time product users, applied analysts, researchers writing methods sections, administrators supporting operations, and developers maintaining the platform.
The Fast Rule
If you are not sure where to start:
- read the product overview
- choose the workflow-selection chapter that matches your data
- read the results and reproducibility chapters before trusting outputs
That path works for most readers.
Role 1: First-Time Product User
You likely want to answer:
- What service should I choose?
- What columns or files do I need?
- What outputs will I get?
- What will this likely cost?
Recommended reading order:
- Product Overview
- Getting Started
- Choosing a Service
- Billing and Credits
- Understanding Results
- Workflow Selection Matrix
Use Assistant and Controlled RAG if you want to understand what the in-app assistant can answer and why it may ask for a job ID or saved artifact evidence.
Role 2: Applied Analyst Or Data Scientist
You likely want to answer:
- Which workflow is methodologically right for this dataset?
- How are models compared and selected?
- What artifacts should I verify before presenting results?
- When should I trust SHAP, reports, or fallback outputs?
Recommended reading order:
- Data Preparation
- Choosing a Service
- Metrics and Validation
- Artifacts and Implementation
- Reproducibility, Audit Trail, and Regeneration
- Model Selection and Fallback Rules
- Worked Case Studies
Use Assistant and Controlled RAG when checking whether an assistant answer is grounded in the right evidence rather than a raw retrieval dump.
Role 3: Researcher Or Manuscript Author
You likely want to answer:
- Which workflow assumptions should be stated in the paper?
- What mathematics and optimization rules sit behind the model families?
- How do I make the report, citations, and downloaded manuscript reproducible?
Recommended reading order:
- Responsible Use, Scope, and Limitations
- Explainability and AI Reports
- Model Methodology Reference
- Reproducibility, Audit Trail, and Regeneration
- Per-Model Mathematical Appendix
- Reproducibility Checklist
Role 4: Product Or Operations Administrator
You likely want to answer:
- What state transitions are trustworthy?
- How do billing reservation and settlement work?
- What should recovery or regeneration mean operationally?
- How do I tell a cosmetic issue from a durable-state issue?
Recommended reading order:
- Running Jobs
- Billing and Credits
- Architecture and Execution Flow
- Reproducibility, Audit Trail, and Regeneration
- Troubleshooting
- Model Selection and Fallback Rules
Role 5: Developer Or Maintainer
You likely want to answer:
- Where do service selection, billing, reporting, and artifact hydration connect?
- Which invariants must not drift?
- Which parts of the UX are backed by durable saved state versus derived views?
Recommended reading order:
- Architecture and Execution Flow
- EDA, Figures, and Reporting Reliability
- Artifacts and Implementation
- Reproducibility, Audit Trail, and Regeneration
- Admin and Developer Appendix
- Model Selection and Fallback Rules
- Assistant and Controlled RAG
If You Are Reviewing A Real Job
Use this compact path:
- Choosing a Service
- Understanding Results
- Metrics and Validation
- Reproducibility, Audit Trail, and Regeneration
- Worked Case Studies
- Assistant and Controlled RAG
Deeper Reading
- Getting Started for the product user guide.
- Service Reference Overview for the service map.
- Billing and Credits for workflow cost and settlement.
- Architecture and Execution Flow for durable workflow state and recovery.
- Assistant and Controlled RAG for the assistant evidence policy.
Source: docs/book/chapters/03-getting-started.md
Getting Started
This chapter introduces the normal user path through the platform.
Before You Start
Before running a job, make sure you know:
- the dataset structure
- the target or outcome column
- whether rows are independent, repeated by subject, time-indexed, media files, text records, or graph/interaction data
- whether the job needs explainability, an AI report, or only model artifacts
- whether the workflow has a cost estimate that should be reviewed before execution
If the data structure is unclear, start with the Choosing A Service chapter before uploading.
Public Demo Workspace
Prospective users can open the public demo workspace before signing in. The demo uses read-only scenarios backed by completed source jobs with saved AI report artifacts. The same artifact-backed evidence spine shown in real job detail pages is used in the demo:
- readiness profile;
- service diagnostics;
- explainability status;
- reproducibility manifest;
- methods appendix.
A scenario can replay:
- upload setup and role mapping
- a completed job page
- saved plot artifacts from the mapped completed job
- a generated AI-report summary in the job detail AI Report tab
- the artifact-backed methods appendix linked from the AI Report tab
- prediction output review
- billing evidence from the source job
The demo never uploads data, starts training, runs SHAP, calls an LLM provider, executes predictions, reserves credits, settles credits, or exposes raw unauthenticated job result URLs. Use it to understand the workflow, then create an account for real data and wallet-backed compute.
Start Using The Platform
For hosted use, start at the services catalog, choose the workflow that matches your data, and follow the upload wizard. Administrators who run a private deployment should use the deployment guide and operating procedures for the active environment.
Developer startup commands and environment notes are kept in the Admin And Developer Appendix so first-time users can stay focused on the analysis workflow.
First Job
- Open the services catalog.
- Choose the service that matches your data structure and target.
- Upload a supported file.
- Select the target column and required metadata columns.
- Select feature columns and the positive class for classification services where applicable.
- Preview readiness so row counts, feature counts, role mappings, and common data issues are checked before training.
- After readiness passes, review the first comparison strategy and adjust the visible model catalog if the study needs a broader, narrower, or more targeted comparison.
- Open advanced tuning only when the study needs service-specific hyperparameters, runtime controls, or method settings.
- Review the cost estimate.
- Start training.
- Watch the job workspace for progress.
- Review metrics, plots, artifacts, SHAP, embedded AI report outputs, and billing settlement.
Upload And Model Selection Layout
Upload pages are designed to keep the first run guided without hiding the breadth of available methods.
- Required roles and dataset readiness are checked before training starts.
- Training configuration controls are not mounted until Preview Data Readiness succeeds.
- Presets are framed as comparison strategies, not as claims that only one small model set is useful.
- The model catalog remains visible after readiness review so users can explore alternatives across model families.
- Advanced tuning, runtime overrides, and detailed method settings remain available but secondary.
- Cost and expected outputs stay visible before launch.
First Job Success Criteria
A first job is successful when:
- the job reaches a completed or partially completed state
- at least one candidate model trains successfully
- the selected model has metrics that match the workflow objective
- skipped or failed models are explained rather than silently hidden
- artifacts can be opened from the job detail page
- billing shows reservation, settlement, and net charge clearly
First Interpretation Checklist
- Confirm the target column is correct.
- Confirm the train/test split is appropriate.
- Confirm the selected best model matches your goal metric.
- Check warnings for imbalance, missing data, small sample size, and unsupported models.
- Review SHAP/explainability only after verifying the model and data are sensible.
- Treat AI reports as drafts requiring domain review.
Common Beginner Mistakes
- Choosing tabular regression for a count target.
- Choosing tabular services for repeated subject data that needs longitudinal handling.
- Uploading time-series data without a time column.
- Leaving IDs, names, or post-outcome fields in the feature set.
- Trusting accuracy on an imbalanced classification problem.
- Treating an AI report as final scientific text without checking numbers, references, and limitations.
Related Chapters
- Choosing A Service
- Data Preparation
- Running Jobs
- Billing And Credits
- Responsible Use, Scope, And Limitations
Source: docs/book/chapters/04-data-preparation.md
Data Preparation
Good AutoML results depend on data that matches the selected service. This chapter summarizes cross-service preparation rules.
General Requirements
- Upload a tabular file, media manifest, or service-specific data format supported by the selected workflow.
- Use clear column names.
- Avoid leaking future information into predictors.
- Keep target columns separate from features.
- Use consistent units, coding, and missing-value conventions.
- Confirm class labels and positive-class definitions for classification.
For binary classification, choose the positive class deliberately before training. It should usually be the outcome you want to detect, flag, prioritize, or explain, such as churn, fraud, default, disease, failure, response, or another event of interest.
File And Schema Hygiene
Use stable, readable column names before upload. Avoid duplicate column names, hidden spreadsheet formulas, merged spreadsheet cells, mixed date formats, and columns whose meaning is only known from external context. If a column requires explanation, document it before running the job so the AI report context and downstream review are easier to validate.
Supported Upload Formats
Most structured-data workflows use one shared server-side reader. The reader validates the file extension, computes dataset rows and columns on the server, and passes a pandas-style table to the service-specific readiness and training logic.
| Format family | Extensions | Notes |
|---|---|---|
| Delimited text | .csv, .tsv, .tab, .txt |
Use a header row. TSV/TAB files are read with tab separators; CSV/TXT files use the default CSV parser. |
| Spreadsheets | .xlsx, .xls |
Use a clean rectangular sheet with one header row. Avoid merged cells, formulas that hide values, and explanatory notes inside the data area. |
| Columnar files | .parquet, .feather |
Useful for large structured datasets because schema and shape can often be read efficiently. |
| JSON tables | .json, .jsonl, .ndjson |
Use table-shaped records. JSONL/NDJSON should contain one record per line. |
| Pickled pandas objects | .pkl, .pickle |
Not accepted for user uploads. Python pickle deserialization can execute code and is unsafe for untrusted files. |
| Stata | .dta |
Variable labels, value labels, and original formats are preserved when the deployment includes pyreadstat; a limited pandas fallback exists for basic Stata reads. |
| SPSS | .sav, .zsav, .por |
Variable labels, value labels, and original formats are preserved when pyreadstat is installed. |
| SAS | .sas7bdat, .xpt |
Variable labels, value labels, and formats are preserved where possible. Matching .sas7bcat catalogs are applied when found in the dataset directory, working directory, data/, or uploads/. |
| R data | .rds, .rda, .rdata |
Requires pyreadr. The reader uses the first tabular object it finds. |
The statistical-file metadata is retained in dataframe attributes and summarized with saved job metadata where supported. This helps reviewers keep original survey, cohort, and registry labels visible even after the modeling pipeline uses sanitized machine-safe column names.
Image, audio, and video workflows remain separate from statistical dataset
uploads. They accept media folders or ZIP bundles plus a tabular label
manifest. The manifest can use the same supported tabular formats as other
upload forms, including CSV/TSV, Excel, Parquet, JSON, Stata, SPSS, SAS, and R
data files when the deployment has the relevant readers installed. The
canonical columns are filename and target; common aliases such as path,
file_path, image_name, audio_name, video_name, label, class, and
tag are also accepted.
| Media workflow | Supported media files | Required manifest |
|---|---|---|
| Image classification | JPG/JPEG, PNG, BMP, GIF, TIFF, WEBP, or a ZIP containing those files | tabular manifest with media-path and label columns |
| Audio classification | WAV, MP3, FLAC, OGG, M4A, AAC, or a ZIP containing those files | tabular manifest with media-path and label columns |
| Video classification | MP4, AVI, MOV, MKV, WEBM, M4V, or a ZIP containing those files | tabular manifest with media-path and label columns |
Media manifests are ordinary tabular files. The statistical dataset formats above do not replace the manifest requirement for media training. Pickle-based manifests are not accepted.
Upload Readiness And Configuration
The application computes dataset rows and feature counts on the server before cost reservation or training. Users should use the readiness preview to confirm the selected service, required roles, target definition, and feature set before launching a job.
The current upload shell keeps intake and role mapping ahead of training configuration. Users should be able to choose target, time, subject or group columns, feature columns, and classification positive class before clicking Preview Data Readiness. Model selection, tuning controls, cost confirmation, and training launch then appear only after readiness succeeds.
For services with model choices, the upload form should show the first comparison strategy and the visible model catalog after readiness context is available. This preserves the main purpose of offering many models: users can start with a sensible strategy, then broaden, narrow, or target the comparison according to the study aim. Hyperparameters, runtime overrides, and detailed method settings belong in advanced tuning sections rather than in the primary intake path.
Dataset Setup And Supplied Splits
Users do not always arrive with the same data setup. AutoML Services supports three common paths:
| Setup | When to use it | What the platform does |
|---|---|---|
| One file; let AutoML split it | You have one curated modeling file. | The service creates its normal internal test or holdout split. The Internal Test Split control is active only in this setup. |
| One file; use my split column | One file already marks rows as train, validation, or test. | The split column is normalized to __xalec_split_role, excluded from features, and used to record validation/test roles in dataset_split_contract.json. If the column has train and validation rows but no test rows, AutoML holds out an internal test split from the training rows before fitting. |
| Separate train, validation, and/or test files | Your team already prepared external evaluation files. | The files are schema-checked, combined for the worker, and recorded in dataset_split_contract.json. The Internal Test Split control is inactive because supplied roles control evaluation. |
Use the split roles this way: the training file or training rows fit preprocessing and models; validation rows check model choices, thresholds, calibration, or tuning when a service supports that step; test rows are final held-out performance evidence. If users upload train and validation files without a test file, the uploaded validation file remains model-checking evidence and an internally held-out portion of the training file becomes the final test split. The internal test creation should preserve the safest available structure: subject/group-aware for repeated entities, time-ordered for temporal workflows, and random or stratified random only as a fallback.
Expected outputs follow the split roles:
| Uploaded setup | Main Model Performance table | Validation Dataset section | Test evidence |
|---|---|---|---|
| One dataset only | service-created internal evaluation split. | Not shown unless the service saves a separate validation role. | Internal to the service. |
| Train only | service-created internal evaluation split from the uploaded training file. | Not shown. | Internal to the service. |
| Train + validation | internally generated test split from uploaded training rows. | Shows validation performance metrics and saved validation best-model plots. | Generated internal test; the page and report should state this. |
| Train + test | uploaded test split. | Not shown unless validation is also present. | Uploaded test file. |
| Train + validation + test | uploaded test split. | Shows validation performance metrics and saved validation best-model plots. | Uploaded test file. |
| Split column with train + validation + test roles | split-column test role. | Shows validation performance metrics and saved validation best-model plots when validation rows exist. | Split-column test rows. |
| Split column with train + validation only | internally generated test split from rows marked train. | Shows validation performance metrics and saved validation best-model plots. | Generated internal test; the page and report should state this. |
| Split column with train + test only | split-column test role. | Not shown. | Split-column test rows. |
For classification-like services, the validation plot set is performance metrics, confusion matrix, ROC curve, and precision-recall curve when those split-specific artifacts are saved. Other services should attach service-specific best-model validation plots, such as actual-versus-predicted and residual diagnostics for regression, temporal/subject-aware plots for time-series or longitudinal workflows, and ranking/recommendation diagnostics for interaction services.
Not every service uses splits in the same way. Predictive services use the split for model evaluation. Media classification reads split roles from the label manifest. Labeled anomaly detection can evaluate on supplied held-out rows, but unlabeled anomaly detection remains a full-data unsupervised fit. Clustering, graphical models, and network analysis need service-specific stability or graph-aware validation rather than a generic row split.
Sampling Weights
If the modeling data are a sample of a larger population, users may provide a
non-negative sampling-weight column. Treat weights as study-design information,
not as predictors. The pipeline should validate the column, exclude it from
features, persist a weight summary, and pass training weights to model families
that support sample_weight.
When a model cannot consume weights directly, the job should continue only if that limitation is recorded clearly. Do not assume that every reported metric is weighted just because a weight column was uploaded.
Common Column Types
- Target column: outcome to predict or model.
- Feature columns: predictors.
- Subject column: repeated-measure or longitudinal identifier.
- Time column: time index for longitudinal or time-series workflows.
- Group column: grouping, clustering, panel, or multi-entity context.
- Event/time-to-event columns: survival-analysis inputs.
- User/item/rating columns: recommendation and ranking workflows.
- Split column: optional train/validation/test role indicator.
- Sampling-weight column: optional non-negative weight for sampled data.
Data Quality Checks
- missingness
- near-constant features
- high-cardinality categorical variables
- rare categories
- class imbalance
- duplicate records
- invalid timestamps
- insufficient events
- non-stationary time series
- unsupported media formats
Service-Specific Preparation
| Data shape | Preparation focus |
|---|---|
| Cross-sectional table | Clean target, remove identifiers, encode predictors consistently, check imbalance or skew. |
| Longitudinal table | Confirm subject and time columns, preserve repeated rows, avoid row-wise leakage across subjects. |
| Time series | Sort by time, define horizon/window, avoid future-derived predictors, handle irregular intervals. |
| Text | Clean text fields, preserve labels, remove duplicates, check language and truncation risks. |
| Media | Confirm decodable files, class folders/manifests, label balance, image/audio/video size limits. |
| Survival | Provide duration and event indicator, verify censoring code, remove post-event predictors. |
| Recommendation/ranking | Provide user/item/query/candidate structure and avoid mixing future interactions into training. |
| Network | Provide valid node and edge identifiers, optional features, labels, weights, or timestamps. |
Leakage Risks
Avoid predictors that reveal the target directly or indirectly. Examples include post-outcome measurements, manually derived labels, future values in time series, and fields generated after the event of interest.
Minimum Pre-Upload Checklist
- Every selected required column exists and has the intended meaning.
- The target has enough non-missing values.
- Classification classes have enough examples for validation.
- Time and event columns are encoded consistently.
- Media or text files can be opened outside the app.
- IDs are excluded unless the selected service explicitly needs them as grouping keys.
- Sensitive or regulated fields are handled according to the deployment policy.
Related Source Docs
Source: docs/book/chapters/05-choosing-a-service.md
Choosing A Service
Use this chapter to choose the correct workflow before uploading data.
Service Selection Guide
| Data / Question | Recommended Service Family |
|---|---|
| One row per observation, categorical target | Cross-sectional classification |
| One row per observation, continuous target | Cross-sectional regression |
| One row per observation, count target | Cross-sectional count regression |
| Repeated observations per subject | Longitudinal services |
| Ordered temporal signal or forecast-style data | Time-series services |
| Free-text documents | Text classification |
| Images, audio, or video | Media services |
| Time-to-event outcome | Survival |
| Outlier or unusual-pattern detection | Anomaly detection |
| Discover groups without labels | Clustering |
| Recommend items to users | Recommendation system |
| Learn ordered relevance | Ranking models |
| Graph/node/edge prediction, adjacency matrices, or phased networks | Network analysis |
| Conditional relationships among measured variables | Graphical models |
Decision Tree
Use this decision tree when the right service is not obvious.
- If the input is image, audio, video, or text, choose the matching unstructured-data service first.
- If the outcome is time-to-event with censoring, choose
survival. - If rows repeat for the same person, facility, customer, device, or entity, ask whether subject-level dependence matters. If yes, choose a longitudinal service.
- If observations are ordered by time and temporal dependence is the modeling target, choose a time-series service.
- If there is no target label and the goal is to discover groups, choose
clustering. - If there is no target label and the goal is to detect unusual records, choose
anomaly_detection. - If the goal is user-item matching or preference prediction, choose
recommendation_system. - If the goal is ordered relevance for queries, candidates, or lists, choose
ranking_models. - If records are connected by nodes and edges, choose
network_analysis. - If the goal is conditional-dependence, hidden-state, or state-space structure among variables, choose
graphical_models. - Otherwise, choose a cross-sectional tabular service based on the target type.
Target-Type Rules
| Target Type | Service |
|---|---|
| Binary label such as yes/no, positive/negative, event/no event | tabular_classification |
| Multiclass label such as disease category or product class | tabular_classification |
| Continuous numeric value such as cost, score, lab value, or duration | tabular_regression |
| Non-negative integer count such as visits, events, claims, or incidents | tabular_count_regression |
| Event time plus censoring indicator | survival |
| Ordered relevance label or rank | ranking_models |
| User-item rating, click, purchase, or interaction | recommendation_system |
Structure-Type Rules
| Data Structure | Warning Sign | Better Service |
|---|---|---|
| One row per observation | no repeated subject/entity structure | Cross-sectional |
| Repeated rows per subject | same person/entity appears across visits | Longitudinal |
| Temporal sequence | ordering, lag, seasonality, or forecast horizon matters | Time series |
| Graph | nodes, edges, adjacency, phases, or network features matter | Network analysis |
| Probabilistic variable system | conditional dependence, partial correlation, hidden state, or state-space trace matters | Graphical models |
| Media files | file paths, manifests, pixels, waveforms, frames | Media services |
| Text documents | free text is the primary input | Text classification |
Common Mistakes
- Do not use cross-sectional classification for repeated patient visits if subject-level leakage is likely.
- Do not use time-series regression just because a dataset has a date column; use it when temporal order is part of the signal.
- Do not use regression for count outcomes when zeros and overdispersion are central to the problem.
- Do not use clustering when you already have a validated target label.
- Do not interpret anomaly detection as causal diagnosis; it flags unusual patterns for review.
- Do not use recommendation workflows for generic multiclass classification unless there is a real user-item interaction structure.
Example Scenarios
| Scenario | Recommended Service | Reason |
|---|---|---|
| Predict whether a client tests HIV positive using one row per encounter | tabular_classification |
Binary target and cross-sectional row structure |
| Predict annual hospitalization count | tabular_count_regression |
Count target with non-negative integer outcome |
| Predict CD4 trajectory across repeated visits | longitudinal_regression |
Repeated observations by patient |
| Forecast daily demand | time_series_regression |
Temporal sequence and forecast-style target |
| Predict customer churn from notes | text_classification |
Free-text input is central |
| Classify chest images | image_classification |
Image input |
| Estimate time to treatment failure | survival |
Time-to-event outcome |
| Identify unusual claims | anomaly_detection |
Outlier detection without ordinary supervised labels |
| Recommend products to users | recommendation_system |
User-item interaction structure |
| Rank candidate search results | ranking_models |
Ordered relevance objective |
| Classify actors or nodes in a contact network, including CAVIAR-style phased networks | network_analysis |
Graph structure, centrality, and phase changes matter |
| Estimate conditional relationships among biomarkers, survey variables, or monitored signals | graphical_models |
The goal is dependency structure, not supervised prediction or observed edge analysis |
Classification vs Regression vs Count Regression
- Use classification for discrete classes.
- Use regression for continuous numeric outcomes.
- Use count regression for non-negative integer outcomes, especially when counts are skewed or overdispersed.
Cross-Sectional vs Longitudinal vs Time Series
- Cross-sectional workflows assume independent rows.
- Longitudinal workflows model repeated measures, subject IDs, and within-subject structure.
- Time-series workflows model ordered temporal dependence.
If Two Services Seem Plausible
Prefer the service that preserves the strongest dependency in the data:
- repeated person/entity structure beats ordinary cross-sectional treatment
- time ordering beats shuffled-row treatment when the deployment use case is temporal
- censoring/time-to-event structure beats ordinary binary classification
- user-item interaction structure beats ordinary tabular classification
- graph connectivity beats flattened node tables when edges carry signal
- inferred conditional-dependence structure beats ordinary graph analysis when the edges are not observed but estimated from variables
Related Source Docs
Source: docs/book/chapters/06-responsible-use-scope-and-limitations.md
Responsible Use, Scope, And Limitations
This chapter explains what the platform is for, what it is not for, and how to use its outputs responsibly. The platform can automate a large amount of modeling, comparison, explainability, and reporting work, but it does not remove the need for human judgment, domain review, or methodological caution.
What The Platform Is Good At
The platform is strongest when the user needs:
- a guided workflow from upload to trained model outputs
- comparison across multiple candidate models
- durable artifacts, plots, metrics, and report-ready summaries
- transparent warnings about data quality, missingness, imbalance, or unsupported models
- explainability and manuscript-style reporting grounded in saved artifacts
In those settings, the platform helps teams move faster while preserving more audit trail than a loose collection of notebooks or ad hoc scripts.
What The Platform Is Not
The platform is not:
- a guarantee that the selected model is causally valid
- a substitute for subject-matter expertise
- a substitute for clinical, legal, or policy review
- proof that a result is deployable just because it scored well on one validation split
- proof that an AI-generated report is publication-ready or regulator-ready
It is best understood as a high-structure applied ML workflow system, not as an automatic truth engine.
Use Outputs As Decision Support, Not As Unquestioned Truth
Model outputs, SHAP values, rankings, survival curves, anomaly flags, and AI reports should all be treated as decision-support artifacts. They may surface useful patterns, but they do not resolve:
- causal interpretation
- external validity
- fairness or bias questions
- regulatory acceptability
- operational fit in the real deployment environment
The strongest use pattern is to combine platform outputs with domain review, independent plausibility checks, and explicit governance for the final decision.
Scope Boundaries By Workflow
Different service families create different kinds of risk.
Cross-Sectional And Longitudinal Prediction
These workflows are good for prediction and structured comparison, but they do not by themselves justify causal claims. Leakage, repeated-subject splitting mistakes, and threshold misinterpretation can make a model look stronger than it really is.
Time Series
Time-series workflows are especially vulnerable to future leakage, horizon confusion, and accidental use of random splits where chronological validation was needed.
Text And Media
Text and media models can appear strong while relying on artifacts of labeling, file formatting, class imbalance, or spurious visual/textual cues. Per-class review matters more than a single overall metric.
Survival
Survival outputs require careful interpretation of censoring, follow-up time, and risk scores. A survival model is not automatically a clinical decision rule.
Anomaly Detection And Clustering
These workflows are especially easy to over-interpret. Clusters are not necessarily meaningful groups, and anomaly scores are not ground truth labels unless independently verified.
Recommendation, Ranking, And Network Analysis
These workflows need extra care around popularity bias, group/query definitions, graph structure validity, and whether the evaluation setup reflects the real product question.
AI Reports Need Human Review
AI-generated reports should be treated as structured drafts, not final scientific or operational documents.
Users should verify:
- that references are relevant to the actual study topic
- that numerical claims match saved metrics and plots
- that figures render both in the app and in downloadable outputs
- that unresolved placeholders, declarations, and metadata fields have been completed
- that the wording does not overstate what the underlying workflow actually established
If the report sounds more certain than the saved evidence supports, the report is wrong, even if it reads well.
Explainability Has Limits
SHAP and related explanations describe model behavior, not causal effect. They can help answer:
- which inputs moved the prediction
- which features mattered globally
- whether the model seems to rely on plausible signals
They do not answer:
- whether changing a feature would change the outcome in the real world
- whether the model is fair across subgroups
- whether the feature importance is stable under correlated predictors or distribution shift
Explainability is useful, but it is not an epistemic shortcut.
Common Misuse Patterns
Users should actively avoid:
- choosing the wrong workflow for the data structure
- treating accuracy as sufficient on imbalanced outcomes
- leaving identifier or post-outcome features in the dataset
- interpreting predictive models as causal evidence
- treating anomaly or clustering outputs as self-validating
- shipping AI report text without checking the saved evidence underneath it
When To Stop And Escalate
Pause and escalate to deeper review when:
- the selected workflow may be wrong for the data shape
- metrics are suspiciously perfect or unstable
- key plots are missing or inconsistent with the result tables
- billing, recovery, or completion state looks contradictory
- the domain is high-stakes enough that false confidence would be costly
- the report context or reference list looks generic, incomplete, or off-topic
This is not a sign of failure. It is part of responsible use.
A Practical Trust Checklist
Before relying on a platform result:
- confirm the workflow matches the data and target
- confirm the validation design is appropriate
- review the best model against alternative candidates
- inspect warnings, skipped models, and missing artifacts
- verify SHAP or explanation outputs only after the model itself is plausible
- verify the AI report against saved metrics, figures, and declarations
- decide explicitly whether the output is suitable for exploration, internal decision support, publication drafting, or production deployment
Deep References
Source: docs/book/chapters/07-running-jobs.md
Running Jobs
Jobs are the execution unit for training, explainability, reporting, and generated artifacts.
What A Job Contains
A job records the service type, uploaded data reference, selected columns, model options, budget estimate, execution state, model results, plots, artifacts, and add-on actions such as SHAP or AI report generation.
The job ID is the durable handle used by the job workspace, result directory, billing ledger, report routes, and downloadable artifacts.
Artifact-Backed Review Spine
The current job detail page, AI Report tab, public demo workspace, and handbook use the same review vocabulary. A completed or partially completed job should preserve these evidence classes when possible:
| Evidence class | Saved artifact | Where users see it |
|---|---|---|
| Readiness profile | eda/readiness_profile.json |
Upload replay, EDA/readiness review, AI report context |
| Dataset split contract | dataset_split_contract.json |
Model Performance context, Validation Dataset section, AI report split narrative |
| Service diagnostics | service_diagnostics.json |
Job detail EDA tab and report context |
| Explainability status | explainability_status.json |
SHAP Analysis tab and AI report interpretation |
| Reproducibility manifest | reproducibility_manifest.json |
Audit/review context and methods appendix |
| Methods appendix | methods_appendix.json, methods_appendix.md |
AI Report tab and report downloads |
Older completed jobs can be backfilled from saved result files without retraining. Backfilling these review artifacts does not change the trained model or wallet ledger; it makes the saved evidence easier to inspect.
For active jobs, model/training_results.json is an intermediate training
snapshot, not final completion proof by itself. The job should remain active
until final pipeline evidence such as job_results.json or report.json
confirms that model visuals, diagnostics, reports, and settlement context have
finished writing. This prevents a result page from racing ahead while the last
model-comparison or diagnostic plots are still being generated.
Job Lifecycle
- Created
- Queued
- Running
- Generating artifacts
- Completed, failed, cancelled, or partially completed
Expected Job Execution Workflow
A normal training workflow should move through these user-visible steps:
- Choose the service that matches the data structure and study aim.
- Upload the dataset, media bundle, or manifest required by that service.
- Map required roles such as target, features, subject ID, time, event, query, user, item, node, or edge columns.
- Choose whether evaluation comes from an internal split, a split column, or separate train/validation/test files, and map any sampling-weight column.
- Preview readiness and cost before committing credits.
- After readiness succeeds, choose the first comparison strategy and adjust model selections if the study needs a broader or narrower comparison.
- Confirm training and let the platform create a durable job ID.
- Monitor the job workspace or job detail page for status, progress, logs, billing events, and model-level outcomes.
- Review the completed result package: model comparison, metrics, confidence intervals, plots, warnings, saved artifacts, billing settlement, and optional add-ons such as SHAP, AI report generation, or prediction.
This workflow is service-aware, but the contract is consistent: upload, readiness, cost review, training, persisted artifacts, interpretation, and optional regeneration.
The full model catalog should remain visible where a service supports model choice. Presets provide the first comparison strategy; they should not hide the broader set of models that a user may want to test. Service-specific hyperparameters and runtime controls are secondary tuning decisions.
What Happens During Training
Training normally includes:
- validating required columns and target values
- preparing preprocessing transforms
- splitting or validating the dataset according to service rules, including user-supplied split columns or train/validation/test files when provided
- creating an internal final test split from uploaded training rows when the user supplies train and validation files but no test file
- applying sampling weights to compatible model families and recording when a selected backend cannot use them directly
- running candidate models
- collecting metrics and failure reasons
- selecting the best model under the service objective
- saving model, metadata, plots, and result summaries
- settling training credits against actual work
For larger services, models may run in sequence or by guarded groups. A skipped model can be a healthy outcome if the runtime knows the model is unavailable, too expensive, or incompatible with the dataset.
For regression and count-regression services, Model Results should surface the model-evaluation plot set when available: actual-versus-predicted, model comparison, feature importance, residual diagnostics, residual distribution or QQ plot as appropriate, and training-time comparison. If only one plot appears, inspect the saved plot inventory and completion state before assuming the service failed to generate diagnostics.
When a validation split is present, the job detail page should include a dedicated Validation Dataset section. That section reports validation performance metrics separately from the main Model Performance table and shows validation-specific best-model visuals when the service saved them. For classification-like services, those visuals are confusion matrix, ROC curve, and precision-recall curve. For other services, the visuals should be the service-specific validation diagnostics rather than borrowed classification plots.
Runtime Signals
The job UI should expose:
- current stage
- percent complete where credible
- latest event
- successful and failed models
- output artifacts
- cost and settlement state
- next recommended action
Live monitoring uses two delivery paths:
- live snapshots and log events for immediate updates
- polling against persisted job state as the fallback and catch-up path
The persisted job manifest is the authority. If the browser reconnects or misses a burst of logs, the monitor should catch up from progress, current_step, state_version, last_heartbeat, and recent live_events.
For long jobs, compute-heavy training is offloaded from the interactive web request path. This keeps polling and live-log traffic responsive during workflows such as survival, longitudinal, time-series, ranking, and media classification.
Some upload forms submit inline and keep the user on the upload page while the job starts. Those forms should show the same live-monitor contract as the job detail page: current stage, status text, recent log events, and a progress bar fed by persisted job state. The live log is a convenience surface; the job manifest remains the authoritative source.
Upload pages should not show training configuration as the primary intake step. Required role mapping and readiness preview come first. Model selection, advanced tuning, cost confirmation, and launch controls are mounted after the readiness preview succeeds so the user is choosing models with the dataset shape and guardrail context already visible.
Completed Versus Partially Completed
Completed means the workflow produced the expected primary outputs. Partially completed usually means the main job produced useful outputs but one or more optional parts failed, such as a candidate model, plot, explainability add-on, or report artifact.
Users should look at the successful model list, failed model list, warnings, and generated artifacts before deciding whether to rerun.
How To Evaluate Successful Job Execution
Do not judge a job only from the final status badge. A successful execution should have enough saved evidence to support review and reuse:
- Terminal state is
completedor an explicitly explained partial-completion state. - At least one candidate model trained successfully, unless the selected workflow is an unsupervised diagnostic whose primary output is not a trained predictor.
- Failed or skipped models have reasons such as dependency unavailable, guardrail skipped, efficiency skipped, incompatible data, or fit failure.
- Best-model selection used a metric that matches the service objective.
- Performance tables include the expected metrics, and confidence intervals are present where the workflow supports them.
- Plots, model artifacts, metadata, and result summaries exist in the job result directory and are reachable from the job detail page.
- Active-job recovery did not promote an intermediate training snapshot to a
terminal status before final
job_results.jsonorreport.jsonevidence was written. - Readiness profile, service diagnostics, explainability status, reproducibility manifest, and methods appendix are available or the UI states which evidence class is missing.
- Live logs do not continue past a terminal state except as read-only replay or add-on activity for SHAP, report generation, or prediction.
- Billing shows reservation, settlement, refund, and net charge consistently with the wallet ledger.
- Optional SHAP, AI report, and prediction actions are evaluated separately from the main training job because they are add-on actions.
For a specific job, inspect the saved job record, training results, plot inventory, logs, and wallet-backed billing ledger before making a claim.
Failure Handling
Model failures do not always mean the whole job failed. Some models may be skipped because dependencies are unavailable, runtime guardrails apply, or model-specific fitting fails. The report should distinguish:
- preflight unavailable
- efficiency-skipped
- failed during training
- completed successfully
If the application server is stopped or reloaded while training is still
running, the background task may be cancelled before the service writes final
artifacts. The platform should persist a terminal interrupted state rather than
leaving the job running forever. User-requested cancellations should become
cancelled; shutdown or reload interruptions should become failed with an
interruption message and refund handling where billing has already reserved
credits.
Reruns And Regeneration
Rerun training when the data, target, service choice, or model options were wrong. Regenerate add-ons when the training output is correct but derived artifacts need refreshing, such as SHAP, AI reports, manuscript references, or report figures.
Regeneration should use the saved job payload and result artifacts, not a generic fallback context.
Related Chapters
- Billing And Credits
- Artifacts And Implementation
- Reproducibility, Audit Trail, And Regeneration
- Runtime Guardrails
Source: docs/book/chapters/08-understanding-results.md
Understanding Results
Completed jobs generate metrics, plots, model artifacts, metadata, and optional reports.
Core Outputs
- best model and model-comparison table
- performance metrics
- train/test counts
- feature list
- diagnostic warnings
- plots
- serialized models
report.jsonjob_results.json- optional SHAP outputs
- optional AI report artifacts
Reading The Result Page
Start with the selected model and the comparison table, then move outward to diagnostics:
- Confirm the service and target are correct.
- Check how many rows, classes, events, or files were used.
- Review the selected metric and whether it matches the goal.
- Inspect failed or skipped models so the comparison is not misunderstood.
- Confirm whether the main Model Performance table is internal, validation, uploaded test, or internally generated test evidence.
- Review plots and per-class/per-group diagnostics.
- Open explainability only after the model itself looks plausible.
- Generate or review the AI report after numbers and figures are stable.
Reading Supplied Splits
dataset_split_contract.json is the result-page source of truth for upload
combinations. If validation and test are both present, the main Model
Performance table should use test evidence and the Validation Dataset section
should show validation evidence separately. If validation is uploaded without a
test file, AutoML creates an internal test split from the uploaded training file
before fitting; the main table should use that generated test split and the
Validation Dataset section should still show the uploaded validation metrics.
Do not treat validation and test as interchangeable. Validation evidence is for model checking, threshold review, or tuning where a service supports it. Test evidence is the final performance estimate. Reports should name the split used for each claim and should state when the test split was generated internally.
For classification-like services, validation visuals should include validation performance metrics, confusion matrix, ROC curve, and precision-recall curve when those files are saved. Regression, count, longitudinal, time-series, survival, ranking, recommendation, anomaly, and network services should use the validation plots that match their own metric family and data structure.
Interpreting Best Model Selection
Best model selection depends on the service and metric. Classification workflows often prioritize PR-AUC [@DavisGoadrich2006] or ROC-AUC [@HanleyMcNeil1982] for imbalanced data. Regression workflows use error and goodness-of-fit metrics. Specialized workflows use service-specific criteria.
The best model should be interpreted with:
- metric confidence intervals
- class balance
- runtime and model complexity
- threshold behavior
- explainability availability
- domain plausibility
The best model is not always the most complex model. A simpler model can be preferred when performance is similar, threshold behavior is more stable, explainability is stronger, or deployment cost is lower.
Common Classification Metrics
- Accuracy
- Precision
- Recall
- F1
- ROC-AUC
- PR-AUC
- specificity
- balanced accuracy
- Youden's J
Binary Cutoff And Threshold Plots
For binary classification services, the platform standardizes the operating cutoff used by plots, reports, and prediction outputs. When a best model exposes probabilities, Xalec computes an optimal cutoff from Youden's J, defined as:
Youden's J = sensitivity + specificity - 1
The saved threshold_performance.png plot shows accuracy, precision, recall,
specificity, F1, balanced accuracy, and Youden's J across candidate thresholds.
It marks the selected optimal cutoff with a vertical line. The roc_curve.png
plot can also mark the same operating point so users can see where the chosen
threshold sits on the ROC curve.
Use this cutoff as the model's deployed decision threshold unless there is a documented domain reason to use a different operating point. A different cutoff may be appropriate when false positives and false negatives have asymmetric costs, but that decision should be documented separately from the automated model comparison.
Common Regression Metrics
- MAE
- MSE
- RMSE
- R-squared
- residual plots
Reading Weak Regression Fit
Low or negative R-squared does not automatically make a job useless, but it does mean the model has little demonstrated lift over a simple baseline on the validation split. Interpret it alongside RMSE and MAE on the target scale, the target standard deviation, confidence intervals, and residual plots.
A near-zero R-squared with RMSE close to the target standard deviation usually means the available features are not explaining much held-out variation. Such a job can still be useful as:
- a baseline showing that the current data is weak for prediction
- evidence that more features, better timing variables, or data-quality review are needed
- a diagnostic result for residual patterns, outliers, and feature influence
- a reason to defer deployment until validation improves
It is not a strong deployment candidate unless the absolute error is acceptable for the user's decision context and later validation confirms the model remains useful.
Result Interpretation By Workflow
| Workflow | Interpret with special attention to |
|---|---|
| Classification | class balance, positive-class definition, threshold, per-class error. |
| Regression | residual shape, outliers, scale of error, prediction range. |
| Count regression | zero inflation, over-dispersion, non-negative predictions. |
| Longitudinal | subject-level leakage, repeated-measure correlation, time/order effects. |
| Time series | temporal split, forecast horizon, seasonality, future leakage. |
| Text/media | per-class performance, rare classes, ambiguous labels, failed decodes. |
| Survival | event/censoring balance, follow-up time, risk interpretation. |
| Clustering/anomaly | domain review of discovered groups or flagged records. |
| Recommendation/ranking | top-k quality, coverage, popularity bias, query/group structure. |
| Network | graph connectivity, isolated nodes, node/edge feature quality. |
When To Rerun
Rerun the job when the selected service was wrong, the target was mis-specified, obvious leakage exists, too many candidate models failed for fixable dependency reasons, or metrics do not answer the real user question.
Do not rerun only because one model family failed if the comparison still produced a trustworthy winner and the failure is clearly documented.
Related Source Docs
References
Source: docs/book/chapters/09-explainability-and-ai-reports.md
Explainability And AI Reports
The platform supports SHAP-style explainability outputs and LLM-assisted AI reports.
The Xalec assistant is documented separately in 10-assistant-and-controlled-rag.md. AI reports generate report drafts from saved job context, while the assistant answers user questions through controlled retrieval from the handbook, service metadata, and job artifacts.
Explainability Goal
Explainability should help users understand which features influenced model behavior and whether the model is learning plausible patterns. It is not proof of causality, clinical validity, fairness, or deployment readiness.
SHAP And Surrogate Explainability
SHAP explains model predictions by attributing contribution values to features [@LundbergLee2017]. Exact SHAP support varies by model family and runtime dependency. The app may use:
- tree explainers for tree models [@LundbergLee2020]
- kernel or permutation explainers for non-tree models
- precomputed SHAP values when available
- surrogate feature-importance outputs when native SHAP is unavailable [@Ribeiro2016]
For neural models such as mlp, keras_mlp, and keras_cnn, explainability may use model weights or prediction-response permutation fallback [@Fisher2019] when native SHAP cannot run reliably.
For time-series jobs, explainability should be panel-aware. When the fitted
forecaster does not expose a native tabular SHAP contract, the user-initiated
SHAP action can write a pooled panel surrogate bundle over the saved job
artifacts. The metadata should say whether the surrogate explained model
prediction response or fell back to observed target response, and should record
the series identifier, time column, sampled series, row counts, and the
pooled_global panel scope. This is distinct from training-time diagnostics:
training may prepare metadata and ordinary plots, but it should not silently run
billable SHAP.
SHAP is a user-initiated action from the completed job page or API. Training does not imply that SHAP has already run, and a completed training job can still show no SHAP artifacts until the user launches the explainability action.
SHAP Interpretation Rules
- Confirm the model and metric are acceptable before interpreting SHAP.
- Treat feature contribution as model behavior, not causal effect.
- Check whether SHAP is native, kernel/permutation-based, or surrogate-style.
- For encoded categorical variables, map features back to human-readable terms where possible.
- For correlated predictors, interpret rankings cautiously because attribution can be shared or unstable.
AI Reports
AI reports summarize study context, data, methods, model results, explainability, limitations, and references. They should be treated as structured drafts requiring human review.
AI reports should be grounded in saved artifacts. A report should not invent study context, overstate causal conclusions, cite unrelated topic references, or describe figures that do not render.
AI report generation and regeneration are also user-initiated actions. They use the saved job artifacts available at launch time; they are not automatically generated by successful training.
The normal review surface is the AI Report tab on the job detail page. That tab
embeds the same focused-reader report surface used by /llm-report/<job_id>, so
users can read the manuscript and executive brief without leaving the job
context. The standalone route remains useful for focused reading or sharing a
direct report link when access rules allow it.
Artifact-Backed Methods Appendix
Every report should be able to point back to the saved evidence that shaped its methods language. The platform writes a compact methods-evidence artifact from saved job files rather than from free-form prose alone. In generated manuscripts, the main Methods section keeps only a short signpost and the detailed model methodology evidence is rendered as Appendix A so the Methods narrative stays readable. The appendix uses:
- readiness profile;
- model preset and selected/effective model evidence;
- service diagnostics;
- explainability status;
- reproducibility manifest;
- report and training result artifacts.
The AI Report tab links to the methods-evidence appendix when it exists. For older jobs, the job detail route can rebuild the markdown appendix from saved artifacts. This backfill is a review artifact; it does not retrain models or alter billing.
Manuscript-Style Reports
The AI manuscript/report workflow should align:
- title and abstract with the detected study domain
- introduction and discussion with topic-relevant references
- methods with the actual service, target, model comparison, and validation approach
- results with saved metrics, plots, SHAP outputs, and selected model metadata
- references with the resolved reference list displayed in the manuscript
- downloadable HTML with the same figures and edited text shown in the app
Report Trust Checklist
- references match the study topic
- no prompt leakage
- no unresolved placeholders
- numeric claims match saved tables
- figures render in the app and downloaded report
- SHAP section reflects the actual explainability method
- methods appendix agrees with the saved readiness, model-selection, explainability, and reproducibility artifacts
- limitations disclose data and model constraints
Human Review Checklist
- Are all numerical claims traceable to saved result files?
- Does the report avoid implying causality from prediction alone?
- Are model failures or skipped methods disclosed when relevant?
- Are domain-specific references appropriate for the study topic?
- Are author declarations, funding, ethics, data availability, and conflicts complete?
- Does the downloaded report match the in-app preview after edits?
Related Source Docs
- Understanding results
- Metrics and validation
- Billing and credits
- Assistant and controlled RAG
- Artifacts and implementation
References
Source: docs/book/chapters/10-assistant-and-controlled-rag.md
Assistant And Controlled RAG
Xalec includes an in-app assistant for handbook-grounded help and job-artifact diagnosis. The assistant is not a generic chatbot, broad analyst, strategy advisor, or autonomous reasoning agent. The current live assistant is a simple, controlled retrieval-augmented generation system: it retrieves approved handbook chapters, service metadata, or saved job evidence, summarizes only that evidence, cites exact sources, and says when evidence is missing.
The earlier V1 and bounded-agentic assistant architectures have been retired from the live runtime. Historical support modules may remain for release evidence or export utilities, but the canonical runtime export mlagent_website.assistant.AssistantRAG uses the guarded implementation in mlagent_website/assistant/simple_rag_v2.py. There is no V1 runtime fallback.
The assistant is available from the dockable app widget and the full assistant workspace at /assistant.
The readable handbook surface is served from the rendered Quarto book at /book/.
Legacy /handbook links remain as a Markdown fallback and compatibility path,
but normal product links should open /book/ so users get the complete book
navigation, search assets, and generated export styling.
What The Assistant Helps With
The assistant is intended to help users:
- choose the right service for a dataset
- understand required columns, readiness warnings, presets, and model families
- understand dataset setup choices such as split columns, separate train/validation/test files, validation versus test evidence, and sampling weights, including train-plus-validation uploads that generate an internal test split
- interpret metrics, confidence intervals, SHAP outputs, plots, and AI reports
- diagnose a specific job from saved artifacts and logs
- explain runtime guardrails, skipped models, and backend availability only from handbook or job evidence
- understand billing, refunds, charges, and add-on actions from recorded evidence
- navigate prediction workflows and known-subject versus new-subject behavior
- explain where saved artifacts live and what evidence is missing
It should answer in plain language, cite the evidence it used, and avoid dumping raw retrieved chunks or JSON unless the user explicitly asks for implementation detail. It should not analyze unseen datasets, invent product strategy, make generic business/medical/legal/financial recommendations, or present itself as a replacement for a human analyst.
Evidence Sources
The assistant uses a controlled source hierarchy:
- Saved job artifacts and logs for a specific job question.
- Running service metadata, model catalog, routes, pricing, and configuration for platform behavior.
- This handbook for stable product and methodology guidance.
For user-facing handbook answers, the approved source is the handbook Markdown. Navigation files, legacy investigation notes, and internal design notes should not be presented as user-facing evidence unless the question is explicitly about developer or administrator internals.
The assistant should retrieve from handbook source Markdown, not from generated HTML, PDF, or DOCX outputs. Citations may point users to the rendered book for reading, but the evidence boundary remains the source handbook and saved job artifacts.
Job-Specific Answers
For job-specific questions, the assistant should inspect saved evidence such as:
- job manifest
- model training-results record
- final job-results record
- report record
- job metadata record
dataset_split_contract.json, saveddataset_split_policy, andsplit_evaluation_metricsruntime_guardrails.jsonfor service-family cost estimates, disabled models, and runtime-budget warningsreproducibility_manifest.jsonfor dataset fingerprints, split settings, model roster, runtime controls, and artifact inventoryreport_validation.json,prompt_package.json,manuscript_context.json,report_tables.json, andllm_telemetry.jsonfor AI report quality, prompt-snapshot, author-completion, table, and provider evidencemodel/validation_policy.json,model/best_model_evaluation.json, andmodel/optimal_cutoff.jsonfor validation semantics, best-model held-out predictions, and threshold/cutoff evidence- per-job logs
- plot inventory and SHAP artifacts
- billing, action, prediction, or report artifacts where available
If an artifact is absent, the assistant should say that the evidence is missing. It should not infer a refund, plot, SHAP completion, model success, prediction output, or report generation unless a saved artifact proves it.
The assistant should not index every service implementation file or pipeline module for ordinary user answers. Those files define behavior, but user-facing job answers should flow through stable saved contracts such as split, guardrail, reproducibility, report-quality, validation-policy, and threshold artifacts. This keeps answers auditable and avoids exposing implementation details as if they were job evidence.
For train/validation/test questions, the assistant should first explain the standard split contract from the handbook and then inspect job artifacts for a specific job. Train plus validation without uploaded test means AutoML creates an internal test split from the uploaded training file before fitting; uploaded validation remains validation evidence and should appear in the Validation Dataset section when validation metrics or split-specific validation plots were saved.
Current Simple RAG Runtime
The assistant follows one controlled loop:
- classify the question into an intent and question archetype
- build an evidence plan with allowed source types
- match the question against AutoML ontology concepts
- retrieve approved handbook, service metadata, or job-artifact evidence
- rank sources so substantive handbook chapters and saved artifacts outrank index/navigation chunks
- synthesize a concise answer with citations
- attach source-inspection metadata that explains why each cited source was selected
- format the answer as sanitized HTML with MathJax-compatible notation for equations
- verify citation validity, source policy, redaction, and unsupported-claim risks
- return a compact answer-quality audit for review
This is why the assistant may refuse to answer a high-trust claim when the needed evidence is not present. A refusal with the missing evidence named is preferable to a confident unsupported answer.
The live assistant does not run an autonomous tool-planning loop. For high-evidence questions, such as job diagnosis, guardrails, billing, prediction, plots, SHAP, reports, or readiness, it chooses the appropriate approved retriever directly and applies the same evidence, citation, and verification rules. If a job id is absent or the saved artifact is missing, it should say what evidence is missing rather than inferring the answer.
For unsupported questions, the assistant uses a strict scope fallback. It should say that it can only answer from the Xalec AutoML Services Handbook, service metadata, or saved job artifacts, then name the kind of evidence needed. It must not turn a broad advice question into a loosely related handbook summary.
For signed-in users, assistant turns may be saved as durable threads through /api/assistant/threads. The saved thread record stores sanitized question and answer text plus compact source metadata; it does not copy row-level uploaded data into the assistant memory.
Optional Semantic Recall
The assistant can use a semantic recall layer, such as local hash embeddings, Chroma, OpenAI, or Ollama embeddings, to improve handbook retrieval. Semantic search is a recall booster, not an autonomous reasoning engine.
By default, semantic indexing should be limited to handbook content under docs/book/**. Job logs, billing events, saved artifacts, uploaded datasets, and row-level data should not be sent to external embedding providers unless a separate redaction and tenant-safety policy is explicitly implemented.
When semantic indexing is enabled, the vector index carries a freshness manifest. The manifest records the embedding configuration and approved handbook source fingerprints so the quality gate can detect a missing or stale index before deployment.
Retrieval results should expose visible retrieval signals where available. These include semantic score, lexical or metadata match signals, source kind, and source-quality ranking notes. These signals are for traceability and review; they should not be treated as user-facing proof unless the cited source itself supports the claim.
Traceability Matrix
The assistant maintains simple steering and evaluation coverage linking intents to question archetypes, ontology concepts, required source kinds, preferred source paths, and evaluation cases. High-risk intents such as billing, runtime guardrails, job diagnosis, SHAP or plot claims, prediction guidance, dataset split setup, sampling weights, and labeled anomaly evaluation must have explicit evidence contracts and evaluation coverage before the RAG readiness gate can pass.
Regenerate the matrix when intents, ontology concepts, source policies, or evaluation fixtures change:
python scripts/build_assistant_rag_traceability_matrix.py
Quality Dashboard And Feedback Loop
The assistant quality cockpit is available at /assistant/quality. It shows:
- latest answer-quality report status
- coverage-gate status
- RAG readiness status
- vector-index freshness status when semantic retrieval is enabled
- simple-RAG runtime and steering status for high-risk answer contracts
- real-job fixture coverage
- feedback-driven improvement proposals
- proposal gate state
When a user marks an answer as insufficient, the app stores a redacted feedback event and creates a pending improvement proposal. Proposals can be reviewed from the quality cockpit, opened in a detail view, approved, rejected, reset to pending, or exported as staged eval-case candidates.
Approved proposals are exported to reports/assistant_rag_feedback/staged_approved_eval_cases.json. Exporting approved proposals does not automatically change the live ontology, answer policies, source rules, or golden evaluation fixtures. Human review and normal code review are still required.
Evaluation Gates
The assistant should be evaluated on more than retrieval success. The quality harness checks:
- ontology and expected-source coverage
- answer quality and citation validity
- pressure safety for unsupported refund, SHAP, plot, model-success, and job-outcome claims
- real-job fixture behavior from saved folder shapes
- source redaction and cross-user job-access protection
- user-response quality, including clarity, usefulness, actionability, and raw-dump avoidance
The main local gate is:
python scripts/run_assistant_rag_quality_gate.py
The assistant should not be treated as deployment-ready after documentation or retriever changes unless these quality gates pass.
Good Questions To Ask
Useful assistant questions include:
- "Where should I start?"
- "What service should I use for repeated subjects over time?"
- "What does this confidence interval mean?"
- "Why is SHAP unavailable for this job?"
- "What happened in job_...?"
- "What runtime guardrails apply to longitudinal services?"
- "Why was this model skipped by the guardrails?"
- "Was this job refunded?"
- "Why is this plot missing?"
- "Can this trained model support known-subject prediction?"
For job questions, include the job id or ask from the job detail page so the assistant can retrieve the right artifacts.
Related Source Docs
Source: docs/book/chapters/11-billing-and-credits.md
Billing And Credits
Billing uses one simple story across the product:
- Subscription gives platform access and an included credit allowance.
- Top-ups buy extra compute when the plan allowance is not enough.
- Jobs and add-ons consume credits through estimate, reserve, settlement, and refund.
This story applies to training, SHAP, AI reports, large batch prediction, and any future billable compute action.
Simple Pricing Story
Use the same terms in the pricing page, billing workspace, job detail page, assistant answers, and support documentation:
- Subscription access covers the workspace, service access, retention, collaboration or governance features, and the included plan credits for the active billing period.
- Included plan credits refresh according to the billing cycle. They are not cash, do not represent purchased wallet balance, and normally do not roll forward indefinitely.
- Purchased top-up credits are separate wallet credits bought for extra compute. They remain available until used unless account terms or an enterprise contract defines an expiry rule.
- Billable work shows an estimate before launch, reserves the current estimate, then settles to a final net charge or refund after the platform knows what was produced.
- Trial credits, when enabled, are an optional one-time registration grant. They are not a subscription allowance and should not be described as a default paid-plan benefit.
Pricing Options
Xalec uses a hybrid billing model: subscription access plus included credits, top-ups for extra compute, and settled usage for compute-heavy work.
The current plan posture is:
- Starter: for solo pilots, lightweight experimentation, and core tabular or lower-cost workflows.
- Professional: for regular analyst, consultant, or applied-research work that needs broader service access, SHAP, advanced diagnostics, and report generation.
- Team: for shared workspaces with pooled credits, seats, role-based review, admin visibility, and workspace spend caps.
- Enterprise: for institutions needing invoice billing, private deployment, SSO/governance, custom retention, contract-defined usage bands, and configurable approval thresholds.
Plan choice should start from expected workload, collaboration needs, governance requirements, and tolerance for variable compute cost. It should not be chosen only from the service name. A small cross-sectional run can fit a lighter plan, while repeated large longitudinal, media, ranking, recommendation, graph, SHAP, and report-heavy work may need Professional, Team, or Enterprise controls.
Credits And Dollar Equivalents
Credits are the internal unit for billable work. The app should show the estimated credits and dollar equivalent before the user commits to a charge. Current self-serve top-ups are documented as starting at $0.10 per credit, while subscription plans include product access and bundled monthly credits.
The plan fee should not be read as a pure credit-resale price. Plan fees can also cover product access, support, queueing, artifact retention, collaboration, and governance features.
Subscription Credit Lifecycle
Subscription plans combine platform access with an included credit allowance. Wallet top-ups are separate compute purchases. The product should keep these balances understandable because they behave differently.
- Included plan credits are bundled into a monthly, yearly, Team, or Enterprise plan. They support the current billing period and normally reset at the next cycle rather than rolling forward indefinitely.
- Purchased wallet credits are top-up credits bought separately for extra compute. They remain in the wallet until used, unless a future account term or enterprise contract defines a specific expiry period.
- Monthly plans refresh the included credit allowance at the start of each billing cycle. Unused included credits do not create a cash balance, refund, or unlimited future compute liability.
- Yearly plans may provide credits as a monthly or quarterly allowance, or as a contract-defined annual pool. Team and Enterprise annual pools should use admin spend caps and approval thresholds so one early workflow does not consume the full contract unintentionally.
- If credits remain at month end, included plan credits reset according to the plan cycle, while purchased wallet credits remain available.
- If credits are depleted before month end, the user can buy top-up credits, upgrade the plan, wait for the next allowance refresh, or request an admin-approved workspace spend-cap increase.
- If a user cancels or downgrades, unused included plan credits should not be cashed out. Purchased wallet credits should follow the account terms for reactivation, expiry, or refund handling.
The billing UI should label these balances separately: plan allowance, purchased wallet credits, reserved credits, settled net charges, refunds, and remaining available balance.
Credit Source Labels
Ledger labels should keep the source of credits clear:
subscription_allowance: included plan credits for the active billing period.top_up_purchase: purchased wallet credits from a payment provider or approved invoice.trial_credit: optional one-time registration or promotional credit.service_debit: reserved or direct charge for training, SHAP, reports, prediction, or another billable action.service_refund: credits returned after failure, cancellation, or settlement below the reserved amount.
Historical rows may still contain legacy labels such as initial_credit or payment_credit. Product copy should normalize those rows to the same story: trial credits are optional grants, and payment credits are top-up purchases.
Choosing A Cost Strategy
For exploratory work, start with Preview Data Readiness, a modest model set, and a low-cost or balanced preset. Expand model coverage after the first run shows the dataset is suitable and the early model comparison is useful.
For production or shared workspaces, prefer plans that provide admin review, spend caps, and pooled credit visibility. Team and Enterprise workspaces should use spend caps and approval thresholds for high-cost jobs, premium workflow families, SHAP, report generation, and large batch prediction.
Break-Even Framing
Per-job break-even depends on settled credits, not the initial estimate alone.
job revenue = settled credits * price per credit
job breaks even when job revenue >= variable job cost
At the current self-serve top-up anchor of $0.10 per credit, a job that settles at 100 credits produces $10 of gross revenue. If the variable compute, storage, provider, and support cost for that job is $3, the job has a 70% gross margin:
gross margin = (revenue - variable cost) / revenue
gross margin = ($10 - $3) / $10 = 70%
For a target gross margin, the required revenue is:
required revenue = variable cost / (1 - target gross margin)
required credits = required revenue / credit price
Company-level break-even also depends on fixed monthly costs such as hosting, support, development, monitoring, payments, and administration:
required monthly revenue = fixed monthly costs / blended gross margin
This is why shadow pricing, model-family weights, dataset/media-size factors, and settlement logs matter. They show whether plan allowances and per-job charges are commercially sustainable before pricing changes are turned on for paid users.
Why Reserve And Settle Exists
Jobs can vary in runtime, model availability, optional add-ons, and artifact generation. The platform debits the current estimate before work begins, then settles to the actual charge after it knows what completed.
This avoids charging users for outputs that were not produced while still making estimated cost visible before expensive work starts.
Typical Billing Flow
- Debit the current estimated credits before execution.
- Run the workflow.
- Settle based on actual successful work.
- Refund unused credits when applicable.
- Refund failed add-ons when outputs are not produced.
If training is interrupted, cancelled, or fails before producing a billable trained output, the training reservation should be refunded. The refund must appear as a wallet ledger event before the product can say the user was actually refunded.
Billable Actions
- training jobs
- SHAP/explainability add-ons
- AI report generation
- batch prediction at scale
- storage or retention where configured
Training charges should be based on successful trained outputs after settlement, not simply the number of models originally requested. If no billable trained output is produced, the training reservation should settle to zero or be refunded according to the active failure path.
Manual prediction is free for single-record previews from a completed job. Batch prediction is metered after the included row/item allowance and may reserve credits based on the uploaded row/item count, upload or media size, service multipliers, and selected model-family factors.
Pricing Rollout State
Training pricing now records both the current charged estimate and a shadow
enhanced estimate. The enhanced estimate considers model family, dataset size,
media size, and runtime signals. By default, this runs in shadow mode so real
job deltas can be reviewed before changing live charges.
Important fields:
training_estimated_creditsandtraining_reserved_credits: the amount used for the current wallet reservation.training_shadow_estimated_credits: the enhanced price that would apply if the rollout mode were active.training_settlement_cost_details: the actual settlement calculation after successful models and runtime are known.training_billing_summary: a compact job-level summary of estimate, reservation, settlement, refund, and charge-reference fields.
The enhanced pricing switch is controlled by MLAGENT_TRAINING_PRICING_MODE.
Use shadow while inspecting margins and set it to active only after the
observed deltas look acceptable.
Model-family weights should be treated as calibrated product policy, not as a
universal mathematical truth. Good weights are anchored in objective signals
such as runtime, memory pressure, GPU/provider cost, artifact size, dependency
risk, support burden, and observed failure/refund rates. They still require
business judgment because plan positioning, user expectations, and margin goals
also matter. Keep enhanced pricing in shadow mode until real job telemetry
shows that the proposed deltas are explainable, stable, and fair across service
families.
Late-Failure Policy
Early validation failures, missing files, platform errors, and dependency
failures should still refund the reservation. For late failures that occur after
meaningful compute has already been spent, the platform records a shadow partial
charge. The late-failure policy is controlled separately by
MLAGENT_LATE_FAILURE_BILLING_MODE.
In shadow mode, the user still receives the normal refund while the job stores
what the partial charge would have been. In active mode, eligible late failures
can keep a bounded minimum charge and refund the rest. This should be enabled
only after reviewing real failure patterns.
Reading A Ledger Entry
Ledger entries should be read as a sequence:
Up-front debit: estimated credits were deducted before execution.Settled: final charge was computed after execution.Refunded: unused reservation was returned.Net charge: the final amount the user actually paid.
For example, if a workflow debits 50 credits and later refunds 50 credits, the final net charge is 0 credits. If it debits 13 credits and refunds 7 credits, the final net charge is 6 credits.
User-Facing Explanation
Billing language should make net charge clear:
- up-front debit amount
- refunded amount
- final net charge
- reason for settlement or refund
- dollar equivalent when a credit-to-dollar conversion is configured
For job-level billing displays, the wallet ledger is the source of truth for actual debits, refunds, and settlements. Job-local billing mirrors can help with context and troubleshooting, but duplicate local mirror rows should not be rendered as additional wallet charges.
Add-On Billing
Add-ons such as SHAP or AI report generation should only settle as a net charge when the requested output is produced according to the product contract. Failed or unavailable add-ons should be refunded or settled to zero according to the active billing rules.
What Users Should Check
- The estimate before starting the action.
- Whether failed models changed the final charge.
- Whether optional add-ons produced artifacts before settling.
- The final net charge after any refund.
- Whether the wallet balance changed by the expected amount.
Failed Or Pending Refunds
A failed job can have a saved debit and a failed refund attempt at the same time. In that case, the billing workspace should show refund attention from saved job metadata even though the wallet ledger has not yet recorded the refund. Treat this as unresolved billing state, not as a completed refund.
Common fields to inspect are:
training_refund_statustraining_refund_errortraining_refund_referencebilling_summary.refund_status- wallet ledger entries with
entry_type=service_refund
Administrators can retry a failed training refund through the training-refund reconciliation endpoint after correcting the underlying issue. A common cause is a mismatch between the web app and auth/billing service INTERNAL_REFUND_SECRET values. The secret must match in the web app environment and auth_payment_service environment, and the auth/billing service must be restarted after a change.
Related Source Docs
Source: docs/book/chapters/12-architecture-and-execution-flow.md
Architecture And Execution Flow
This chapter gives the system-level view of the canonical product. It explains how the FastAPI/Jinja app, service pipelines, job persistence, monitoring, billing, and AI reporting fit together as one operating workflow rather than as separate tools.
Canonical Product Surface
The source of truth for the product experience is the FastAPI/Jinja web application. In practice, that means:
- application routes that coordinate pages and APIs
- shared templates that keep workflows consistent
- shared CSS and JavaScript that provide one visual system
- one application entrypoint that starts the product shell
Legacy or adjunct interfaces may exist in the repository, but the main product shell, jobs flow, billing flow, and report flow are centered on this route-driven web app.
Architecture Layers
The system can be understood in six layers.
flowchart TD
A[User and Browser] --> B[FastAPI and Jinja App]
B --> C[Routes and APIs]
C --> D[Job Manager and Pipeline]
D --> E[Domain Services]
E --> F[Saved Artifacts and Results]
F --> G[Job Detail and Download Surfaces]
F --> H[SHAP and AI Report Actions]
C --> I[Billing and Auth Services]
H --> F
I --> G
Figure: High-level product architecture from user actions through routes, pipelines, saved artifacts, reporting, and billing.
1. Presentation Layer
The presentation layer is the user-facing shell built from Jinja templates, shared upload forms, job detail views, and report/billing surfaces.
Primary responsibilities:
- guide service selection and upload
- display long-running state clearly
- surface artifacts, plots, SHAP, billing, and AI reports
- keep service workflows feeling like one product
2. Route And Application Layer
The route layer translates user actions into pipeline operations, job launches, report generation, wallet/billing actions, and result retrieval.
Primary responsibilities:
- register pages and APIs
- validate requests and normalize inputs
- map UI actions to durable job and artifact workflows
- expose websocket or polling state to the frontend
3. Pipeline And Job Layer
The pipeline/job layer creates durable job records and runs the shared workflow stages that every service depends on.
Primary responsibilities:
- create/update job manifests
- track progress, stage, and terminal state
- run shared preprocessing, EDA, and readiness steps
- orchestrate service-specific training and post-processing
4. Domain Service Layer
The domain service layer contains the actual ML workflow implementations for tabular, longitudinal, time-series, text, media, survival, specialized, and advanced-system services.
Primary responsibilities:
- service-specific preprocessing
- model registration and training
- evaluation, comparison, and plot generation
- prediction and artifact persistence
5. Reporting And LLM Layer
The reporting layer converts saved job evidence into structured report context and manuscript-style outputs.
Primary responsibilities:
- assemble structured report inputs from saved job artifacts
- resolve references and study-domain context
- generate manuscript-style reports and executive summaries
- persist rendered report outputs and validation metadata
6. Billing, Auth, And Operations Layer
The operational layer handles wallet logic, reservation/settlement, user identity, and workflow monitoring semantics.
Primary responsibilities:
- reserve and settle credits
- expose wallet and ledger history
- connect users to their jobs and report actions
- preserve operational truth across live monitoring and recovery
Core Execution Flows
Training Flow
The normal training flow is:
- The user selects a service and uploads data.
- The route layer validates the request and stages input files.
- A durable job record is created.
- The pipeline runs shared EDA/readiness and dispatches the chosen domain service.
- Candidate models train, evaluate, and persist artifacts.
- Results, plots, metrics, and metadata are written into the job result directory.
- Billing settles against actual completed work.
- The job detail page presents the final outputs.
flowchart LR
A[Service Selection and Upload] --> B[Route Validation and Staging]
B --> C[Job Created]
C --> D[EDA and Readiness]
D --> E[Model Training and Comparison]
E --> F[Artifacts and Metrics Saved]
F --> G[Billing Settlement]
G --> H[Job Detail, Downloads, and Prediction Surfaces]
Figure: Operational training flow showing the durable path from upload to settled results.
Reporting Flow
The reporting flow is deliberately downstream of training:
- The user explicitly launches AI report generation or regeneration.
- The reporting route builds structured manuscript context from saved job payloads and artifacts.
- The report generator writes manuscript HTML, metadata, validation files, and resolved references.
- The report surface reads those durable outputs rather than inventing context on the fly.
- Billing settles only after the requested report action reaches a durable outcome.
Monitoring Flow
Live monitoring is a delivery problem, not a truth problem.
The operating rule is:
- persisted state is truth
- websocket and polling are transports
- raw log lines are supporting evidence, not status authority
flowchart TD
A[Persisted Job and Artifact State] --> D[Visible Status Truth]
B[Websocket Updates] --> D
C[Polling and Log Tails] --> D
B -. transport only .-> A
C -. supporting evidence only .-> A
Figure: State-truth rule for monitoring. Durable persisted state outranks transports and log-derived impressions.
That distinction matters because users should not see stale progress labels, duplicate launches, false recovery messages, or billing confidence that the stored job state does not actually support.
Upload-page monitors use the same state-truth rule. When a workflow starts without immediately navigating away from the form, the embedded progress area should initialize only after its markup exists, then catch up through the shared job monitor. This avoids a form that says only "Processing..." while the real job is already advancing elsewhere.
Event-Loop Responsiveness For Long Jobs
Some service methods are declared as async but internally run long synchronous model-fitting work. Those services must not execute their full training loop on the FastAPI event loop, because doing so can starve websocket sends, polling requests, auth-status refreshes, and heartbeat traffic until the model fit returns.
The shared pipeline therefore offloads CPU-heavy async training for longitudinal, time-series, ranking, survival, and media-classification workflows. Survival is included because lifelines, scikit-survival, and neural survival model fits can run for minutes while still being wrapped by an async service entry point.
For users, the intended behavior is:
- the upload-page progress bar should advance from queued, through EDA, through model training, and into completion
/api/job-status/<job_id>should remain responsive while the job is active- websocket snapshots and polling should show the same persisted state
- if the websocket reconnects, the job manifest and
live_eventsare used to catch the UI up
If a reload or shutdown cancels a background task, cancellation is treated as a
first-class terminal runtime outcome. Instrumentation should record the stage as
cancelled, and the job route should mark the job as cancelled or interrupted
instead of allowing a None pipeline result to masquerade as successful
completion.
Persistence Model
Each job has two durable homes:
- a job manifest that records its identity and state
- a job-specific artifact directory that stores results, plots, and evidence
Typical persisted outputs include:
- model and preprocessor artifacts
- plots and EDA summaries
- training results and comparison tables
- SHAP artifacts and plot files
- manuscript/report artifacts
- billing and validation metadata
Long-running services should persist core metrics and model results before optional finalization work such as plots, feature importance, or report assembly. That snapshot gives recovery and job-detail pages a durable source of truth even if the server is interrupted while optional artifacts are still being generated.
During an active run, that early snapshot must not be treated as terminal
completion on its own. model/training_results.json can exist while final
model-comparison plots, service diagnostics, reproducibility metadata, billing
settlement context, and report.json are still being written. Active-job
rehydration may merge model facts from the snapshot, but it should promote the
job to completed only when final pipeline evidence such as job_results.json or
report.json is present.
This persistence model is what makes regeneration, report rebuilding, downstream prediction, and auditability possible.
Invariants That Matter
Several workflow truths are more important than any one UI rendering:
- one authoritative training payload should win over stale recovery fragments
- active jobs should not become terminal from intermediate training snapshots alone
- completed outputs should not be mislabeled as recovered unless recovery actually happened
- one user click should produce one action launch
- billing UI should reflect authoritative ledger state, not placeholders
- downloadable report outputs should match the saved manuscript state shown in the app
These are not cosmetic concerns. They determine whether the system feels trustworthy under interruption, regeneration, or partial failure.
Why This Architecture Matters For The Book
This book is not only a service catalog. It is also a map of how the product behaves end to end. The architecture view helps readers connect:
- upload pages to pipelines
- pipelines to saved artifacts
- saved artifacts to SHAP and AI reports
- live job state to billing and recovery behavior
Without that systems view, the service chapters can look self-contained when, in reality, they are part of one shared platform contract.
Deep References
Source: docs/book/chapters/13-eda-figures-and-reporting-reliability.md
EDA, Figures, And Reporting Reliability
EDA and figure generation are the first trust layer of the product. If the statistical summary is shallow, the plots are missing, the plot manifest is stale, or the report context is only partially populated, every later stage becomes harder to trust.
Why This Layer Matters
Users do not experience the platform only as model metrics. They experience:
- what warnings the system gave before training
- which plots appeared on the job page
- whether SHAP images actually display
- whether downloaded reports match the embedded manuscript
- whether live monitoring and billing messages reflect the true state
That means the reliability contract is broader than "model finished."
The EDA Contract
The non-negotiable product target is that every active service returns the same high-level EDA structure:
{
"statistics": {},
"warnings": [],
"readiness_checks": {},
"recommended_models": [],
"plots": ["eda/plot_a.png", "eda/plot_b.png"]
}
This does not require identical diagnostics across services. It requires that every service produce a truthful, consistent manifest the pipeline, UI, caching layer, and report generator can rely on.
Feature-distribution panels should be materialized as independent plot entries where possible. A combined "all features" image is harder to inspect, harder to reuse in reports, and easier to lose in route-level filtering. The EDA tab should therefore be able to display each feature-distribution plot as its own card across active services.
Model-evaluation plots are a separate contract. Actual-versus-predicted, residual, QQ or residual-distribution, feature-importance, model-comparison, and training-time plots belong in the Model Results surface rather than being mixed into EDA simply because they are PNG files.
Service-Aware EDA
The right EDA depends on the service family:
- classification needs target balance and class diagnostics
- regression needs target shape and residual-oriented readiness checks
- count regression needs zero-inflation [@Lambert1992] and over-dispersion [@CameronTrivedi1998] visibility
- longitudinal workflows need subject/time structure checks, including subject coverage, attrition, observations per subject, target observation or missingness over time, dropout pattern, last observed visit distribution, covariate missingness over time, average outcome trends, class prevalence over time for categorical targets, and time-gap diagnostics
- time-series workflows need order-aware and lag-aware diagnostics
- survival needs event/censoring and time-to-event summaries
- media/text need file/content readiness checks rather than only table plots
For longitudinal workflows, these are EDA figures rather than model-specific diagnostics. ROC curves, confusion matrices, threshold plots, residual plots, feature-importance plots, and model-comparison plots belong in model-results or appendix contexts. They should not be promoted as the primary longitudinal EDA story merely because they are available as image files.
Generic plots are better than nothing, but they are not enough for product-grade trust.
Course-Alignment Contract
The MIT-IDSS notebook review is now represented as a service-family contract in
mlagent_website/utils/course_alignment.py. The contract does not replace the
live service catalog. Instead, it names the EDA checks, model families,
evaluation metrics, plot groups, and implementation checks that each service
family should make visible.
Readiness profiles include a course_alignment section so a preview, saved job,
report, or audit can inspect what the workflow was expected to check. This keeps
course-derived expectations out of one-off prose and gives the product a stable
way to explain why a service should show, for example, residual diagnostics for
regression, zero-count cues for count regression, cold-start diagnostics for
recommendation, or graph integrity checks for network analysis.
Figure Reliability Problems The Repo Already Exposed
The repo history already shows several concrete failure patterns.
1. Plots Generated But Not Registered
A plot can exist on disk and still not appear in the job UI if the authoritative plot manifest is not updated. The SHAP display investigation showed exactly this pattern: SHAP images were generated, but eda_results.json was missing the corresponding plots/shap/... entries, so the template never surfaced them.
2. Metrics Exist But Diagnostic Plots Do Not
An anomaly detection workflow can compute metrics successfully and still fail to save the model file required for later diagnostic plotting. If that save failure is swallowed silently, the later plot stage sees "file missing" and the UI ends up looking incomplete without explaining why.
3. Route-Level Mitigation Is Not Enough
Filesystem rescans and route-level plot merging can hide some persistence problems, but they are not a durable substitute for writing the right authoritative manifest during the workflow itself.
4. Early Completion Can Race Final Plot Writes
Intermediate training snapshots can appear before final model-comparison plots
or report metadata are saved. The UI should not treat those snapshots as
terminal completion for active jobs. A job is ready for full result review only
after final pipeline evidence such as job_results.json or report.json is
available and the plot inventory can be hydrated from disk.
5. Report Figures Can Drift From Manuscript State
If report regeneration, reference resolution, or manuscript context loading is incomplete, the embedded report can look updated while the downloadable output or validation metadata tells a different story. This is especially risky for legacy-job regeneration.
Monitoring Reliability Is Part Of Reporting Reliability
Users interpret logs, status pills, progress labels, recovery notices, and billing messages as part of the result. That means live logging and workflow-state invariants are part of report reliability, not a separate concern.
Important operational rules include:
- persisted state must beat stale frontend inference
- one action launch should create one action
- terminal states should not regress because of old live fragments
- recovery labels should appear only when real recovery happened
- billing states should not imply authoritative settlement when the ledger does not support it
Practical Reliability Checklist
Before calling a workflow or report output trustworthy, verify:
- the EDA payload includes a real
plotsmanifest - plot paths are relative and job-local
- plot files on disk match the manifest
- SHAP plots are registered after they are generated
- report context files are populated from the saved job payload
- validation JSON warns when structured report context is partial or missing
- the in-app report and downloadable report reference the same figure set
- live status, billing state, and action recovery labels match durable backend truth
- active jobs were not marked completed from intermediate
model/training_results.jsonalone
What Product-Grade Looks Like
For this platform, product-grade reliability means:
- no active service returns placeholder-only EDA
- every active service emits domain-appropriate plots
- figure paths are durable and renderable in both app and report surfaces
- report generation is grounded in saved artifacts, not generic fallback context
- warnings are explicit when context or figures are incomplete
Deep References
- Data preparation
- Understanding results
- Explainability and AI reports
- Architecture and execution flow
- Reproducibility, audit trail, and regeneration
- Troubleshooting
References
Source: docs/book/chapters/14-service-reference-overview.md
Service Reference Overview
The service reference covers 20 active service workflows and the current upload-visible model catalog. Model counts are generated from service metadata so the handbook does not become stale when a workflow adds, hides, or retires a model.
Service Families
- Cross-sectional: 3 services
- Longitudinal: 3 services
- Time series: 3 services
- Text: 1 service
- Media: 3 services
- Specialized: 3 services
- Advanced systems: 4 services
20-Service Quick Cards
| Service | Models | Best For | Required Inputs | Primary Outputs |
|---|---|---|---|---|
tabular_classification |
16 | Binary or multiclass labels on one-row-per-observation data | target column, feature columns | class metrics, ROC/PR curves, confusion matrix, model artifacts |
tabular_regression |
14 | Continuous numeric outcomes | target column, feature columns | error metrics, residual plots, actual-vs-predicted plots |
tabular_count_regression |
22 | Non-negative integer counts | count target, feature columns | count-model metrics, mean-variance diagnostics, count predictions |
longitudinal_classification |
13 | Repeated-measure classification | subject column, target column, time/order column when available | subject-aware classification metrics and artifacts |
longitudinal_regression |
13 | Repeated-measure continuous outcomes | subject column, target column, time/order column when available | longitudinal regression metrics, subject-aware outputs |
longitudinal_count_regression |
14 | Repeated-measure counts | subject column, count target, time/order column when available | count metrics with repeated-measure context |
time_series_classification |
15 | Sequence classification | ordered time/sequence data, target labels | sequence classification metrics and plots |
time_series_regression |
15 | Forecasting or temporal numeric prediction | ordered time data, target column | forecast/regression metrics and temporal diagnostics |
time_series_count_regression |
15 | Temporal count prediction | ordered time data, count target | temporal count predictions and diagnostics |
text_classification |
12 | Document or text-label classification | text column, target column | text model metrics, class predictions, model artifacts |
image_classification |
13 | Image-label classification | image files or manifest, labels | image model metrics and predictions |
audio_classification |
12 | Audio-label classification | audio files or manifest, labels | audio model metrics and feature artifacts |
video_classification |
13 | Video-label classification | video files or manifest, labels | video model metrics and frame/clip artifacts |
survival |
9 | Time-to-event analysis | duration/time column, event indicator, features | survival metrics, curves, risk scores |
anomaly_detection |
18 | Outlier and unusual-pattern detection | feature columns, optional labels for evaluation | anomaly scores, threshold plots, flagged records |
clustering |
11 | Group discovery without labels | feature columns | cluster labels, cluster diagnostics, visualizations |
recommendation_system |
8 | User-item preference prediction | user column, item column, interaction/rating column | recommendations, ranking metrics, top-k outputs |
ranking_models |
15 | Ordered relevance learning | query/group column, item/candidate features, relevance label | ranking metrics, scored lists |
network_analysis |
13 | Graph-feature, transformer-style, and embedding-based node classification | edge lists or adjacency matrices, node identifiers, optional phase/wave column, labels | graph metrics, centrality rankings, phase diagnostics, node predictions |
graphical_models |
7 | Conditional-dependence, Markov transition, hidden-state, and state-space diagnostics | selected measured variables, optional state column, optional time/order column, optional outcome/anchor variable | dependency graph, precision/partial-correlation heatmaps, transition matrix/graph, edge list, dynamic diagnostics |
The complete generated list and a plain-language definition for every configured model appear in the authoritative service and model registry appendix. The upload/catalog parity summary explains the related UI contract.
Per-Service Documentation Pattern
Each service chapter should help readers answer:
- What question does this service answer?
- What data shape does it require?
- Which columns are required?
- Which models can run?
- Which models may be unavailable due to optional dependencies?
- Which metrics should users trust most?
- Which artifacts are produced?
- Which failure modes are expected and recoverable?
- Where can a developer find the supporting implementation?
Model Documentation Pattern
Each model entry should include:
- plain-language purpose
- algebraic definition
- objective or loss function
- assumptions
- preprocessing path
- implementation mapping
- metrics emitted
- interpretability behavior
- runtime guardrails
- artifacts persisted
- known limitations
Detailed Source Files
- Cross-sectional services
- Longitudinal services
- Time-series services
- Text and media services
- Specialized services
- Advanced systems
- Running jobs
- Billing and credits
Reading Pattern
Each service family chapter should eventually include:
- when to use the service
- required data structure
- preprocessing
- model inventory
- model equations and objectives
- metrics
- artifacts
- limitations
- implementation mapping
Source: docs/book/chapters/15-cross-sectional-services.md
Cross-Sectional Services
Cross-sectional services cover tabular datasets where each row is treated as one observation. They are the right starting point when the dataset has one record per person, transaction, sample, facility, image summary, or event and there is no required subject-level time ordering.
Services Covered
| Service | Route | Primary target | Use when |
|---|---|---|---|
tabular_classification |
/tabular-classification |
class label | The outcome is categorical, such as disease status, churn, fraud, quality grade, or risk group. |
tabular_regression |
/tabular-regression |
continuous value | The outcome is numeric and approximately continuous, such as cost, score, quantity, concentration, or measurement value. |
tabular_count_regression |
/tabular-count-regression |
non-negative count | The outcome is an event count, visit count, case count, claim count, or other integer-valued frequency. |
Data Contract
The common contract is a rectangular table with a target column and predictor columns. Predictors may include numeric, categorical, boolean, and date-derived fields. The workflow is most reliable when the target is cleanly encoded, column names are stable, and train/test leakage fields such as future outcomes, identifiers, or post-event summaries are removed before upload.
Classification requires a target with at least two classes. Regression requires a numeric target. Count regression expects integer-like non-negative outcomes and is the better choice when the response is skewed, zero-inflated, or naturally represents counts.
Cross-sectional services can use an internal split, a user-supplied split column, or separate train/validation/test files. The split role and any sampling-weight column are control columns, not predictors. When weights are provided, compatible model families receive the training weights; unsupported families should make the limitation visible rather than treating the weight column as a normal feature.
If users upload train and validation files without a test file, the shared split contract creates an internal test holdout from the training file before fitting. The main Model Performance table should use that generated test split, while the Validation Dataset section keeps uploaded validation metrics and best-model validation plots separate.
Shared Pipeline
The cross-sectional pipeline generally follows this pattern:
- Validate upload schema, target selection, and service-specific requirements.
- Split the dataset into training and validation/test partitions.
- Build preprocessing for missing values, categorical encoding, scaling where needed, and feature alignment.
- Train candidate model families under a consistent evaluation contract.
- Select the strongest model using service-appropriate metrics and guardrails.
- Persist model artifacts, metrics, comparison tables, plots, and report-ready metadata.
- Optionally run SHAP or compatible explainability on the selected model or the strongest explainable fallback.
Model Families
Classification and regression compare a broad set of classical and modern tabular methods:
- Linear, logistic, ridge [@Hoerl1970], lasso [@Tibshirani1996], and elastic-net style models [@ZouHastie2005].
- Naive Bayes and related probabilistic classifiers where applicable.
- Decision trees [@Breiman1984], random forests [@Breiman2001], extra trees [@Geurts2006], and bagged ensembles.
- AdaBoost [@FreundSchapire1997], gradient boosting [@Friedman2001], XGBoost [@Chen2016], LightGBM [@Ke2017], and CatBoost [@Prokhorenkova2018].
- K-nearest neighbors [@CoverHart1967] and support vector machines [@Cortes1995].
- Multilayer perceptrons [@Rumelhart1986], Keras MLPs, and compatible neural tabular paths.
Count regression adds count-specific approaches:
- Poisson generalized linear models [@McCullaghNelder1989].
- Negative binomial models for over-dispersed counts [@CameronTrivedi1998].
- Zero-inflated and hurdle-style approaches where supported [@Lambert1992].
- Tree, SVM, KNN, MLP, and boosting regressors exposed with count-specific runtime IDs such as
svm_count,knn_count,mlp_count,gradient_boosting_count, andada_boost_count. - Keras MLP/CNN count variants exposed as
keras_mlp_countandkeras_cnn_countwhen the TensorFlow/Keras runtime is available. - GAM-style or smooth count models where available through the runtime [@HastieTibshirani1990].
Metrics And Selection
Classification emphasizes discrimination and calibration signals such as ROC-AUC, PR-AUC, accuracy, balanced accuracy, precision, recall, F1, log loss, confusion matrices, and threshold behavior. For imbalanced problems, PR-AUC [@DavisGoadrich2006] and threshold sanity are especially important.
Regression emphasizes error and explained-variation metrics such as RMSE, MAE, R-squared, residual plots, and prediction-vs-observed summaries. Count regression should be interpreted through count-aware error patterns, zero handling, dispersion, and whether the model produces plausible non-negative predictions.
Artifacts
Typical outputs include:
- model comparison tables
- selected model artifact
- preprocessing artifact
- metrics JSON/CSV
- prediction summaries
- feature importance or SHAP outputs when available
- report context used by the AI manuscript/report workflow
Common Failure Modes
- Target leakage from columns that encode the answer after the fact.
- Identifier columns acting as memorization features.
- Severe class imbalance without enough minority examples.
- Count targets routed through ordinary regression when count regression would be more appropriate.
- Neural models producing a strong metric but a pathological cutoff or unstable threshold behavior.
- Optional dependency gaps for XGBoost, LightGBM, CatBoost, TensorFlow, or SHAP-compatible explainers.
Deep Reference
See the cross-sectional model mathematics for the full model inventory, algebraic definitions, and implementation notes.
References
Source: docs/book/chapters/16-longitudinal-services.md
Longitudinal Services
Longitudinal services handle repeated observations per subject, unit, facility, patient, animal, device, or cohort member. They are appropriate when the same entity appears more than once and the correlation among repeated records matters.
Services Covered
| Service | Route | Primary target | Use when |
|---|---|---|---|
longitudinal_classification |
/longitudinal-classification |
class label over repeated records | The outcome is categorical and records are clustered by subject or unit over time. |
longitudinal_regression |
/longitudinal-regression |
continuous repeated outcome | The outcome is numeric and measured repeatedly for the same entity. |
longitudinal_count_regression |
/longitudinal-count-regression |
repeated count outcome | The outcome is a count observed repeatedly by subject, period, visit, or facility. |
Data Contract
Longitudinal workflows require more structure than ordinary tabular workflows. At minimum, the dataset should identify:
- a subject, unit, or grouping column
- a time, visit, wave, or ordering column
- a target column
- predictor columns measured before or at the same time as the target
The workflow is strongest when each subject has multiple observations and the time variable has a meaningful order. A dataset with only one row per subject should usually use a cross-sectional service instead.
Longitudinal validation must state whether held-out performance represents new subjects or later visits from known subjects. The saved split policy should record the split strategy, train/test subjects, test size, and whether the evaluation rows came from a user-supplied split. For regression and count regression, downstream plots such as actual-versus-predicted and residual diagnostics should read from saved held-out predictions where available rather than re-predicting with a different subject/time context.
Train, Validation, And Test Files
When users provide separate files for a longitudinal workflow, every file should use the same long-format structure: one row per subject or entity at one visit, time point, or ordered observation. The train, validation, and test files should have compatible column names and data types, including the same subject ID column, time or visit column, target column, and predictor columns. Optional sampling-weight columns should be numeric, non-negative, and excluded from the model feature set.
The right split structure depends on what the user wants to prove:
- For new-subject generalization, subjects in train, validation, and test should be mutually exclusive. This answers whether the model works for new people, facilities, devices, customers, or other entities not seen during fitting.
- For future-visit prediction among known subjects, the same subject may appear in more than one split, but validation and test rows should be later observations than that subject's training rows. This answers whether earlier history can predict later outcomes for subjects already known to the system.
Avoid an ordinary random row split unless that is explicitly justified. Random row splitting can put different visits from the same subject into both train and test, which can leak subject history and make performance look stronger than it is.
If users provide train and test files without a validation file, the train file is still the fitting source. A service may carve an internal validation subset from the training rows for tuning, threshold selection, or early stopping, but the uploaded test file should remain final held-out evidence. If users provide train and validation files without a test file, the uploaded validation file remains model-checking evidence and Xalec should create a subject-aware internal test holdout from the uploaded training file before fitting. If users provide a single file with a split column, the split roles should follow the same subject/time logic and the split column should be excluded from model features. The job page should keep longitudinal validation metrics and validation plots in the Validation Dataset section rather than mixing them with final test evidence.
Method Families
The longitudinal family combines statistical panel methods, mixed-effects methods, and machine-learning methods adapted to repeated measurements:
- Fixed-effects and random-effects style models.
- Generalized estimating equations for correlated outcomes [@LiangZeger1986].
- Linear and generalized mixed-effects models [@LairdWare1982].
- Longitudinal random forests and historical forests.
- REEM/MERF-style mixed-effects ensembles [@Hajjem2011; @SelaSimonoff2012].
- GPBoost-style boosted mixed-effects models where available [@Sigrist2022].
- Count models adapted to subject/time structure.
- Tree and boosting fallbacks when panel-native models are unavailable.
MERF, REEMforest, and MECB remain available as advanced mixed-effects variants for smaller panels, but they are not normal default choices. Preview Data Readiness estimates their interactive fit score and disables them with a warning when the estimate exceeds the 500,000 balanced guardrail. The backend keeps the same budget enforcement so bypassing the upload UI does not launch unsafe long runs.
Upload forms keep Balanced as the interactive default. Users who need
package-style reference behavior can opt into the CRAN/reference preset, which
uses heavier defaults and should be expected to increase runtime and credit
estimates. The reference preset is intended for parity checks, audit work, or
method-comparison runs, not for every first-pass analysis.
The native longitudinal package path now expects both local packages to be installed and importable from the application virtual environment:
longiturfsuppliesMERT,MERF,MECB,REEMTree,REEMForest, andREEMCatBoost.pyhtreesuppliesHTB,HRF, andHCBhistorical-tree backends.
Startup should report pyhtree (HTB/HRF/HCB) available when these backends are
loaded. If those imports fail, the affected historical-tree models should be
treated as unavailable rather than silently shown as trainable.
HTB and HRF follow the historical-tree workflow and control behavior exposed
by the local pyhtree bridge. HCB is the CatBoost historical-tree variant in
the Python package and should use the same subject/time-aware historical
contract, even though it is not a separate CRAN htree export.
For longitudinal count regression, advanced count GEE and count GLMM
variants are production-available only when their registered wrappers and
runtime dependencies are present end to end. The app should declare and install
statsmodels and patsy, register the count wrappers in the service catalog
and upload form, and keep train, predict, save/load, metrics, SHAP, and report
compatibility covered by tests. If those dependencies are missing at runtime,
the models should be preflight-unavailable rather than appearing as broken
checkboxes.
Standalone randomforest is not exposed as a longitudinal service model. The
longitudinal services instead expose named panel-aware families such as HRF,
MERF, REEMforest, and their CatBoost variants. Those families may use tree
or forest learners internally, but the user-facing model key should preserve the
longitudinal method family rather than appearing as a generic random forest.
What Makes The Workflow Different
Longitudinal workflows must protect against treating repeated rows as independent when they are not. The important design questions are:
- Should validation split by subject rather than by row?
- Does the model use group identifiers as random effects, fixed effects, or ordinary predictors?
- Does the time column represent visits, calendar time, exposure duration, or follow-up?
- Are predictors measured before the target, or do some fields leak future information?
These questions affect interpretation as much as model performance. A high score from a row-wise split can be misleading if the same subject appears in both training and validation records.
Metrics And Selection
Classification, regression, and count metrics mirror the cross-sectional services, but the interpretation should be subject-aware. Strong validation should consider whether performance holds across subjects, visits, and time periods rather than only across pooled rows.
For repeated outcomes, a single pooled metric is not enough. The first visual layer should describe the panel itself: subject coverage, attrition, observation density, target observation or missingness over time, time gaps, average outcome trends, class prevalence for categorical outcomes, and feature-stratified outcome trends where relevant. Fitted-model diagnostics can support model review, but they should not replace these EDA plots as the main longitudinal evidence. The book treats the selected model as an empirical prediction model unless the method and study design support a stronger causal or inferential interpretation.
Artifacts
Typical outputs include:
- subject/time-aware validation metadata when available
- model comparison tables
- selected model and preprocessing artifacts
- group/time configuration captured in job metadata
- longitudinal EDA visuals suitable for report generation, including subject coverage, attrition, observations per subject, target observation or missingness over time, dropout pattern, last observed visit distribution, covariate missingness over time, average outcome trends, class prevalence over time where applicable, and time-gap diagnostics
- model-results visuals such as actual-versus-predicted, residual diagnostics, feature-importance, model-comparison, and training-time plots when generated, kept separate from the EDA evidence layer
- AI report context describing the repeated-measures structure
Common Failure Modes
- Missing or incorrectly selected subject/time columns.
- Only one observation per subject.
- Leakage from post-outcome measurements.
- Row-wise validation that overstates performance for repeated subjects [@Roberts2017].
- Optional package gaps for advanced mixed-effects or longitudinal ensemble methods.
- Sparse panels where some subjects have too few observations for stable subject-specific patterns.
- Broken local editable installs for
longiturforpyhtree, which can make native longitudinal backends disappear at startup.
Deep Reference
See the longitudinal model mathematics for package-specific implementation notes, runtime guards, and the full model inventory.
References
Source: docs/book/chapters/17-time-series-services.md
Time-Series Services
Time-series services handle ordered sequences, temporal dependence, lagged structure, and forecast-style features. They are appropriate when the order of observations is part of the signal rather than a nuisance variable.
Services Covered
| Service | Route | Primary target | Use when |
|---|---|---|---|
time_series_classification |
/time-series-classification |
class label for a sequence or time window | The goal is to classify a pattern over time, such as event type, signal class, or risk state. |
time_series_regression |
/time-series-regression |
continuous value over time | The goal is forecasting or predicting a numeric value from temporal history. |
time_series_count_regression |
/time-series-count-regression |
event count over time | The goal is to predict case counts, arrivals, incidents, visits, or other temporal frequencies. |
Data Contract
Time-series workflows need a time column or an explicit sequence structure. Depending on the service, the dataset may represent one series, many parallel series, or multiple entities with their own time-indexed records. The key requirement is that the workflow can determine temporal order and avoid using future observations to predict the past.
Good inputs make clear:
- time index, timestamp, period, or sequence order
- target column or class label
- series identifier when multiple series are present
- covariates available at prediction time
- forecast horizon or windowing assumptions when relevant
When common panel identifiers such as series_id, subject_id, entity_id,
or similar columns are present but not explicitly mapped, the workflow should
infer them where possible. This keeps grouped time-series plots from collapsing
parallel series into one duplicate-time trace.
Multi-Series Workflow
When a time-series upload contains multiple known series, Xalec treats it as a pooled panel workflow by default rather than as many unrelated single-series jobs. The workflow should:
- detect or confirm the series identifier, usually
series_id,subject_id,entity_id, or a similar grouped-series column - validate per-series length, duplicate
(series, time)rows, missing periods, and irregular gaps - hold out the final horizon or validation windows inside each series when the task is forecasting known future periods
- train one pooled model per selected algorithm
- rank algorithms using aggregate per-series validation error across the pooled holdout, primarily RMSE with MAE as the next tie-breaker
- save per-series error summaries and representative forecast plots for inspection
- render
actual_vs_predicted.pngas a series-aware validation plot rather than connecting unrelated series into one line - write by-series diagnostic companions for ACF/PACF, rolling statistics, and target drift when grouped regression data are available
- default prediction to all trained series, while still allowing a focused forecast for one selected series and a user-selected horizon
A separate single-series upload remains the simpler workflow for one sequence. For a multi-series job, the model performance table is expected to have one row per algorithm, not one row per series. Series-level diagnostics explain where the pooled model is strong or weak.
Forecast Horizon Contract
time_series_regression and time_series_count_regression now expose an
explicit forecast horizon before Preview Data Readiness. The horizon is the
number of future time periods the user wants the model to forecast. During
readiness preview, Xalec validates that the horizon is positive and shorter than
the usable ordered history. During training, the same value defines the
chronological validation holdout: the last N ordered observations are held out,
the model trains on the earlier history, and prediction defaults to N future
periods unless the prediction request supplies a different horizon.
For grouped or multi-entity count time series, the horizon is interpreted per
series when possible so each entity keeps historical training rows and the final
N periods form the validation segment. If no horizon is supplied, the service
falls back to the existing test_size holdout while recording the implicit
holdout in the saved job artifacts. The prediction form defaults to forecasting
all trained series for that horizon unless the user chooses a specific series.
Classification remains a sequence/window labeling workflow and does not use
this forecasting horizon contract.
Prediction Workspace Display
For time_series_regression and time_series_count_regression, the prediction
workspace treats prediction as a forecast-window action rather than as one
isolated future point. After a successful prediction, the History and Next
Prediction panel should show the selected series' observed target history and
overlay the returned future forecast rows for the chosen horizon. In
multi-series jobs, the prediction table and download may contain forecasts for
all trained series, but the trend plot focuses on the currently selected series
so series are not visually mixed.
Historical fitted predictions are shown only when the saved model/artifact contract provides one prediction per historical time point. Native forecasting models often return a future horizon rather than row-wise in-sample fitted values; in that case, the app should not draw a misleading historical predicted line. The caption should make clear that the displayed red forecast segment is the future prediction window, while the blue series is the observed history.
Classification Window Contract
time_series_classification uses a related but distinct contract. The user
sets a lookback window and a classification horizon before Preview Data
Readiness:
- Lookback window: how many recent periods the classifier may use as historical context when creating lag and rolling features.
- Classification horizon: how far ahead the class label is defined. A horizon
of
0means classify the current row label; a horizon of1means use history at timetto classify the label att + 1. - Validation windows: the final chronological windows held out for testing. If left blank, Xalec derives the holdout from the configured test size.
For grouped time-series classification, validation windows are taken from the end of each series where possible so short series still keep earlier rows for training. Saved job artifacts record the lookback, horizon, label mode, validation mode, and usable labeled row count so reports and predictions remain interpretable.
Method Families
The restored documentation covers both feature-based time-series models and sequence-native methods:
- ROCKET [@Dempster2020] and MiniROCKET [@Dempster2021] feature transforms.
- InceptionTime-style deep classifiers [@FawazInceptionTime2020].
- LSTM [@HochreiterSchmidhuber1997], GRU [@Cho2014], CNN-1D, CNN-LSTM, and temporal convolutional networks [@Bai2018].
- Transformer-style sequence encoders [@Vaswani2017].
- ARIMA and auto-ARIMA style statistical forecasting [@BoxJenkins1976].
- Exponential smoothing and trend/seasonality models [@Holt1957; @Winters1960].
- VAR for multivariate temporal dependence [@Sims1980].
- GARCH-style volatility models [@Engle1982; @Bollerslev1986].
- Prophet-style decomposable time-series models where available [@TaylorLetham2018].
- Count-adapted temporal models for event frequencies.
The sequence-classification inventory is deliberately narrower than the
forecasting inventory. ARIMA, Auto ARIMA, VAR, GARCH,
Exponential Smoothing, and Prophet are available for numeric or count
forecasting services, while /time-series-classification exposes models that
directly produce class labels or class probabilities.
Time-series count regression includes native count forecasters and sequence wrappers that do not behave like ordinary scikit-learn estimators. During final training cleanup, the workflow should persist model metrics before optional plot/report finalization, generate model-comparison and training-time plots from the saved metrics, and skip expensive permutation feature-importance fallbacks for native count forecasters. Feature importance should be shown only when the fitted model exposes a meaningful and tractable importance contract.
Validation Discipline
Time-series validation should respect time. Random splits can leak future information into training and inflate performance. The safer pattern is chronological validation, rolling-origin evaluation, or blocked validation that preserves order [@Bergmeir2012].
For multi-series data, validation should also consider whether the task is future prediction for known series, generalization to new series, or both.
If users supply train/validation/test files or a split column, the service must still preserve chronological meaning. A supplied test split should represent future periods, held-out windows, or another defensible temporal evaluation design. For grouped time series, the preferred evaluation holds out the tail of each known series when forecasting future periods for those same series. If users provide train and validation files without a test file, the internally created test split should be time-ordered from the uploaded training file and the uploaded validation file should remain separate model-checking evidence. The job page should present time-series validation metrics and validation forecast diagnostics in the Validation Dataset section when those artifacts are saved.
Metrics And Selection
Classification uses the same class metrics as other classification services, but should be read across windows or horizons. Regression uses MAE, RMSE, MAPE-like summaries where appropriate [@HyndmanKoehler2006], residual plots, and forecast error by horizon. For multiple-series forecasting jobs, the persisted best-model ranking metric is aggregate per-series RMSE, with per-series MAE as the next tie-breaker. R-squared remains a useful diagnostic, but it is not the primary winner for panel forecasts because short per-series holdouts can make it unstable. Count regression follows the same per-series RMSE/MAE ranking pattern while keeping Poisson deviance as a count-specific diagnostic and later tie-breaker.
Artifacts
Typical outputs include:
- forecast or sequence prediction tables
- model comparison metrics
- selected model artifact
- temporal preprocessing/windowing metadata
- plots of observed versus predicted values
- panel-aware trend plots for grouped time-series inputs
- per-series validation error breakdowns for grouped forecasting inputs
- representative forecast plots for selected grouped series
prediction_history.csvwith row-aligned holdout predictions for the prediction workspace when the service can save one historical prediction per validation time point- ACF/PACF diagnostics when enough ordered observations are available,
including
acf_pacf_by_series.pngfor grouped inputs - by-series rolling-statistics and target-drift diagnostics for grouped time-series regression jobs
- horizon-level or window-level summaries when available
- report context describing temporal assumptions
For time-series count jobs, model-comparison artifacts should include a primary
performance comparison and a separate training-time comparison when timing data
are available. If optional finalization is interrupted, the saved
training_results.json snapshot should still contain the trained model metrics
and model inventory needed for job-detail recovery.
Common Failure Modes
- Missing or unsorted time column.
- Future leakage through rolling summaries computed incorrectly.
- Too few time points for sequence models.
- Irregular time spacing without explicit handling.
- Multiple series mixed without a series identifier.
- Optional dependency gaps for specialized time-series libraries.
- Optional finalization work, such as feature importance or plot generation, taking longer than the core model fit. Core metrics should already be saved before that work begins.
Deep Reference
See the time-series model mathematics for detailed model notes, algebraic definitions, and implementation mapping.
References
Source: docs/book/chapters/18-text-and-media-services.md
Text And Media Services
Text and media services cover unstructured inputs such as documents, images, audio, and video. These services differ from tabular services because the feature representation is learned or extracted from raw content rather than supplied directly as spreadsheet columns.
Services Covered
| Service | Route | Primary target | Use when |
|---|---|---|---|
text_classification |
/text-classification |
document or text label | The input is text and the goal is sentiment, topic, triage, category, intent, or other label prediction. |
image_classification |
/image-classification |
image label | The input is image files and the goal is object, condition, scene, class, or quality prediction. |
audio_classification |
/audio-classification |
audio label | The input is audio clips and the goal is sound, speech, event, or signal class prediction. |
video_classification |
/video-classification |
video label | The input is video files or extracted frames and the goal is activity, event, scene, or behavior classification. |
Text Data Contract
Text workflows typically require one text field and one target label. The best datasets include enough examples per class, consistent language, and minimal label ambiguity. Text may come from notes, descriptions, survey responses, abstracts, support tickets, messages, or document excerpts.
Text classification uses the shared tabular upload reader. The text and label columns may be supplied in CSV/TSV/TXT, Excel, Parquet, Feather, JSON/JSONL/NDJSON, Stata, SPSS, SAS/XPORT, or R data files when the deployment has the relevant optional readers installed.
Text classification can use the same dataset setup choices as other supervised table-based services: internal split, split column, or separate train/validation/test files. The split role and any sampling-weight column are excluded from model text/features.
When text users provide train and validation files without a test file, Xalec creates an internal test split from the uploaded training file before fitting. The uploaded validation data remains validation evidence and should be reported separately from the generated final test evidence.
The workflow may tokenize text, truncate or pad sequences, build embeddings, fine-tune transformer-style encoders [@Howard2018], or use compatible fallback classifiers depending on runtime availability and configured model options.
Text Method Families
The restored text documentation includes transformer and encoder families such as:
- BERT-style encoders [@Devlin2019].
- RoBERTa [@Liu2019RoBERTa].
- XLM-RoBERTa for multilingual contexts [@Conneau2020].
- ELECTRA, ALBERT, XLNet, MobileBERT, and MPNet variants.
- Classical text vectorization and classifier fallbacks where the runtime uses lighter paths.
Media Data Contract
Media workflows require file inputs and labels. They are sensitive to file organization, supported formats, image/audio/video quality, sample size, class imbalance, and whether the uploaded media can be decoded consistently in the runtime environment.
Image classification usually works from image files and class folders or metadata. Audio classification usually needs clips plus labels and may extract spectrogram or acoustic features. Video classification may sample frames, use temporal features, or use video-native models depending on available dependencies.
Media workflows do not use the statistical dataset reader for the media files
themselves. Upload a folder or ZIP bundle of media files, then upload a
tabular label manifest. The manifest can use the same supported tabular
formats as other upload forms, including CSV/TSV, Excel, Parquet, JSON, Stata,
SPSS, SAS, and R data files when the deployment has the relevant readers
installed. It should include one media-path column and one target-label column.
Canonical names are filename and target, while common aliases such as
path, file_path, image_name, audio_name, video_name, label,
class, and tag are accepted. Manifest paths should match the relative paths
inside the folder or ZIP bundle.
Media manifests may also include a split indicator such as split,
partition, or role. Those values are normalized to the internal split role
so evaluation can use the user's prepared train/validation/test assignment
instead of an automatic split.
For media classification, validation-specific outputs should follow the classification convention when artifacts are saved: validation performance metrics, confusion matrix, ROC curve, and precision-recall curve.
| Workflow | Supported file types |
|---|---|
| Image classification | JPG/JPEG, PNG, BMP, GIF, TIFF, WEBP, or ZIP bundles containing those files |
| Audio classification | WAV, MP3, FLAC, OGG, M4A, AAC, or ZIP bundles containing those files |
| Video classification | MP4, AVI, MOV, MKV, WEBM, M4V, or ZIP bundles containing those files |
Media Method Families
The restored media documentation covers:
- Image backbones such as ResNet [@He2016], EfficientNet [@Tan2019], DenseNet [@Huang2017], ConvNeXt [@Liu2022ConvNeXt], Inception [@Szegedy2015], ViT [@Dosovitskiy2021], Swin [@Liu2021Swin], and DeiT [@Touvron2021].
- Audio feature models, CNNs, CRNNs [@Choi2017], recurrent models, and attention-based variants.
- Video feature pipelines, frame-based classifiers, 3D CNNs [@Tran2015], and transformer-style video encoders.
Metrics And Selection
Because these services are classification-oriented, common metrics include accuracy, balanced accuracy, precision, recall, F1, ROC-AUC where meaningful, PR-AUC for imbalanced classes, confusion matrices, and per-class summaries. For text and media, per-class performance is often more useful than a single overall score because rare or visually/textually ambiguous classes can be hidden by the average.
Artifacts
Typical outputs include:
- trained classifier or fine-tuned model artifact
- label mapping
- preprocessing or tokenizer metadata
- model comparison table where multiple candidates run
- confusion matrix and class metrics
- selected examples or prediction summaries
- report context for AI-generated interpretation
Common Failure Modes
- Too few examples per class.
- Corrupt or unsupported files.
- Labels encoded only in filenames without a consistent manifest.
- Very long text fields truncated before important content.
- Media files too large for configured runtime limits.
- Optional dependency gaps for transformer, TensorFlow, PyTorch, image, audio, or video backends.
Deep References
References
Source: docs/book/chapters/19-specialized-services.md
Specialized Services
Specialized services cover survival analysis, anomaly detection, and clustering. These workflows are included separately because their targets, evaluation logic, or user goals differ from ordinary supervised prediction.
Services Covered
| Service | Route | Primary target | Use when |
|---|---|---|---|
survival |
/survival |
time-to-event plus event indicator | The question involves time until death, failure, recovery, churn, readmission, relapse, or another event. |
anomaly_detection |
/anomaly-detection |
outlier score or anomaly label | The goal is to find unusual records, rare behavior, fraud-like cases, quality problems, or signal deviations. |
clustering |
/clustering |
discovered group membership | The goal is unsupervised segmentation, cohort discovery, grouping, or structure exploration. |
Survival Data Contract
Survival workflows require at least a duration or follow-up time column and an event indicator. The event indicator should distinguish observed events from censored observations. Predictors should be measured before or at baseline relative to the survival interval.
Survival interpretation depends heavily on censoring. A model can predict risk or survival patterns, but the manuscript and report should remain clear about whether the analysis is predictive, descriptive, or inferential.
Survival Method Families
The survival documentation includes:
- Kaplan-Meier style baseline survival summaries [@KaplanMeier1958].
- Cox proportional hazards models [@Cox1972].
- Penalized and machine-learning survival variants.
- Random survival forests [@Ishwaran2008].
- Survival SVM methods where available.
- DeepSurv [@Katzman2018] and DeepHit [@Lee2018] style neural survival models.
- Survival CNN and transformer variants when supported by runtime dependencies.
Anomaly Detection Data Contract
Anomaly detection can be unsupervised or semi-supervised depending on whether labels exist. The common input is a feature table where unusual records should receive high anomaly scores. The workflow is strongest when obvious identifiers are removed and features represent behavior or measurements relevant to abnormality.
When a label or anomaly indicator is available, the service can honor a user-supplied split column or separate train/validation/test files and compute held-out metrics such as AUROC, AUPRC, confusion matrix, and precision/recall on the supplied evaluation rows. Without labels, anomaly detection should not pretend to have supervised validation; it fits on the available feature table and relies on score distribution, flagged-record review, and domain inspection.
If train and validation files are supplied without a test file, the shared split contract creates an internal test holdout from training before fitting. Validation evidence remains a separate model-checking section, while survival and anomaly services should attach their own split-specific validation diagnostics when saved.
Anomaly Method Families
The restored specialized documentation includes:
- Isolation Forest [@Liu2008].
- One-Class SVM [@Scholkopf2001].
- Local Outlier Factor [@Breunig2000].
- Robust covariance and minimum covariance determinant.
- PCA-style reconstruction or subspace methods.
- HBOS [@Goldstein2012], COPOD [@Li2020], RRCF [@Guha2016], Feature Bagging, DeepSVDD [@Ruff2018], DeepSAD, GANomaly, autoencoder, and VAE-style approaches [@Kingma2014] where supported.
Clustering Data Contract
Clustering expects features but not a supervised target. The user should identify columns that represent the segmentation problem and remove identifiers or downstream labels that would make clusters artificial.
Because clustering is unsupervised, a train/test split is not the main evidence contract. Better validation uses cluster stability, profile reproducibility, holdout assignment where available, and domain review of whether the clusters mean something useful.
Clustering Method Families
The clustering inventory includes:
- k-means and related centroid methods [@MacQueen1967].
- DBSCAN [@Ester1996], HDBSCAN [@Campello2013], and density-based clustering.
- Hierarchical clustering [@Ward1963].
- Spectral clustering [@ShiMalik2000].
- Gaussian mixture models [@Dempster1977].
- OPTICS and BIRCH.
Metrics And Interpretation
Survival analysis uses time-to-event metrics such as concordance-style summaries [@Harrell1982] and survival curves when available. Anomaly detection may use ranking metrics if labels exist, but otherwise relies on score distributions, flagged-record inspection, and domain review. Clustering uses internal validation metrics such as silhouette-style summaries [@Rousseeuw1987] and practical interpretability of the discovered groups.
Artifacts
Typical outputs include:
- survival curves, risk scores, and event/censoring summaries
- anomaly scores and flagged-record tables
- cluster assignments and cluster-profile summaries
- metrics and diagnostic plots
- selected model or pipeline artifacts
- report context describing assumptions and limitations
Common Failure Modes
- Survival jobs missing duration or event columns.
- Event indicator encoded inconsistently.
- Anomaly detection run on identifier-heavy data.
- Clustering interpreted as ground-truth classification.
- Optional dependency gaps for survival, PyOD-style, HDBSCAN, or deep anomaly models.
- Too few events, too few anomalies, or too little feature variation for stable conclusions.
Deep References
References
Source: docs/book/chapters/20-advanced-systems.md
Advanced Systems
Advanced systems cover recommendation, ranking, network analysis, and graphical models. These services move beyond one-row, one-target prediction into relational, preference, graph-structured, and probabilistic dependency workflows.
Services Covered
| Service | Route | Primary target | Use when |
|---|---|---|---|
recommendation_system |
/recommendation-system |
relevant item, score, or preference | The goal is to recommend products, documents, services, actions, or content to users/entities. |
ranking_models |
/ranking |
ordered list or relevance score | The goal is to order candidates by relevance, utility, risk, or priority. |
network_analysis |
/network-analysis |
graph-level, node-level, edge-level, or phase-comparison output | The data are naturally represented as nodes, edges, adjacency matrices, or phased networks. |
graphical_models |
/graphical-models |
dependency structure, state transitions, hidden state, or state-space trace | The goal is to infer conditional relationships or state-sequence dynamics among variables rather than analyze an observed edge-list graph. |
Recommendation Data Contract
Recommendation workflows usually require users/entities, items, and interactions. Interactions may be ratings, purchases, clicks, views, co-occurrence, clinical actions, service use, or other preference signals. Content features can be included when the workflow supports content-based or hybrid recommendation.
The core design question is whether recommendations should be based mostly on similar users, similar items, item content, popularity, or a hybrid of these signals.
Prepared split roles are supported when the interaction file marks train, validation, or test rows. The split should reflect how recommendations will be used, often by holding out later interactions or held-out user-item events rather than random individual cells without regard to time or cold-start risk. If train and validation are supplied without test, AutoML creates an internal test holdout from training before fitting and keeps validation metrics as model-checking evidence.
Recommendation Method Families
The restored advanced-systems documentation covers:
- Popularity and baseline recommendation.
- User-based and item-based collaborative filtering [@Goldberg1992; @Sarwar2001].
- Matrix factorization and latent-factor models [@Koren2009].
- Content-based recommendation.
- Hybrid recommenders.
- Clustering-based recommendation.
Ranking Data Contract
Ranking workflows require query/group identifiers or comparable candidate sets, candidate features, and relevance labels or preference outcomes. A ranking dataset should make clear which rows compete with each other. Without group structure, ranking can collapse into ordinary regression or classification.
When users supply a split, ranking validation must preserve query or group structure. A split that places competing candidates from the same query in both train and test can overstate ranking quality. When the shared split contract generates an internal test split, ranking outputs should state that final test evidence came from that generated holdout and keep validation diagnostics separate.
Ranking Method Families
The ranking inventory includes:
- XGBoost learning-to-rank models: ranker, pairwise, and listwise variants [@Burges2005; @Cao2007].
- LightGBM learning-to-rank models: ranker, pairwise, and listwise variants.
- CatBoost learning-to-rank models: YetiRank, PairLogit, and QuerySoftMax variants [@Prokhorenkova2018].
- Pointwise relevance baselines that learn relevance scores first and are then evaluated as ranked lists within held-out query groups.
The pointwise relevance baselines are deliberately labeled as baselines rather than full learning-to-rank backends. They include Random Forest, Extra Trees, Gradient Boosting, AdaBoost, KNN, and MLP relevance scorers.
Network Data Contract
Network workflows require graph structure. The upload form supports edge lists with source/target columns and adjacency matrices with node columns. Depending on the task, the dataset may also include node features, edge weights, labels, communities, timestamps, or graph-level metadata. A phase or wave column can be mapped when the user wants CAVIAR-style phase comparison; in that case training uses the aggregate graph while EDA reports per-phase size, density, connectedness, and key-actor centrality trends. The graph structure should be meaningful, not merely a transformed table for convenience.
Network validation should be graph-aware. Node, edge, link-prediction, and phase-comparison tasks can require different holdout rules; a generic row split may break the graph or leak structural information through adjacent nodes.
Network Method Families
The network analysis documentation includes:
- Graph convolutional networks [@KipfWelling2017].
- GraphSAGE [@Hamilton2017].
- Graph attention networks [@Velickovic2018].
- Graph-feature baselines such as Random Forest, Gradient Boosting, Logistic Regression, MLP, SVM, and KNN on structural features.
- Graphormer-style graph transformers [@Ying2021].
- node2vec and graph embedding methods [@Grover2016].
- Variational graph autoencoders [@KipfWelling2016VGAE].
- Broader graph neural and graph embedding variants as supported by dependencies.
Graphical Models Data Contract
Graphical-model workflows use ordinary tabular/statistical datasets but interpret selected columns as variables in a probabilistic system. A state column can be mapped for Markov transition diagnostics. A time or sequence column is optional; when present, it orders states and enables hidden-state and state-space diagnostics. A target or outcome column can be mapped as an anchor variable, but this service does not treat it as an ordinary supervised label.
This service is intentionally separate from network_analysis. Network analysis starts with observed nodes and edges. Graphical models infer dependency structure among measured variables and should not be used to claim causality without a causal design.
Graphical-model evaluation should focus on dependency stability, held-out likelihood or reconstruction diagnostics where available, and bootstrap uncertainty rather than ordinary supervised train/test metrics.
Graphical Models Method Families
The first Graphical Models rollout includes:
- Gaussian graphical lasso for sparse precision-matrix structure.
- Partial-correlation networks from empirical precision matrices.
- Ising pseudolikelihood for binary or median-binarized variables.
- Bayesian-network proxy structure from bounded pairwise dependency screening.
- Markov chain transition matrices and transition graphs from ordered state columns.
- Gaussian hidden-state sequence proxy for ordered records.
- Kalman local-level state-space trace for ordered numeric signals.
Graphical Models Mathematics And Diagnostics
Graphical-model outputs are dependency and state-dynamics diagnostics, not ordinary supervised predictions. The main models use the following contracts:
Gaussian graphical lasso estimates a sparse precision matrix $\Theta$ from the empirical covariance matrix $S$:
$$ \min_{\Theta \succ 0} \left{-\log\det(\Theta) + \operatorname{tr}(S\Theta) + \lambda \lVert \Theta \rVert_1\right}. $$
Partial-correlation networks compute:
$$ \rho_{ij \cdot -ij} = -\frac{\Theta_{ij}}{\sqrt{\Theta_{ii}\Theta_{jj}}}, $$
so larger absolute values indicate stronger conditional association after accounting for the other measured variables.
Ising pseudolikelihood uses nodewise logistic conditionals for binary or median-binarized variables:
$$ P(X_j = 1 \mid X_{-j}) = \sigma\left(\alpha_j + \sum_{k \ne j}\beta_{jk}X_k\right). $$
Markov transition diagnostics estimate:
$$ \hat P_{ij} = \frac{N_{ij}}{\sum_k N_{ik}}, $$
where $N_{ij}$ counts observed transitions from state $i$ to state $j$.
The hidden-state proxy uses Gaussian emission clusters, $x_t \mid z_t=k \sim \mathcal{N}(\mu_k,\Sigma_k)$, while the Kalman local-level diagnostic uses $y_t = \alpha_t + \epsilon_t$ and $\alpha_t = \alpha_{t-1} + \eta_t$.
Confidence intervals are reported where the implementation can compute them honestly: dependency metrics use bounded nonparametric bootstrap intervals, transition metrics resample transition counts, and state-space RMSE uses a fitted-proxy interval. Missing intervals should be explained rather than hidden.
Metrics And Selection
Recommendation and ranking systems should be evaluated with ranking-aware metrics when possible, such as precision-at-k, recall-at-k, NDCG [@JarvelinKekalainen2002], MAP, hit rate, and coverage. Network tasks depend on the specific target: node classification uses classification metrics, link prediction uses ranking or binary metrics, and graph clustering/community discovery uses structure-aware diagnostics. Graphical Models uses a compact primary diagnostic set: structure score, edge count, graph density, mean absolute edge weight, and variables/states. Markov transition entropy and self-transition rate, hidden-state AIC/BIC, transition sparsity/density, and state-space RMSE are secondary family-specific diagnostics rather than universal comparison columns. Fitting uses bounded regularization discipline: graphical lasso cross-validates sparse precision strength, partial-correlation networks use shrinkage covariance before inversion, Ising pseudolikelihood uses regularized nodewise logistic models, and hidden-state proxies choose state count by BIC.
Artifacts
Typical outputs include:
- top-k recommendation tables
- relevance/ranking metrics
- user/item or query/candidate metadata
- graph summaries and embeddings
- centrality rankings and phase-comparison diagnostics
- graphical-model dependency graphs, precision/partial-correlation heatmaps, and edge-list artifacts
- one deduplicated EDA
Variable Correlationvisual for measured variables - transition matrices and transition graphs for Markov state-sequence runs
- hidden-state and Kalman trace plots for ordered variables
- selected model artifacts
- report context describing relational assumptions
Common Failure Modes
- Recommendation data without enough repeat interactions.
- Ranking data missing query/group identifiers.
- Leakage from future interactions into training.
- Popularity dominating recommendations without useful personalization.
- Graphs with isolated nodes, missing features, or malformed edge lists.
- Graphical-model inputs with too few variables, too few rows relative to variables, heavy missingness, missing state columns for Markov transition models, or no meaningful time order for dynamic models.
- Treating graphical-model edges as causal effects rather than conditional-dependence diagnostics.
- Optional dependency gaps for ranking libraries or graph neural network frameworks.
Deep Reference
See the advanced-systems model mathematics for full implementation notes, canonical references, and model inventories.
References
Source: docs/book/chapters/21-worked-case-studies.md
Worked End-To-End Case Studies
This chapter turns real workflow patterns and real investigations into end-to-end reading examples. The aim is to show how a user should move from workflow choice to interpretation, and also how the team should reason when the saved evidence and the visible UI drift apart.
How To Read These Cases
Each case is structured around the same questions:
- Why was this workflow the right choice?
- What does a healthy job outcome look like?
- What should the user verify before trusting the output?
- What failure modes should the team watch for?
Each case also includes:
- the most important evidence points to capture
- the trust question that should be answered before export or publication
Case Study 1: Cross-Sectional Prediction From A Clean Tabular Dataset
Typical Scenario
A user has a single-row-per-observation dataset and wants to predict a categorical or numeric target. The key decision is to choose among:
tabular_classificationtabular_regressiontabular_count_regression
Workflow Choice
This is the right family when:
- rows are independent observations
- there is no required subject-level repeated structure
- there is no time-ordered forecasting requirement
- the target type can be clearly identified as class, continuous value, or count
Healthy End-To-End Flow
- The user selects the tabular service that matches the target type.
- Upload validation confirms the target and key predictors.
- EDA surfaces missingness, imbalance, skew, and leakage risks.
- Candidate models train and compare under the service metric.
- The best model is selected with visible runner-ups and failed/skipped models.
- SHAP can be launched if the selected or fallback explainable model supports it.
- An AI report can summarize the saved outputs into manuscript-style text.
What The User Should Check
- Was the correct service chosen for the target?
- Are there leakage columns or identifiers left in the feature set?
- Does the selected metric match the actual use case?
- Do plots, metrics, and SHAP outputs tell a consistent story?
Evidence Points To Capture
- the final best-model table
- the comparison view showing runner-ups
- the core validation plots or metrics table
- the SHAP or feature-importance summary used for interpretation
Trust Question
Would a reviewer looking only at the saved outputs agree that the chosen service and winning metric fit the actual study question?
Lessons
This is the most straightforward workflow family, but it is also the easiest place to become overconfident. Good scores on a clean split can still hide leakage, imbalance, or a mismatch between the chosen metric and the real decision goal.
Case Study 2: Repeated-Measure Data That Needs A Longitudinal Workflow
Typical Scenario
A user has repeated observations per subject, patient, facility, or unit across visits or time points. The temptation is often to run a simpler tabular workflow, but that can overstate performance if repeated records leak across train/test partitions.
Workflow Choice
The right family is:
longitudinal_classificationlongitudinal_regressionlongitudinal_count_regression
This is appropriate when the same subject or unit appears more than once and the grouping/time structure matters.
Healthy End-To-End Flow
- The user selects the longitudinal service and specifies the subject/group and time columns.
- Readiness checks verify that repeated observations actually exist and that the time column is meaningful.
- The workflow compares panel-aware or repeated-measure-compatible models where available.
- Metrics are interpreted with attention to subject-level validation and repeated-measure leakage risk.
- The results and report explain the repeated-measures structure rather than treating rows as independent.
What The User Should Check
- Is there truly repeated structure, not just one row per subject?
- Did the workflow capture the right subject and time columns?
- Are the reported metrics plausible under grouped validation?
- Does the manuscript/report language reflect the longitudinal structure honestly?
Evidence Points To Capture
- the configured subject and time fields
- the longitudinal readiness or validation summary
- the final metric table with grouped or panel-aware evaluation
- the report language that describes repeated-measure structure
Trust Question
If the same dataset were flattened into ordinary tabular rows, would the apparent performance increase for the wrong reason?
Lessons
The most important move here is not a model trick. It is choosing the right workflow and validating it correctly. A weaker but correctly structured longitudinal result is more trustworthy than a strong-looking result from the wrong cross-sectional setup.
Case Study 3: Anomaly Detection That Looked Complete But Was Not Fully Healthy
Typical Scenario
An anomaly detection job completed, a best model was selected, and metrics were visible. But deeper inspection showed missing diagnostic plots, missing AUROC/AUPRC for one deep model, and hidden save/load problems that affected downstream diagnostics.
Workflow Choice
The anomaly detection workflow itself was appropriate. The issue was not the chosen service. The issue was that downstream outputs were incomplete even though the page looked mostly successful.
What Happened
Three different failures illustrated three different layers of trust:
- a broken
decision_function()caused missing AUROC/AUPRC for DeepSVDD - silent model-save failures prevented later diagnostic plots from being generated
- plots and comparison outputs needed better logging and verification
Why This Is An End-To-End Case
This case matters because it spans the full lifecycle:
- model fitting
- metric generation
- artifact persistence
- plot generation
- job result presentation
In other words, the job did not fail at a single point. The visible problem emerged because several downstream contracts were weaker than the surface UI implied.
Evidence Points To Capture
- the best-model summary
- the metrics that were present
- the plots or artifacts that were missing
- the logs or validation files that explain the missing downstream outputs
Trust Question
Did the job truly complete cleanly, or did the UI overstate completeness relative to the saved artifacts?
Lessons
- a completed status is not enough
- metrics, model files, and plot outputs must all agree
- missing downstream artifacts should be explained explicitly, not discovered by the user by accident
Case Study 4: SHAP Outputs Existed But The UI Could Not See Them
Typical Scenario
A tabular job generated SHAP plots successfully on disk, but the job detail page did not display them.
What Happened
The issue was not missing images. It was a broken registration path:
- SHAP plots were written to
plots/shap/ - the authoritative EDA plot manifest was not updated
- the template depended on the manifest, not a raw disk listing
Why This Matters For Users
From the user perspective, this can feel like "SHAP failed." In reality, SHAP succeeded and the display contract failed. That distinction is important because the right fix is to repair the durable manifest path, not to rerun the workflow blindly.
Evidence Points To Capture
- the SHAP images on disk
- the saved plot manifest
- the rendered job detail page
- the action or artifact state describing SHAP completion
Trust Question
Is the missing visualization evidence a computation failure or a registration failure?
Lessons
- generated artifacts must be registered in the saved manifest
- route-level rescans are a fallback, not the source of truth
- report and UI layers depend on the same underlying artifact contract
Case Study 5: Workflow State And Billing Must Follow Durable Truth
Typical Scenario
Training, SHAP, or AI report actions appear complete in the interface, but stale recovery fragments, duplicate action triggers, or billing placeholders make the state feel inconsistent or confusing.
What Happened
The workflow-state audit surfaced problems such as:
- transient recovery payloads competing with final training results
- completed add-on outputs being mislabeled as recovered
- duplicate click handlers causing repeated action starts
- billing messages implying settled activity without authoritative ledger evidence
Why This Is A Product Case Study
This is not only a backend correctness issue. It is a user-trust issue. The platform's meaning is carried by:
- status labels
- recovery pills
- action cards
- billing lines
- downloadable outputs
When those signals drift away from durable state, the user is forced to guess which layer is telling the truth.
Evidence Points To Capture
- the billing timeline
- the ledger entries
- the job state labels and recovery badges
- the actual add-on outputs present on disk
Trust Question
Could an external reviewer reconstruct the true sequence of execution, settlement, and regeneration from the saved state alone?
Lessons
- terminal state must beat stale live fragments
- one click should create one action
- billing should clearly distinguish reserved, refunded, and net charge
- recovery language should only be used when actual recovery happened
Case Study 6: Text Classification Where The Encoder Family Matters
Typical Scenario
A user has labeled notes, documents, or free-text records and wants a classifier that respects the language content instead of flattening everything into a manually engineered feature table.
Workflow Choice
The right family is:
text_classification
This is appropriate when the text itself carries the predictive signal and the user wants a true NLP pipeline rather than a tabular proxy.
Healthy End-To-End Flow
- The user confirms there is a clean text column and a label column.
- The service tokenizes text and fine-tunes one or more transformer encoders.
- The comparison table makes clear which encoder family actually ran.
- The winning model is interpreted with awareness of tokenizer and encoder-family tradeoffs.
- The report explains the text workflow in language that is faithful to the saved model family.
What The User Should Check
- Was the text column clean and meaningful, rather than mostly IDs or placeholders?
- Did the service really run the intended encoder family?
- Are the results plausible for dataset size and label balance?
- Does the report describe a text-classification workflow rather than generic tabular learning?
Evidence Points To Capture
- the final model comparison table
- the winning encoder identifier
- the metrics table for the winning model
- the report section describing the text workflow
Trust Question
Is the report grounded in the actual transformer family that ran, or is it generic enough that the same prose would fit almost any workflow?
Lessons
Text workflows are easy to oversimplify in prose. A healthy output should preserve the distinction between encoder families, tokenization-heavy NLP training, and ordinary structured-data classification.
Case Study 7: Survival Analysis Where Simpler Classification Would Be Misleading
Typical Scenario
A dataset contains an event indicator, a time-to-event column, and censoring. A simpler classification framing may look tempting, but it would throw away the timing structure and censoring information.
Workflow Choice
The right family is:
survival
This is appropriate when the timing of the event and the presence of censoring are central to the study question.
Healthy End-To-End Flow
- The user confirms that time and event columns are valid.
- The service trains a censoring-aware survival workflow.
- The results present survival-specific summaries rather than only generic classification scores.
- The report keeps the survival framing explicit.
What The User Should Check
- Are time values positive and event indicators valid?
- Is censoring present and handled explicitly?
- Do the outputs include survival-native artifacts rather than ordinary tabular stand-ins?
- Does the manuscript language preserve the survival framing?
Evidence Points To Capture
- the survival workflow configuration
- the survival curves or survival-model summaries
- the chosen survival model family
- the report language describing event-time analysis
Trust Question
Would a reader of the exported report understand that this was a time-to-event analysis with censoring, not an ordinary binary prediction task?
Lessons
Workflow choice is especially important here because the wrong simplification removes part of the science, not just part of the model sophistication.
Case Study 8: Recommendation And Ranking Need Structure, Not Just More Features
Typical Scenario
A team wants to recommend items or rank candidates and is tempted to flatten user, item, or query identifiers into a generic supervised table.
Workflow Choice
The right families are:
recommendation_systemranking_models
This is appropriate when user-item interactions or query-level relevance groups are part of the task definition.
Healthy End-To-End Flow
- The user confirms the presence of user-item or query-group structure.
- The service preserves that structure during training and evaluation.
- The final metrics are interpreted as recommendation or ranking metrics, not ordinary classification accuracy.
- The report explains how group structure shaped the workflow.
What The User Should Check
- Were the correct grouping identifiers supplied?
- Were cold-start or sparsity limitations made visible?
- Do the metrics correspond to recommendation or ranking quality?
- Does the output avoid pretending this was an ordinary tabular problem?
Evidence Points To Capture
- the configured identifiers such as
user_id,item_id, orquery_id - the ranking or recommendation metric summary
- the winning model family
- the report section describing the structural task
Trust Question
Did the workflow preserve the real interaction or ranking structure, or was a richer systems problem reduced to a convenient but weaker tabular proxy?
Lessons
Advanced-system workflows are valuable precisely because they preserve structure that simpler supervised pipelines would erase.
Cross-Case Pattern
Across all of these cases, the same principle keeps returning:
The durable workflow contract matters more than a superficially plausible page.
That contract includes:
- correct workflow choice
- correct validation design
- correct metrics
- correct artifact persistence
- correct plot manifests
- correct state semantics
- correct billing semantics
- correct workflow-specific language in the exported report
If those elements stay aligned, the platform feels trustworthy. If they drift, even polished UI can mislead.
How To Use These Cases
Use these cases when:
- onboarding new users to the workflow logic
- reviewing a new service patch
- deciding whether a problem is cosmetic or structural
- writing regression tests for artifacts, SHAP, reporting, or billing
- checking whether an AI report is grounded in saved evidence
- deciding whether a workflow choice error is more serious than a model-performance issue
Deep References
Source: docs/book/chapters/22-model-methodology-reference.md
Model Methodology Reference
This chapter is the book-level index for algebraic model definitions, optimization objectives, assumptions, and interpretation.
The per-model mathematical appendices provide model-identifier lookup tables and family-specific objectives. This chapter gives readers a common notation layer before those detailed appendices.
Notation
- $x_i \in \mathbb{R}^p$: feature vector for observation $i$
- $y_i$: target value or class label
- $X$: design matrix
- $\theta$: model parameters
- $\hat{y}_i$: prediction
- $L(\theta)$: loss/objective function
Linear Regression
Prediction:
$$ \hat{y}_i = \beta_0 + x_i^\top \beta $$
Ordinary least squares objective:
$$ \min_\beta \sum_{i=1}^{n}(y_i - \beta_0 - x_i^\top\beta)^2 $$
Regularized variants add penalties such as:
$$ \lambda ||\beta||_2^2 $$
for ridge regression [@Hoerl1970], or:
$$ \lambda ||\beta||_1 $$
for lasso [@Tibshirani1996].
Logistic Regression
Binary class probability:
$$ P(Y_i = 1 \mid x_i) = \sigma(\beta_0 + x_i^\top\beta) $$
where:
$$ \sigma(z) = \frac{1}{1 + e^{-z}} $$
Cross-entropy objective:
$$ \min_\beta -\sum_i \left[y_i\log(p_i) + (1-y_i)\log(1-p_i)\right] + \lambda R(\beta) $$
Poisson Count Regression
Poisson regression belongs to the generalized linear model family and models count outcomes with equi-dispersed variance [@McCullaghNelder1989].
Mean count:
$$ \lambda_i = \exp(\beta_0 + x_i^\top\beta) $$
Poisson likelihood:
$$ P(Y_i=y_i)=\frac{e^{-\lambda_i}\lambda_i^{y_i}}{y_i!} $$
Negative Binomial Count Regression
Negative binomial models are useful when count outcomes are overdispersed relative to Poisson variance assumptions [@CameronTrivedi1998].
One common parameterization uses mean $\mu_i$ and dispersion $\alpha$:
$$ Var(Y_i \mid x_i) = \mu_i + \alpha\mu_i^2 $$
with:
$$ \mu_i = \exp(\beta_0 + x_i^\top\beta) $$
Naive Bayes
Naive Bayes applies Bayes' rule with a conditional-independence assumption:
$$ P(y \mid x_1,\ldots,x_p) \propto P(y)\prod_{j=1}^{p}P(x_j \mid y) $$
Gaussian Naive Bayes assumes continuous features are normally distributed within class. Multinomial Naive Bayes assumes non-negative count-like feature representations.
Support Vector Machines
Support vector machines find the maximum-margin separating hyperplane [@Cortes1995]. The hard-margin formulation solves:
$$ \min_{w,b}\frac{1}{2}||w||^2 $$
subject to:
$$ y_i(w^\top x_i + b) \geq 1 $$
The soft-margin form introduces slack variables:
$$ \min_{w,b,\xi}\frac{1}{2}||w||^2 + C\sum_i \xi_i $$
subject to:
$$ y_i(w^\top x_i + b) \geq 1-\xi_i,\quad \xi_i \geq 0 $$
Kernel SVMs replace inner products with a kernel function $K(x_i,x_j)$.
K-Nearest Neighbors
KNN predicts from nearby training examples. For classification:
$$ \hat{y}(x)=\operatorname{mode}{y_i: x_i \in N_k(x)} $$
For regression:
$$ \hat{f}(x)=\frac{1}{k}\sum_{x_i \in N_k(x)}y_i $$
where $N_k(x)$ is the set of $k$ nearest training observations under the chosen distance metric.
Decision Trees
A tree partitions feature space into regions $R_m$ and predicts:
$$ \hat{f}(x) = \sum_{m=1}^{M} c_m I(x \in R_m) $$
Splits are chosen to reduce impurity or loss [@Breiman1984].
Random Forests
For classification:
$$ \hat{y} = \operatorname{mode}{T_b(x)}_{b=1}^{B} $$
For regression:
$$ \hat{f}(x) = \frac{1}{B}\sum_{b=1}^{B}T_b(x) $$
Each tree $T_b$ is trained on a bootstrap sample with random feature subsampling [@Breiman2001].
Gradient Boosting
Boosting builds an additive model:
$$ F_M(x) = \sum_{m=1}^{M}\nu h_m(x) $$
where each weak learner $h_m$ is fit to improve the current objective.
For differentiable loss $L$, many gradient-boosting implementations fit each new learner to pseudo-residuals:
$$ r_{im} = -\left[\frac{\partial L(y_i,F(x_i))}{\partial F(x_i)}\right]{F=F} $$
The general gradient boosting framework is due to @Friedman2001. XGBoost [@Chen2016], LightGBM [@Ke2017], and CatBoost [@Prokhorenkova2018] are optimized implementations with different tree-growth, categorical-handling, and regularization strategies.
Multilayer Perceptron
Hidden layer:
$$ h = \phi(W_1x + b_1) $$
Output:
$$ \hat{y} = g(W_2h + b_2) $$
Classification uses cross-entropy; regression typically uses squared or absolute error.
Convolutional Neural Networks
Convolutional models learn filters over local structure. A one-dimensional convolution can be written as:
$$ z_t = \phi\left(b + \sum_{k=0}^{K-1}w_k x_{t+k}\right) $$
Convolutional architectures were originally developed for image recognition and document analysis [@LeCun1998]. For tabular CNN variants in this project, the encoded feature vector may be reshaped to a one-dimensional sequence before convolution. For image, audio, video, and time-series workflows, convolutional structure maps more naturally to pixels, spectrograms, frames, or temporal windows.
Recurrent Neural Networks
A basic recurrent update is:
$$ h_t = \phi(W_x x_t + W_h h_{t-1} + b) $$
LSTM and GRU variants add gates to control memory, forgetting, and update behavior [@HochreiterSchmidhuber1997]. These models are used for sequence and time-dependent workflows where ordering matters.
Transformer Models
Transformer models use multi-head self-attention to combine contextual information [@Vaswani2017]. Scaled dot-product attention is:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V $$
Text, time-series, image, video, and graph workflows may use transformer-style models when the implementation and dependencies are available.
Survival Models
Cox proportional hazards [@Cox1972]:
$$ h(t \mid x) = h_0(t)\exp(x^\top\beta) $$
Survival workflows require careful censoring and event-time interpretation.
Clustering
The k-means algorithm [@MacQueen1967] minimises within-cluster variance:
$$ \min_{{C_k}}\sum_{k=1}^{K}\sum_{x_i \in C_k}||x_i-\mu_k||^2 $$
Density and hierarchical methods use different assumptions and diagnostics.
Anomaly Detection
Anomaly detectors assign an unusualness score $s(x)$. A threshold $\tau$ converts scores to labels:
$$ \hat{y}(x)=I(s(x)>\tau) $$
Different anomaly models define $s(x)$ differently: isolation depth, local density, reconstruction error, robust covariance distance, or learned representation distance.
Recommendation And Ranking
Matrix factorization [@Koren2009] decomposes the user-item interaction matrix into user and item latent factors:
$$ \hat{r}_{ui}=p_u^\top q_i $$
Ranking objectives optimize pairwise or listwise ordering rather than point prediction.
Pairwise ranking commonly minimizes a loss over item pairs:
$$ \sum_{(i,j)} \ell(f(q,i)-f(q,j), y_{ij}) $$
where $q$ is a query or user context and $i,j$ are candidate items.
Graph And Network Models
Graph neural networks [@KipfWelling2017] update node representations by aggregating neighbourhood information:
$$ h_v^{(k)} = \sigma\left(W^{(k)} \cdot \operatorname{AGG}{h_u^{(k-1)}:u\in \mathcal{N}(v)\cup v}\right) $$
Different architectures vary the aggregation, attention, normalization, and positional encoding strategies.
SHAP And Surrogate Explainability
SHAP [@LundbergLee2017] expresses a prediction as an additive attribution model:
$$ g(z')=\phi_0+\sum_{j=1}^{p}\phi_j z'_j $$
where $\phi_j$ is the contribution assigned to feature $j$.
When exact SHAP is unavailable, this project may use surrogate feature-importance outputs based on:
- native tree importances
- linear coefficients
- MLP layer weights
- prediction-response permutation fallback for neural or otherwise unsupported models
These fallbacks should be labeled as surrogate explainability rather than exact SHAP values.
Implementation Mapping
For model-specific implementation details, see:
- Cross-sectional model mathematics
- Longitudinal model mathematics
- Time-series model mathematics
- Text model mathematics
- Media model mathematics
- Survival model mathematics
- Specialized model mathematics
- Advanced-systems model mathematics
References
Source: docs/book/chapters/23-metrics-and-validation.md
Metrics And Validation
Metrics should be interpreted in the context of the task, class balance, sample size, and deployment goal.
General Rule
No metric is meaningful without knowing the target, data split, class/event balance, and intended use. The platform can compute metrics, but users must decide which metric matches the decision they plan to make.
Classification
- Accuracy
- Precision
- Recall
- F1
- ROC-AUC
- PR-AUC
- confusion matrix
- threshold diagnostics
For imbalanced outcomes, PR-AUC, recall, precision, and threshold behavior often matter more than accuracy. The ROC-AUC summarises classifier performance across all decision thresholds [@HanleyMcNeil1982]; PR-AUC is preferable when positive events are rare [@DavisGoadrich2006].
Positive Class
For binary classification, the positive class is the event or outcome of interest. Selecting it tells Xalec which label should be treated as the "yes", "event", or "case" side when computing class-specific metrics and threshold diagnostics.
This matters because precision, recall, F1, ROC/PR curves, confusion-matrix interpretation, and threshold tuning all depend on which label is considered positive. If the positive class is reversed, a model can appear to have strong recall or precision for the wrong outcome, especially when the rare or costly event is the one the user actually cares about.
Thresholds
Many classification models output probabilities or scores. The threshold that converts a score into a class should be checked against the use case. A high AUC can still produce a poor default cutoff when prevalence is low or costs of false positives and false negatives differ.
For binary classification, Xalec stores a standardized best-model cutoff when probabilities are available. The current default selection rule maximizes Youden's J:
Youden's J = sensitivity + specificity - 1
This gives one operating threshold that balances sensitivity and specificity. The threshold-performance plot shows accuracy, precision, recall, specificity, F1, balanced accuracy, and Youden's J across the threshold grid, with the selected cutoff marked. Prediction workflows then reuse the saved cutoff so the reported confusion matrix, ROC operating point, AI report language, and later predicted classes are based on the same decision rule.
Users may still choose a different threshold for a deployment policy when the decision context has asymmetric costs. In that case, the report should state that the deployment threshold differs from the automated Youden cutoff.
Regression
- MAE
- MSE
- RMSE
- R-squared
- residual diagnostics
- actual-vs-predicted plots
Regression metrics should be interpreted on the target scale. A low RMSE may still be unacceptable if the decision requires small absolute error, and a strong R-squared can hide poor performance for rare high-value cases.
Count Regression
- MAE/RMSE-style error metrics
- deviance-style summaries where implemented
- mean-variance diagnostics
- zero-inflation checks
Count models should respect the non-negative, integer-like nature of the outcome. Over-dispersion and excess zeros often make ordinary regression a poor fit even when it appears to produce a numeric prediction.
Survival
- concordance index
- survival curves
- censoring-aware diagnostics
- event-time calibration where available
Survival validation must account for censoring and follow-up time. The concordance index (C-index) measures discriminative ability in the presence of censoring [@Harrell1982]. A risk score is not the same as a direct probability of an event unless the model and output are calibrated for that interpretation.
Clustering
- silhouette score
- cluster-size diagnostics
- dimensionality-reduction visualizations
- domain review of cluster meaning
Clustering metrics can suggest structure, but they do not prove the clusters are useful. The silhouette score measures how well each point fits its assigned cluster relative to neighbouring clusters [@Rousseeuw1987]. Domain review and cluster-profile interpretation are required.
Recommendation And Ranking
- hit rate
- NDCG
- MAP
- precision@k
- recall@k
Ranking metrics should be computed within query, user, or candidate groups. NDCG weights correctly ranked relevant items by their position, applying a logarithmic discount to lower ranks [@JarvelinKekalainen2002]. If the grouping is wrong, the metric can look strong while the ranking problem is not actually being evaluated.
Validation Split Patterns
| Data structure | Safer validation pattern |
|---|---|
| Independent rows | random train/test split or cross-validation. |
| Imbalanced classification | stratified split and PR-AUC/threshold review. |
| Repeated subjects | subject-level split or grouped validation. |
| Time series | chronological, blocked, or rolling-origin split. |
| Recommendation/ranking | user/query-aware split, often time-aware for interactions. |
| Survival | censoring-aware split and event-count review. |
Supplied Validation And Test Data
If users supply a split column or separate train, validation, and/or test files, metrics should be interpreted according to that contract. Training rows fit the models. Validation rows check choices such as tuning, threshold selection, or calibration when the service has that step; validation is not the final score. Test rows are final held-out evidence. For explicit train and validation uploads without an uploaded test file, AutoML creates an internal test holdout from the uploaded training file before fitting; reports should describe the uploaded validation metrics beside the internally generated test metrics and state that the test split was created internally. If a saved contract truly has validation rows but no test rows, validation is the evaluation split and reports should say so.
AI manuscript tables should avoid duplicating the main model-comparison table. The split-specific model-performance table is shown only when saved artifacts contain separate validation/test evidence that is not already represented by the primary Model Performance table. When an ordinary internal holdout is the only evaluation split, Table 1 is the single source of truth for model performance.
For artifact-backed review, look for dataset_split_contract.json and the
saved dataset_split_policy in result metadata. Those files explain how many
rows came from each role and which split was used for displayed metrics.
Newer split contracts also include an output_contract block that records the
primary evaluation role, whether a Validation Dataset section is expected, and
whether validation visuals should be classification-style or service-specific.
The job-detail page should surface uploaded validation evidence in a dedicated
Validation Dataset section. Classification services should attach validation
confusion-matrix, ROC, and precision-recall plots when those split-specific
artifacts are saved. Regression, count, longitudinal, time-series, survival,
ranking, recommendation, anomaly, and other services should use their own
best-model validation performance plots rather than borrowing classification
visuals.
Weighted Samples
Sampling weights change how training examples represent a larger population. They are not ordinary features. When weights are uploaded, the safest reading is model-specific: some estimators use weights directly, some fall back to unweighted fitting, and some services may only preserve the weight summary for audit. Reports should not claim a fully weighted analysis unless the saved model evidence shows the relevant model consumed the weights.
Model Drift And Distribution Shift
Model drift means a model becomes less reliable after training because the data, outcome process, or operating context changes relative to the data used for validation. A completed Xalec training job shows performance on the uploaded validation design; it does not prove that future production data will behave the same way.
Related terms should be kept separate:
- data or feature drift: the distribution of input predictors changes after training
- target or prevalence drift: the outcome rate or class balance changes over time
- concept drift: the relationship between predictors and the target changes
- prediction drift: the distribution of model scores or predicted classes changes after deployment
The practical response is monitoring, not blind trust. Compare future input distributions, prediction distributions, calibration, and performance metrics against the training or validation baseline. When true labels arrive later, recompute task metrics by time period, site, group, or segment. If drift is material, review the data-generating process, retrain or recalibrate when justified, and document the change before using the output for decisions.
For a specific job, drift cannot be diagnosed from the original training artifacts alone. The assistant needs post-training evidence such as saved prediction history, new labeled outcomes, monitoring summaries, or a later validation dataset before claiming that drift occurred.
Validation Caveats
- Cross-validation may be inappropriate when subject/time leakage is possible [@Kohavi1995].
- Random train/test splits can be misleading for temporal data.
- Metrics on extremely imbalanced data need threshold and prevalence context.
- Automated reports should not overstate causal or clinical conclusions.
Reporting Metrics Honestly
Reports should state the validation design, the selected metric, the best model, and any caveats that materially affect interpretation. When a metric is unavailable or unreliable, the report should say so rather than filling the gap with generic language.
Related Source Docs
- Responsible use, scope, and limitations
- Understanding results
- Model methodology reference
- Service reference overview
References
Source: docs/book/chapters/24-artifacts-and-implementation.md
Artifacts And Implementation
This chapter describes the major persisted outputs and implementation locations.
Artifact Contract
Artifacts are the durable evidence of a job. They should let a user or developer answer:
- what data and configuration were used
- which models ran, failed, or were skipped
- which model was selected
- which metrics and plots were produced
- what context was available to AI reports
- whether downloadable reports match the in-app preview
- which evidence the assistant can cite when diagnosing a job
Common Artifact Types
- serialized model files
report.jsonjob_results.jsonmodel/training_results.jsonmodel/best_model_evaluation.jsonmodel/optimal_cutoff.jsonfor binary classification jobs with probabilitiesdataset_split_contract.jsonfor user-supplied split and weight setup includingoutput_contract, which records primary evaluation role, generated internal test status, and Validation Dataset expectationsdataset_split_policyin service results or metadata where the service consumes explicit train/validation/test rolesruntime_guardrails.jsonfor service-family runtime estimates, disabled models, and interactive-budget warningsreproducibility_manifest.jsonfor dataset fingerprints, split settings, model roster, runtime controls, package versions, and artifact inventoryreport_validation.json,prompt_package.json,manuscript_context.json,report_tables.json, andllm_telemetry.jsonfor AI report quality review, prompt snapshots, manuscript context, table provenance, and provider telemetrymodel/validation_policy.jsonfor service-specific validation semantics, especially longitudinal known-subject versus new-subject evidence- held-out prediction artifacts for selected predictive models where available
metadata.json- plots
- SHAP outputs
- AI report outputs
- assistant feedback and staged improvement proposals
- logs and status files
Artifact Principles
- Saved artifacts should be generated from the real job payload, not generic defaults.
model/training_results.jsonis allowed to appear before the outer pipeline has finished all visuals and report metadata. It can support active-job display and interrupted-job recovery, but active jobs should not be marked completed from that file alone.job_results.jsonandreport.jsonare final pipeline evidence for model results, plot inventory, diagnostics, and report context.- Regeneration should preserve the same job identity and update derived outputs consistently.
- Downloadable reports should render the same text, references, figures, and saved edits shown in the app.
- Validation metadata should warn when structured report context is missing or partially empty.
Common Stored Evidence
- the job manifest store
- the saved-results store
- the fitted-model evidence for a specific job
- the job plot inventory
- the optional SHAP explanation inventory
Model-evaluation plots should live under plots/, not in the EDA namespace.
Regression and count-regression jobs commonly produce actual-versus-predicted,
model-comparison, feature-importance, residual, residual-distribution or QQ,
and training-time visuals. EDA feature-distribution panels should be registered
as independent EDA plots so the EDA tab can display each feature separately
without hiding model diagnostics.
Binary classification jobs that expose best-model probabilities should persist the same cutoff evidence used by plots, reports, and prediction. The key files are:
model/best_model_evaluation.json: saved labels, predictions, probabilities, class names, best-model identity, and threshold metadata.model/optimal_cutoff.json: compact saved cutoff metadata, including the method, positive-class index and label, selected cutoff, threshold grid, and selected metrics.plots/threshold_performance.png: accuracy, precision, recall, specificity, F1, balanced accuracy, and Youden's J across thresholds, with the selected cutoff marked.plots/roc_curve.png: ROC curve, optionally annotated with the saved operating point.
When validation rows are saved separately, split-specific validation plots
should use a recognizable role path or manifest entry, such as
plots/validation/confusion_matrix.png or
split_evaluation_visuals.validation. Classification-like services should
save validation confusion-matrix, ROC, and precision-recall plots when
possible. Other services should save the best-model validation diagnostics that
match their own metric family.
When these artifacts exist, downstream prediction should reuse the saved cutoff instead of silently falling back to argmax or a default 0.5 threshold.
Deployment Refit Contract
For supervised workflows, the evaluation estimator and a production deployment
estimator are separate artifacts. deployment_refit_contract.json records the
validation-selected model, its selection metric and source, the permitted
training roles (train and validation), and the locked test role that must
never be included in a refit. It also records preprocessing, calibration, and
threshold lineage.
The contract starts as pending_refit after valid selection evidence is saved.
It becomes ready only when a service writes a distinct, versioned deployment
artifact using train plus validation rows and preserves the immutable evaluation
artifact. A saved evaluation model must not be described as a deployment refit
until that transition is recorded.
For explicit split jobs, model-results plots and reports should prefer saved held-out prediction artifacts over a second prediction pass. This is especially important for longitudinal and time-series services because subject IDs, time order, known-series context, and validation mode affect what a prediction means.
Important Report Artifacts
AI-report workflows may produce files such as:
- manuscript HTML
- structured report metadata
- validation report JSON
- resolved references JSON
- manuscript context JSON
- editable declaration/completion state
- figure assets referenced by the manuscript
The route and downloadable report should agree on these files. If a report is regenerated for a legacy job, the workflow should rebuild context from the saved job payload and warn when important fields are missing.
Core Implementation Areas
- application entrypoint
- job routes
- service routes
- shared training pipeline
- service registry and service catalog
- AI-report generation
- assistant runtime and assistant routes
- assistant workspace and quality review surface
Implementation Traceability
For product behavior, the strongest source is the running FastAPI/Jinja app. Documentation should follow code when they disagree. For algorithm descriptions, use the detailed service methodology and then the relevant service modules, route handlers, pipeline functions, and tests.
For assistant behavior, the strongest runtime sources are the simplified RAG runtime under mlagent_website/assistant/simple_rag.py, the assistant routes, and the assistant evaluation fixtures and scripts. The handbook chapter 10-assistant-and-controlled-rag.md defines the user-facing evidence rules and safety expectations.
Pipeline source files should not be treated as ordinary assistant evidence. Each service should instead persist compact job-level contracts that describe what happened in that run. The assistant can then answer across services by reading the same artifact contracts used by the UI, reports, logs, and audit tools.
Traceability Rule
Every technical claim in the book should be traceable to:
- a service source file
- a route or pipeline implementation
- a saved artifact contract
- a test
- or a clearly marked design document
Source: docs/book/chapters/25-reproducibility-audit-trail-and-regeneration.md
Reproducibility, Audit Trail, And Regeneration
This chapter explains how the platform preserves evidence, how a result can be traced back to its saved state, and what regeneration is expected to do. Reproducibility in this product is not only about rerunning code. It is also about preserving the durable artifacts that explain what happened, what was selected, and what was later edited or regenerated.
The Core Principle
Every meaningful result should be traceable through a durable chain:
- job creation and configuration
- persisted job state
- saved results and artifacts
- optional add-on actions such as SHAP or AI report generation
- validation metadata that records whether the derived outputs are complete and trustworthy
If one of those links is missing, the workflow may still be useful, but it is less reproducible and less auditable.
The Job ID Is The Anchor
The job_id is the primary handle that ties the workflow together. It connects:
- the job manifest
- the result directory
- model and plot artifacts
- billing records
- SHAP outputs
- manuscript/report outputs
- regeneration actions
In practice, the job ID is the shortest path to reconstructing what the platform knew and produced for a given run.
flowchart TD
A[job_id] --> B[Job Manifest]
A --> C[Result Directory]
A --> D[Billing Records]
B --> E[Status, Timestamps, Action State]
C --> F[Models, Metrics, Plots]
C --> G[SHAP Artifacts]
C --> H[Manuscript, References, Validation]
H --> I[Downloaded Report]
H --> J[In-App Report View]
Figure: Job-centered audit trail linking manifests, result artifacts, billing records, SHAP outputs, and report outputs through one durable identifier.
The Two Durable Homes Per Job
The platform relies on two major durable locations.
1. Job Manifest
The job manifest under mlagent_website/jobs/ stores the persisted state used by the frontend and workflow monitors.
Typical content includes:
- service type
- timestamps and status
- progress/current stage
- result summaries
- action-level state for SHAP or AI report workflows
- billing summaries
2. Result Directory
The canonical result directory under mlagent_website/results/<job_id>/ stores the artifacts produced by training and post-processing.
Typical content includes:
- saved models and preprocessors
- metrics and comparison results
- plots and EDA summaries
- SHAP files and images
- report artifacts
- metadata, validation files, and logs
Together, the manifest and result directory form the audit trail.
What Needs To Be Reproducible
For this platform, reproducibility means more than "can retrain if needed." It means a reviewer can inspect:
- which service was used
- what the target and key columns were
- which models ran, failed, or were skipped
- which model was selected
- what metrics and plots were available
- what contextual information grounded the AI report
- whether a later regeneration changed only derived artifacts or changed the underlying training evidence
Important Artifact Classes
The most important artifact classes are:
- training results and comparison files
- EDA summaries and plot manifests
- model artifacts and preprocessors
- SHAP outputs and plot images
- report metadata and manuscript HTML
- reference manifests and validation JSON
- logs that explain failures, skips, and recovery behavior
The more these classes remain aligned, the more reproducible the workflow feels in practice.
Current Review Artifacts
The product now standardizes a smaller set of review artifacts that connect the upload flow, completed job page, AI Report tab, public demo workspace, and handbook.
| Artifact | Purpose | Mutation boundary |
|---|---|---|
eda/readiness_profile.json |
Records dataset shape, role completeness, split plan, warnings, and plot availability. | Built during readiness/EDA or backfilled from saved job evidence. |
dataset_split_contract.json |
Records whether the job used an internal split, split column, or separate train/validation/test files, plus row counts, sampling-weight summary, generated-test status, and output_contract expectations. |
Built at upload/training-request time; should not be changed by report or SHAP regeneration. |
dataset_split_policy |
Records how a service consumed the split for model fitting and displayed evaluation. | Written by the service during training; downstream plots and reports should read it. |
split_evaluation_metrics and split_evaluation_visuals |
Preserve validation/test metrics and split-specific best-model plot paths when a service saves them separately from the main table. | Written during training or deterministic artifact backfill; report regeneration should read them, not invent them. |
service_diagnostics.json |
Summarizes service-family checks such as recommendation sparsity, graph integrity, media diagnostics, count-target cues, or plot reasons. | Derived from saved readiness, plots, and results. |
explainability_status.json |
States whether SHAP or another interpretation method completed, failed, fell back, or was not requested. | Derived from SHAP status and saved interpretation plots. |
reproducibility_manifest.json |
Captures dataset fingerprint, roles, split settings, model roster, runtime controls, package versions, and artifact inventory. | Derived from saved configuration and files; does not retrain. |
methods_appendix.json and methods_appendix.md |
Turns the above artifacts into a concise methods receipt for report review. | Derived from saved evidence; linked from the AI Report tab. |
These artifacts are allowed to be generated after the original training run when older jobs lack them. That kind of backfill improves auditability but does not create new analytical evidence. If a claim depends on model performance, training results, billing, SHAP, or predictions, the original saved job artifacts and ledger remain the authority.
Regeneration Versus Retraining
The platform should distinguish clearly between retraining and regeneration.
flowchart TD
A[Need To Change Something] --> B{Underlying training evidence still valid?}
B -- No --> C[Retrain]
B -- Yes --> D[Regenerate]
C --> E[New models, metrics, and artifacts]
D --> F[Refresh report, SHAP, or validation outputs]
E --> G[New analytical result]
F --> H[Same analytical basis, newer derived outputs]
Figure: Decision split between retraining and regeneration. Retraining changes the analytical result; regeneration refreshes derived outputs from saved evidence.
Retraining
Retraining is appropriate when:
- the wrong workflow was selected
- the data or target were wrong
- the model options were wrong
- the training run itself produced incomplete or untrustworthy evidence
Retraining changes the underlying analytical result.
Regeneration
Regeneration is appropriate when:
- the underlying training result is still the right basis
- a report needs refreshed references or context
- SHAP outputs need rebuilding
- downloadable manuscript output drifted from the saved in-app state
- structured validation files need to be rebuilt from the saved job payload
Regeneration should refresh derived artifacts while preserving the identity and evidence of the original job.
Regeneration Must Use Real Saved Context
The product has already surfaced why this matters. Legacy or interrupted jobs can drift into generic output if regeneration is allowed to fall back to incomplete or placeholder context.
The durable rule should be:
- regenerate from the real saved job payload and artifact set
- warn explicitly when manuscript context or validation context is partial or missing
- preserve a clear trail of what was regenerated and why
If regeneration rebuilds a report from generic fallback context, the output may look polished while becoming less trustworthy.
Report Reproducibility
For AI-report workflows, reproducibility means that these layers agree:
- manuscript HTML shown in the app
- downloadable report output
- resolved references
- validation metadata
- saved completions or declarations
- figure assets referenced by the report
If the user edits declarations or completions inline, the saved manuscript and the downloadable output should stay synchronized. Otherwise the interface becomes visually convincing but operationally unreliable.
flowchart LR
A[Saved Job Context] --> B[Structured Manuscript Context]
B --> C[Rendered Manuscript HTML]
C --> D[In-App Report View]
C --> E[Downloaded DOCX and PDF]
B --> F[Resolved References]
B --> G[Validation Metadata]
H[Saved Completions and Declarations] --> C
F --> D
G --> D
Figure: Report reproducibility contract. Edited completions, saved manuscript state, validation metadata, and downloaded outputs should remain aligned.
Audit Questions A Reviewer Should Be Able To Answer
For any completed job, a reviewer should be able to answer:
- what service and target were used?
- what data structure assumptions did the workflow make?
- which models succeeded, failed, or were skipped?
- why was the best model selected?
- what validation setup was used: internal split, split column, or supplied train/validation/test files?
- were sampling weights supplied, and did the selected model use them?
- what warnings or readiness checks were recorded?
- what add-on actions were run later?
- whether billing and final output state reflect the actual completed work?
- whether regenerated report outputs still match the original saved evidence?
Practical Audit Checklist
- Start with the job detail page, but verify against saved files when something looks off.
- Prefer final persisted training results over transient recovery fragments.
- Check whether plot manifests match actual plot files.
- Confirm SHAP and report outputs are tied to the correct job.
- Review validation files for missing or partial structured context.
- Distinguish retraining from regeneration when interpreting changes over time.
Deep References
Source: docs/book/chapters/26-troubleshooting.md
Troubleshooting
This chapter collects common failure modes and recovery actions.
First Triage
Start by identifying where the problem appears:
- upload or schema validation
- job startup
- candidate model training
- artifact generation
- SHAP/explainability
- AI report generation
- billing/settlement
- route/template rendering
- local development environment
Then check the job detail page, result directory, logs, and any validation JSON produced by the workflow.
Training Fails
Check:
- missing required columns
- unsupported file format
- invalid target values
- insufficient rows
- dependency not installed
- efficiency guardrail skipped a model
- Windows file locks or OneDrive interference
If some models succeeded, treat the job as partially useful and inspect the successful model list before rerunning.
If a job flips from running to failed during a server reload, check whether the error says training was interrupted during shutdown or restart. That is a runtime cancellation, not necessarily a model-quality failure. Restart the services cleanly, confirm package imports and billing refund status, and then rerun the job when appropriate.
Live Monitor Appears Stuck
If the upload-page live log or progress bar appears stuck at an early value such as 5%, first check the saved job manifest under mlagent_website/jobs/<job_id>.json.
If the manifest shows later progress, current_step, last_heartbeat, or terminal status, then training continued and the issue is transport responsiveness rather than model execution. Check:
- whether
/api/job-status/<job_id>is responding during training - whether websocket reconnect warnings appear in the browser log
- whether the service is an async wrapper around synchronous CPU-heavy fits
- whether that service is included in the pipeline async-training offload policy
Survival, longitudinal, time-series, ranking, and media-classification workflows are expected to be offloaded so the FastAPI event loop can continue serving polling and websocket updates during long fits.
Keras Models Unavailable
Keras models require TensorFlow/Keras. If TensorFlow is not installed, Keras MLP and Keras CNN will be skipped or recorded as unavailable.
Native Longitudinal Backends Unavailable
Longitudinal historical-tree and mixed-effects models depend on local editable packages:
pyhtreefor HTB, HRF, and HCBlongiturffor MERT, MERF, MECB, REEMTree, REEMForest, and REEMCatBoost
From the same virtual environment used to run the app, verify:
python -c "from pyhtree import hrf, htb; from pyhtree.hcb import hcb; from longiturf import MERT, MECB; print('ok')"
If pyhtree imports as an unknown-location namespace package or lacks hrf,
the editable install is incomplete. If longiturf works only from the repo root
but not from mlagent_website/, the editable path is pointing at the wrong
package directory.
SHAP Fails
SHAP may fail because:
- the model is not supported by the native SHAP explainer
- the model lacks tree or linear importance attributes
- categorical preprocessing cannot be reconstructed
- the process times out
- output files are blocked by filesystem locks
Fallback behavior may generate surrogate SHAP-style outputs when native SHAP is unavailable.
AI Report Looks Generic
Check whether the report context resolver detected the correct domain and whether manuscript_context.json was populated from the real saved job payload. Generic titles, irrelevant references, duplicated References sections, or empty structured context usually point to a context-loading or post-processing problem.
Report Figures Do Not Display
Check whether the report is opened inside the app or as a local downloaded file. Downloaded reports may require inlined assets or absolute /results/<job_id>/... paths.
Billing Looks Confusing
Look for reserve, refund, and final net charge. A zero-net add-on can show both a charge and refund in the ledger.
Local Python Or Git Problems
Common local issues include:
- virtual environments pointing to a removed Python install
uvicorn.exelaunchers from the wrong environment- OneDrive cloud placeholders corrupting
.git/index - generated runtime logs cluttering
git status - locked result files from a still-running Python process
- interrupted
uv syncruns leaving.venvpartially pruned - local editable packages pointing to the wrong source directory
Use python -m uvicorn ... from the intended virtual environment and keep the repository hydrated locally when working inside OneDrive.
For this repository, treat the root pyproject.toml as local package metadata
for longiturf and related local sources, not as a complete manifest for every
FastAPI runtime dependency. Running uv sync can remove packages the web app
still needs if the full application dependency set is not represented. After an
interrupted sync or failed startup, run:
uv sync --inexact
uv pip install -r mlagent_website\requirements-deploy.txt
uv pip install -r auth_payment_service\requirements.txt
For normal local startup, prefer the repo script because it checks imports and repairs the selected environment before launching uvicorn:
.\start-dev.ps1
.\start-dev.ps1 -MainOnly
.\start-dev.ps1 -AuthOnly
Then validate:
python -m pip check
python -c "import main; print('main import ok')"
from mlagent_website/, and:
python -c "import app.main; print('auth app import ok')"
from auth_payment_service/.
Recovery Pattern
- Preserve user-authored work before cleanup.
- Separate generated/runtime files from source changes.
- Reproduce the failure on the smallest route, job, or test.
- Patch the durable workflow, not only the displayed page.
- Regenerate affected artifacts.
- Re-review the app surface and downloaded output.
Related Source Docs
Source: docs/book/chapters/27-runtime-guardrails.md
Runtime Guardrails
Runtime guardrails are the checks Xalec applies before and during training to keep an interactive job within a practical analysis budget. They are not a judgment that the research question is invalid. They mean the selected data size, model family, preset, or local dependency state would make one or more requested models too expensive, too slow, or too unreliable for the current run.
Guardrails should be interpreted alongside the saved job artifacts. For a specific job, use the request metadata, readiness output, training_results.json, skipped-model entries, and log snippets before stating which rule fired.
The guiding principle is that guardrails should guide rather than block. Most guardrails should warn, explain the likely runtime or billing consequence, and suggest a practical next step. A hard stop should be used only when the job is very likely to fail, exhaust memory or local compute resources, produce unreliable execution behavior, or create an unfair billing/runtime experience for the user.
Guardrail Types
Xalec uses four common guardrail families:
- Readiness guardrails check whether the uploaded data has the required role columns, usable target values, compatible feature columns, and enough non-missing observations.
- Plan and billing guardrails check whether the workflow is allowed for the current plan and whether the estimated cost requires confirmation.
- Runtime budget guardrails check whether the selected model configuration is likely to fit within an interactive job budget.
- Dependency and availability guardrails check whether a model backend is available in the current environment.
Shared Service Runtime Guardrail Contract
All service families expose the same runtime-guardrail evidence contract. The
source module is mlagent_website/utils/service_runtime_guardrails.py. Upload
readiness preview, backend training, job logs, saved report artifacts, AI report
generation, and assistant/RAG answers should all read the same
service_runtime_guardrails payload rather than recomputing separate estimates.
The shared payload includes:
- the guardrail registry version,
- the service family,
- the selected preset,
- the workload dimensions used for scoring,
- the family-specific score formula,
- the estimated fit score and interactive budget,
- the severity/status,
- model-level fit estimates,
- disabled or warning model lists,
- warnings and recommended next actions.
For completed jobs, this evidence may appear in runtime_guardrails.json,
request.json, model/training_results.json, and report.json. When these
sources disagree, use the completed job artifact that was written closest to
training execution, usually runtime_guardrails.json or
model/training_results.json.
The current service-family formulas are:
- Tabular services: rows x features x selected model count x confidence-interval/bootstrap multiplier x SHAP multiplier x model complexity.
- Anomaly detection: rows x features x selected model count x deep/GAN/kernel-model complexity.
- Time-series services: rows x features x selected model count x forecast horizon x lookback/window count x series count x deep-model complexity.
- Survival services: rows x features x selected model count x Cox, random-survival-forest, or DeepSurv complexity.
- Text and media services: file/item count x size or duration x embedding/deep-model complexity.
- Ranking, recommendation, network, and graphical-model services: entities x edges/interactions x features x model-family complexity.
- Clustering: rows x features x selected model count x clustering-model complexity.
These scores are advisory workload estimates for interactive execution. They help users start with a practical model set and then expand once the dataset, split strategy, and candidate model family are understood. They are not a scientific judgment about whether the study question is worth modeling. When the estimate is elevated but still feasible, the preferred behavior is a warning, an explanation, and a lower-cost path. Blocking should be reserved for cases where continued execution would probably fail or would be unreasonable for the user to pay for or wait on.
Longitudinal Runtime Budgets
Longitudinal services can be computationally heavier than ordinary cross-sectional services because the same subject, unit, patient, facility, device, or cohort member can appear multiple times. The service must preserve the repeated-measures structure rather than treating every row as independent.
Longitudinal services use a specialized model-cost registry underneath the
shared service_runtime_guardrails contract so the upload readiness preview,
backend training, job logs, AI report generator, and assistant all describe the
same runtime contract. Every longitudinal model is routed through this registry,
but the score is model-specific rather than a blunt row-count cap.
For each longitudinal model, Xalec estimates an interactive fit score from:
- the number of training rows,
- the configured iteration count,
- the configured tree count or depth setting,
- and a model-family multiplier when the method is known to be more expensive.
If the estimated score exceeds the preset's runtime budget, the affected high-cost model can be downshifted, disabled in readiness, or skipped before fitting. This is a controlled guardrail decision, not a model crash. Lower-cost fixed-effects, GEE, GLMM, GPBoost-style, and other baseline models are still scored through the registry, but they usually remain inside the same budget because their model-specific cost profiles are lighter.
For the shared longitudinal upload experience, the readiness-time interactive guardrail is currently 500,000 in the default balanced posture. This value is intended for a high-end development workstation or a first production server with comparable resources, such as roughly 64 GB RAM, many CPU threads, adequate free disk, and controlled job concurrency. Faster presets are stricter, while broader accuracy-oriented or reference presets can permit more work. The saved job artifacts include the runtime-guardrail registry version, selected preset, fit-score budget, and budgeted model list when a longitudinal service uses this contract.
The balanced guardrail should evolve with measured infrastructure rather than being raised blindly. Future server upgrades should update the guardrail registry through a versioned policy that considers hardware and concurrency:
effective_budget =
base_budget
x hardware_factor
x concurrency_factor
x service_family_factor
x preset_factor
As a practical starting policy, a 64 GB RAM / 32-thread machine with a single active heavy longitudinal job can use a balanced budget of about 500,000. A 128 GB RAM server with more CPU threads and an explicit worker queue may justify a balanced budget around 750,000 to 900,000. Larger servers can raise the cap further, but only after saved telemetry shows that runtime, memory, queue delay, and billing remain reasonable. Multi-user servers should usually scale throughput with queues and workers before raising every per-job cap.
Every guardrail increase should be accompanied by saved evidence: estimated fit score, actual runtime, peak memory when available, skipped models, selected preset, and the runtime-guardrail registry version. After enough successful jobs, update the registry version and document the new default.
Affected Longitudinal Model Families
The guardrails most often apply to advanced longitudinal model families such as HTB, HRF, HCB, MECB, MERF, REEM tree, REEM forest, and REEM CatBoost. These methods can be useful for repeated-measures data, but they are also more sensitive to row count, subject count, tree count, depth, and iteration settings.
Fixed-effects, GEE, GLMM, GPBoost-style, and simpler baseline models may still train successfully in the same job when an advanced tree ensemble is skipped. A completed job with skipped models should therefore be read as a partial model set, not automatically as a failed analysis.
Presets And Interpretation
Training presets change the practical runtime budget. A faster or lower-cost preset should be expected to skip more expensive model configurations sooner. A broader accuracy-oriented preset permits more work, but it still has guardrails so that an interactive job does not run indefinitely.
When a model is skipped, the job evidence should say which model was skipped and why. The clearest evidence usually appears in saved training results, failed/skipped model metadata, and logs with text such as skipped before fit, runtime budget, interactive guardrail, or an estimated fit score.
HTB, HRF, And Local Backends
If a message says HTB or HRF is not available in the environment, interpret that as a backend availability guardrail. It means the local historical-tree implementation, bridge, or required dependency was not available to that service at run time. It is different from a runtime-budget skip and different from a fitted model performing poorly.
How To Ask The Assistant
Good guardrail questions include:
what runtime guardrails apply to longitudinal services?why was reem_catboost skipped in job_...?did HTB fail or was it unavailable in job_...?which models were skipped by the interactive budget?
For general guardrail questions, the assistant should cite this handbook chapter. For job-specific guardrail questions, it should also cite the saved job artifacts and logs.
Source: docs/book/chapters/28-admin-developer-appendix.md
Admin And Developer Appendix
This appendix supports administrators and contributors.
Canonical App
The canonical app consists of:
- the FastAPI application entrypoint
- FastAPI routes for product pages and APIs
- shared Jinja templates
- shared CSS and JavaScript assets
Secondary Surfaces
Other interfaces or scripts may exist in the repository, but product UX changes should default to the FastAPI/Jinja app unless a documented architecture decision says otherwise. This prevents drift between multiple partial frontends.
Development Rules
- Favor shared templates and partials.
- Keep service metadata configuration-driven.
- Update docs when behavior changes.
- Avoid introducing parallel frontends unless explicitly planned.
- Keep runtime/generated artifacts out of git.
Commit Hygiene
Before committing:
- inspect
git status --short - separate source/docs changes from generated logs and results
- avoid staging
.env, local virtual environments, temporary repro files, and runtime artifacts - prefer docs-only commits when the change is documentation-only
- run the smallest relevant tests or render checks
CI Gate Strategy
The GitHub workflow keeps the core contract job on push so ordinary commits
still get fast feedback. Heavier gates such as SHAP validation, AI report
validation, Assistant RAG safety, and UI validation are intended for pull
requests or manual workflow_dispatch runs when dependency, browser, or model
runtime noise would otherwise produce frequent email failures on every push.
If notification noise returns, do not delete the gates blindly. First check whether the failing gate is required for the current change. If it is a heavy validation gate, run it manually or on a pull request. If it is the core contract gate, treat it as a release-blocking regression until reviewed.
Book Maintenance
The book source lives under docs/book/. The detailed service references remain under docs/services/. When a service workflow changes, update both the source service documentation and the relevant book chapter or appendix.
Quarto configuration is in docs/book/_quarto.yml. If chapters are added or renamed, update the chapter list and rerun a render check.
Synthetic Validation Data
The repository includes a developer-only synthetic dataset generator under
hypothetical_data_generator/. It can regenerate safe validation datasets for
upload, readiness, training, reporting, and assistant-evaluation checks without
using private uploaded data.
The generator is documented in the appendix
docs/book/appendices/hypothetical-data-generator.md. Treat it as an internal
validation pipeline, not as a source of production model evidence.
The current generator writes one folder per canonical service type under
hypothetical_data_generator/datasets/. Structured services are exported across
the tabular/statistical formats accepted by the shared dataset reader when the
local writer dependencies are available; each folder records written and skipped
formats in dataset_manifest.json. Media services stay separate and use
manifest-based fixtures (labels.csv) rather than statistical table exports.
Public Demo System
The public demo workspace is an onboarding system, not a compute system. It is served from:
/demo/demo/{demo_id}/demo/{demo_id}/upload/demo/jobs/detail/{demo_id}/demo/{demo_id}/predict/demo/{demo_id}/billing
The primary source is three allowlisted completed jobs with saved AI report
artifacts under mlagent_website/jobs/ and mlagent_website/results/, loaded through
mlagent_website/services/demo_workspace.py and routed by
mlagent_website/routes/demo_routes.py. The legacy
mlagent_website/demo/demo_manifest.json remains only as a fallback when a
matching completed source job is not available.
Demo completed-job pages reuse mlagent_website/templates/job_status.html with
demo_mode=True. The demo can show upload setup, readiness, model metrics,
saved plots from the mapped completed job, generated-report summary, prediction
replay, and billing replay. It must not call training, SHAP, LLM
report-generation, prediction, billing mutation, or job-admin mutation APIs.
Public demo plot requests under /results/demo-*/plots/* are routed through
the demo alias. They serve the mapped completed job's plot when present and use
a generated SVG fallback only when the saved file is missing.
Admin Jobs Workspace
The administrative route is /admin/jobs, backed by /api/admin/jobs and
/api/admin/jobs/{job_id}/cancel. It is separate from the user
/jobs/workspace route because administrators need cross-user visibility and
stalled-job controls.
Admin identity:
auth_payment_service.users.is_superuser=trueis exposed by/users/measis_superuser=true,is_admin=true, androles=["user", "admin"]- the web app accepts either
is_admin=trueor an admin-like role/scope - selected accounts can be promoted through
POST /users/admin/promoteon the auth service with the dedicatedX-Admin-Promotion-Secretheader ADMIN_PROMOTION_SECRETmust be separate fromINTERNAL_REFUND_SECRET; leave it unset to disable the promotion endpoint
Implemented behavior:
- require an authenticated user with an admin claim
- list active, queued, stalled, failed, recently completed, and recently cancelled jobs across all users
- show owner, service, status, progress, current step, created time, last event, runtime, worker/process metadata where available, and billing/refund/ settlement state
- provide filters for owner, service, status, and stalled-heartbeat threshold
- mark a job as stalled when it is active but has exceeded a heartbeat or progress-update threshold
- require a reason before cancellation
- call the same cancellation/finalization path used by user-owned jobs, but with admin authorization
- trigger refund/settlement reconciliation after cancellation
- write an audit event with admin identity, reason, prior status, final status, and billing outcome
This route should not replace the owner-facing job workspace. It should be an operations console for support, recovery, and incident response.
Local Package And Environment Notes
The repository contains local package sources that are used by the canonical FastAPI app:
- root package metadata for
longiturf pyhtree/as a local editable package- the canonical application package
The root pyproject.toml is therefore not the whole web-application dependency
contract. Before running uv sync, confirm that all FastAPI/runtime
dependencies used by mlagent_website/ and auth_payment_service/ are
represented, or use a repair path rather than allowing sync to prune the
environment. For the shared local .venv, prefer:
uv sync --inexact
uv pip install -r mlagent_website\requirements-deploy.txt
uv pip install -r auth_payment_service\requirements.txt
The local startup helper performs these checks before launching:
.\start-dev.ps1
A clean local startup check should include:
python -m pip check
from the repository root, then import checks from the two app directories:
python -c "import main; print('main import ok')"
python -c "import app.main; print('auth app import ok')"
When validating longitudinal native backends, also check:
python -c "from pyhtree import hrf, htb; from pyhtree.hcb import hcb; from longiturf import MERT, MECB; print('longitudinal backends ok')"
Billing Refund Secret
Training, SHAP, report, and batch-prediction refunds are internal service-to-service calls from the web app to the auth/billing service. The INTERNAL_REFUND_SECRET value must match in:
- the repository-level environment configuration
- the web-application environment configuration
- the authentication and billing-service environment configuration
If the web app and auth service disagree, failed-job refund attempts will be rejected with 401 Invalid internal refund secret. After correcting the auth service .env, restart the auth/billing service before retrying refund reconciliation.
Billing Configuration Notes
Keep pricing configuration aligned with the product's simple story:
- Subscription gives access and an included credit allowance.
- Top-ups buy extra compute.
- Jobs and add-ons consume credits through estimate, reserve, settlement, and refund.
Registration-time grants should use TRIAL_CREDIT only when a deliberate trial or promotion is enabled. INITIAL_TOKEN_CREDIT remains a backward-compatible local/dev alias and should stay 0.00 in production. Payment-provider credits should be recorded as top-up purchases, not as subscription allowances.
Useful Further Reading
- Reading paths by role
- Product overview
- Service reference overview
- Architecture and execution flow
- Artifacts and implementation
- Runtime guardrails
Testing
Use the smallest relevant tests first and add deterministic tests for route or workflow regressions.
For documentation changes, useful checks include:
- validating that Quarto chapter references exist
- rendering HTML locally when Quarto is installed
- checking links to restored service workflow files
- confirming that the 20-service checklist remains consistent with the service reference overview
Source: docs/book/chapters/29-glossary.md
Glossary
AutoML
Automated machine-learning workflows that handle preprocessing, model training, comparison, evaluation, and artifact generation.
Artifact
A saved output from a job, such as a model file, plot, metadata file, report, or SHAP output.
Cross-Sectional Data
Data where each row is treated as one independent observation.
Longitudinal Data
Data containing repeated observations per subject or entity over time.
Time Series
Data indexed by ordered time, usually with temporal dependence.
SHAP
SHapley Additive exPlanations, a family of feature-attribution methods for interpreting model predictions.
PR-AUC
Area under the precision-recall curve. Often useful for imbalanced classification.
ROC-AUC
Area under the receiver operating characteristic curve.
Leakage
A modeling error where predictors contain information that would not be available at prediction time.
Censoring
In survival analysis, incomplete observation of the event time.
Dataset Split Contract
The saved record of how a job divided data for evaluation. It can describe an internal split, a user-supplied split column, or separate train/validation/test files, plus row counts and optional sampling-weight metadata.
Settlement
The billing step where a reserved charge is converted into a final net charge or refund.
Add-On
An optional job action such as SHAP analysis, AI report generation, report regeneration, or prediction-at-scale.
AI Report
An LLM-assisted report generated from saved job artifacts, metrics, context, figures, and references. It should be reviewed by a human before use.
Assistant
The in-app Xalec copilot that answers questions using the simplified controlled RAG runtime over the handbook, service metadata, and saved job artifacts.
Best Model
The model selected by the workflow according to the configured service objective, metrics, and guardrails.
Candidate Model
A model attempted during training and included in the comparison as successful, skipped, unavailable, or failed.
Count Regression
Regression for non-negative integer-like outcomes such as event counts, visits, cases, or incidents.
Feature
A predictor variable used by a model.
Guardrail
A rule that prevents a model or action from running when it is unavailable, unsafe, too expensive, incompatible, or unlikely to produce a valid result.
Controlled RAG
A retrieval-augmented generation pattern where allowed sources, evidence requirements, answer shape, citations, and unsupported-claim checks are constrained before an answer is returned. In the current Xalec runtime, this is a simplified handbook-first RAG rather than an autonomous agentic tool loop.
Manuscript Context
Structured job and study metadata used to ground an AI manuscript/report.
Net Charge
The final amount charged after reservation, settlement, and refund events are reconciled.
Positive Class
The class treated as the event or outcome of interest in binary classification.
Positive-class selection controls the direction of class-specific metrics, threshold diagnostics, ROC/PR interpretation, and confusion-matrix labels.
Regeneration
Rebuilding derived artifacts such as SHAP outputs or AI reports from an existing saved job.
Semantic Recall
An optional retrieval layer that uses embeddings to find relevant handbook chunks. In Xalec, semantic recall is a helper for retrieval, not a replacement for controlled source rules and answer verification.
Sampling Weight
A non-negative value that says how much a row represents in a sampled dataset. It is study-design information, not a predictor. Models use it only when their fitting backend supports weighted training.
Service
A product workflow for a particular data shape and objective, such as tabular classification, survival analysis, or network analysis.
Target
The outcome column or label the workflow is trying to predict, classify, explain, or model.
Validation Split
The way data are divided or resampled to estimate model performance on data not used for fitting.
Validation Dataset Section
The job-detail section shown when a saved split contract contains validation rows. It keeps validation metrics and validation-specific best-model visuals separate from the main Model Performance table so model-checking evidence is not confused with final test evidence.
Internally Generated Test Split
A final test split created by AutoML from the uploaded training file when a user uploads train and validation files but does not upload a test file. The uploaded validation file remains validation evidence, while the generated test split becomes the primary final performance evidence.
Canonical Acronym Index
This generated index is authoritative for product, metric, and configured-model acronyms. Xalec Assistant retrieves these definitions before broader handbook search.
| Acronym | Canonical expansion | Plain-language definition | Category |
|---|---|---|---|
| AdaBoost | Adaptive Boosting | A boosting ensemble that repeatedly focuses later learners on observations earlier learners handled poorly. | machine learning |
| AIC | Akaike Information Criterion | A model-comparison criterion that balances fit against model complexity. | statistics |
| ALBERT | A Lite BERT | A parameter-efficient transformer language-model architecture. | text and media |
| ARIMA | Autoregressive Integrated Moving Average | A time-series model combining autoregression, differencing, and moving-average terms. | time series |
| AUPRC | Area Under the Precision-Recall Curve | A threshold-independent summary of precision and recall, especially useful with imbalanced outcomes. | metrics |
| AUROC | Area Under the Receiver Operating Characteristic Curve | A threshold-independent summary of sensitivity versus false-positive rate. | metrics |
| AutoML | Automated Machine Learning | A workflow that automates repeatable parts of data preparation, model fitting, comparison, and artifact generation. | product |
| BERT | Bidirectional Encoder Representations from Transformers | A transformer architecture pretrained to represent text using left and right context. | text and media |
| BIRCH | Balanced Iterative Reducing and Clustering using Hierarchies | A clustering method that incrementally builds a compact hierarchy of subclusters. | clustering |
| CatBoost | Categorical Boosting | A gradient-boosted decision-tree library with native handling for categorical features. | machine learning |
| CNN | Convolutional Neural Network | A neural network that learns local patterns with convolutional filters. | machine learning |
| COPOD | Copula-Based Outlier Detection | An anomaly detector that uses empirical copula and tail probabilities. | anomaly detection |
| CRNN | Convolutional Recurrent Neural Network | A neural architecture combining convolutional feature extraction with recurrent sequence modelling. | text and media |
| DBSCAN | Density-Based Spatial Clustering of Applications with Noise | A clustering method that finds dense groups and labels isolated observations as noise. | clustering |
| DeepSAD | Deep Semi-Supervised Anomaly Detection | A neural anomaly detector that uses available normal or anomaly guidance to learn a compact representation. | anomaly detection |
| DeepSVDD | Deep Support Vector Data Description | A neural anomaly detector that learns a compact region containing typical observations. | anomaly detection |
| EDA | Exploratory Data Analysis | Initial summaries and visual checks used to understand data quality, distributions, and relationships. | statistics |
| ELECTRA | Efficiently Learning an Encoder that Classifies Token Replacements Accurately | A transformer pretraining approach based on detecting replaced tokens. | text and media |
| F1 | F1 Score | The harmonic mean of precision and recall; F1 is a metric name rather than a phrase acronym. | metrics |
| FFN | Feed-Forward Network | A neural network whose information flows from inputs through hidden layers to outputs without recurrent connections. | machine learning |
| GARCH | Generalized Autoregressive Conditional Heteroskedasticity | A time-series model for changing conditional variance or volatility. | time series |
| GAT | Graph Attention Network | A graph neural network that learns attention weights over neighbouring nodes. | graph learning |
| GCN | Graph Convolutional Network | A graph neural network that aggregates information from connected nodes. | graph learning |
| GEE | Generalized Estimating Equations | A population-average modelling approach for correlated or repeated observations. | longitudinal models |
| GLM | Generalized Linear Model | A regression framework linking a response distribution to a linear predictor. | statistics |
| GLMM | Generalized Linear Mixed Model | A generalized linear model containing fixed effects and group-level random effects. | longitudinal models |
| GNN | Graph Neural Network | A neural network designed to learn from nodes, edges, and graph structure. | graph learning |
| GPBoost | Gaussian Process Boosting | A modelling framework that combines tree boosting with Gaussian-process or grouped random-effect structure. | longitudinal models |
| GRU | Gated Recurrent Unit | A gated recurrent neural network for ordered or sequential data. | machine learning |
| HBOS | Histogram-Based Outlier Score | An anomaly score based on feature-wise histogram rarity. | anomaly detection |
| HCB | Historical CatBoost | A repo-defined historical-feature longitudinal model using a CatBoost learner under the HTB/HRF data contract. | longitudinal models |
| HMM | Hidden Markov Model | A sequence model with latent states connected by transition probabilities. | time series |
| HRF | Historical Random Forest | A longitudinal random-forest model built on ordered historical features. | longitudinal models |
| HTB | Historical Tree Boosting | A longitudinal boosting model built on ordered historical features. | longitudinal models |
| KNN | K-Nearest Neighbors | A method that predicts or scores observations using nearby training examples. | machine learning |
| LightGBM | Light Gradient Boosting Machine | A gradient-boosted decision-tree library designed for efficient training on structured data. | machine learning |
| LLM | Large Language Model | A language model trained at scale to generate or transform text. | product |
| LMM | Linear Mixed Model | A linear model containing fixed effects and group-level random effects. | longitudinal models |
| LOF | Local Outlier Factor | An anomaly detector comparing local density with neighbouring observations. | anomaly detection |
| LSTM | Long Short-Term Memory | A recurrent neural network with gated memory for sequential data. | machine learning |
| MAE | Mean Absolute Error | The average absolute difference between observed and predicted values. | metrics |
| MCD | Minimum Covariance Determinant | A robust estimator of multivariate centre and covariance used for outlier detection. | anomaly detection |
| MECB | Mixed Effects CatBoost | A repo-defined mixed-effects longitudinal model using CatBoost for the nonlinear component. | longitudinal models |
| MERF | Mixed Effects Random Forest | A mixed-effects model using a random forest for nonlinear fixed effects and group-level random effects. | longitudinal models |
| MERT | Mixed Effects Regression Tree | A mixed-effects model using a regression tree for nonlinear fixed effects and group-level random effects. | longitudinal models |
| MHSA | Multi-Head Self-Attention | A transformer operation that learns several attention relationships within one sequence. | text and media |
| ML | Machine Learning | Methods that learn predictive or descriptive patterns from data. | product |
| MLP | Multilayer Perceptron | A feed-forward neural network with one or more hidden layers. | machine learning |
| MSE | Mean Squared Error | The average squared difference between observed and predicted values. | metrics |
| MViT | Multiscale Vision Transformer | A vision-transformer architecture that models image or video patterns at more than one scale. | text and media |
| NDCG | Normalized Discounted Cumulative Gain | A ranking metric that rewards relevant items appearing near the top of a ranked list. | metrics |
| OPTICS | Ordering Points To Identify the Clustering Structure | A density-based clustering method that can reveal groups with different densities. | clustering |
| PCA | Principal Component Analysis | A linear projection that represents variation using orthogonal components. | statistics |
| PR | Precision-Recall | A paired view of positive predictive value and sensitivity across decision thresholds. | metrics |
| PR-AUC | Area Under the Precision-Recall Curve | A threshold-independent summary of precision and recall, especially useful with imbalanced outcomes. | metrics |
| RAG | Retrieval-Augmented Generation | Answer generation grounded with evidence retrieved from approved sources. | product |
| REEM | Random Effects Expectation Maximization | An iterative mixed-effects approach that alternates nonlinear model fitting with random-effect estimation. | longitudinal models |
| RMSE | Root Mean Squared Error | The square root of mean squared error, expressed in the outcome's units. | metrics |
| RNN | Recurrent Neural Network | A neural network designed to represent ordered or sequential observations. | machine learning |
| ROC | Receiver Operating Characteristic | A curve of sensitivity against false-positive rate across thresholds. | metrics |
| ROC-AUC | Area Under the Receiver Operating Characteristic Curve | A threshold-independent summary of sensitivity versus false-positive rate. | metrics |
| ROCKET | RandOm Convolutional KErnel Transform | A time-series transform using many convolutional kernels before a simpler classifier or regressor. | time series |
| RRCF | Robust Random Cut Forest | An ensemble anomaly detector based on random partitioning trees. | anomaly detection |
| RSF | Random Survival Forest | A tree ensemble for estimating survival or event-risk patterns from time-to-event data. | survival |
| SHAP | SHapley Additive exPlanations | A family of feature-attribution methods based on Shapley values. | explainability |
| SVM | Support Vector Machine | A margin-based method for classification, regression, or one-class boundary estimation. | machine learning |
| TCN | Temporal Convolutional Network | A convolutional architecture for sequential data using causal and often dilated filters. | time series |
| VAE | Variational Autoencoder | A probabilistic latent-variable autoencoder used for representation learning and anomaly detection. | machine learning |
| VAR | Vector Autoregression | A time-series model that jointly models several variables from their past values. | time series |
| XGBoost | Extreme Gradient Boosting | A regularized gradient-boosted decision-tree library for structured data. | machine learning |
| XLM-R | Cross-Lingual RoBERTa | A multilingual transformer language-model architecture. | text and media |
Source: docs/book/chapters/30-publication-notes.md
Publication Notes
This chapter records publication-facing metadata and use conditions for the Xalec AutoML Services Handbook. It is intended for readers, reviewers, libraries, partners, and publishing teams who need to understand the status and permitted use of the handbook as a reference work.
Edition And Status
This edition describes Xalec AutoML Services as documented in the handbook source at the time of rendering. The handbook is maintained as a living technical and user reference, so the current source Markdown is the content of record.
Generated HTML, PDF, and DOCX versions are publication outputs. They should be treated as editioned snapshots rather than the editing source. If a generated export differs from the source Markdown, the source Markdown takes priority.
The handbook covers active platform workflows, user-facing outputs, methodology references, billing concepts, explainability behavior, AI report behavior, and administrative notes. It does not certify that every deployment environment, dependency, model runtime, or third-party integration is identical to the editioned snapshot.
Suggested Citation
For internal reports, reviews, and technical appendices, cite the handbook as:
Xalec. Xalec AutoML Services Handbook: User Guide, Service Reference, Mathematical Methods, and Implementation Notes. Xalec AI, 2026.
When citing a specific model, workflow, or methodology section, include the chapter or appendix title and the edition date shown in the rendered handbook.
Rights And Permissions
Copyright © 2026 Xalec AI. All rights reserved unless a separate written license or publishing agreement states otherwise.
The handbook may reference open-source libraries, statistical methods, machine learning algorithms, and third-party services. Those references do not transfer third-party rights, licenses, trademarks, warranties, or permissions into this handbook. Users and publishers should respect the licenses and terms governing the referenced software and services.
Permission requests for reproduction, translation, adaptation, commercial distribution, or publisher-hosted editions should be directed to Xalec AI or the designated rights holder for the edition being used.
Scope Of Use
This handbook is a product and methodology reference for Xalec AutoML Services. It is appropriate for:
- onboarding users to the platform;
- selecting service workflows;
- preparing datasets and interpreting readiness feedback;
- reviewing metrics, plots, explainability outputs, reports, and artifacts;
- understanding billing, credits, reservations, settlement, and refunds;
- auditing model methodology at a high level.
The handbook is not a substitute for professional statistical review, legal review, clinical review, financial advice, regulatory approval, institutional review, or publication peer review. Results generated by the platform should be treated as decision-support evidence that requires human review in the relevant domain context.
Editorial Conventions
The handbook uses consistent terminology across workflows:
- service means a product workflow for a specific data shape and objective;
- job means a saved training or analysis run with durable artifacts;
- readiness means pre-training evidence about whether the uploaded data can support the requested workflow;
- artifact means saved evidence such as metrics, plots, logs, reports, manifests, model files, and billing records;
- AI report means a reviewable draft grounded in saved job evidence;
- assistant means the controlled handbook and job-artifact reader, not a general autonomous analyst.
Equations are typeset in display math where possible. Model sections should state the plain meaning, mathematical or probabilistic formulation, optimization objective or estimator, assumptions, and interpretation guidance when these are applicable.
Disclaimer
Xalec AutoML Services can assist with machine-learning workflow selection, model training, evaluation, explainability, prediction, reporting, and audit trails. The platform and handbook do not guarantee that a model is correct, fair, causal, clinically valid, legally compliant, production-ready, or appropriate for a particular decision.
Users remain responsible for checking data provenance, consent, governance, privacy, security, statistical validity, domain assumptions, downstream use, and any regulatory or institutional requirements that apply to their work.
The handbook may describe billing concepts, runtime behavior, dependencies, and third-party integrations. Actual deployed behavior may vary by environment, configuration, plan, available dependencies, account status, and service provider availability.
Source: docs/book/chapters/31-publisher-readiness-and-editorial-audit.md
Publisher Readiness And Editorial Audit
This chapter defines the editorial audit used before a handbook edition is released for external readers, partners, institutional review, or publisher consideration. It complements the Publication Style Sheet appendix by turning style rules into practical review checkpoints.
Editorial Readiness Standard
A publisher-ready edition should read as one coherent reference work. It should not feel like a collection of implementation notes, issue reports, or internal engineering fragments.
Before release, the edition should satisfy five standards:
- the product narrative is consistent across overview, workflow, service, and methodology chapters;
- user-facing concepts are explained before implementation details;
- formulas and objectives are readable in HTML, PDF, and DOCX outputs;
- service counts, model counts, billing behavior, and workflow descriptions match the active platform;
- limitations, scope, rights, and review responsibilities are explicit.
Content Audit
The content audit checks whether the handbook answers the reader's practical questions in a clear order:
- What does the platform do?
- Who should use it?
- Which workflow should a user choose?
- What data does each workflow require?
- What happens during readiness preview, training, explainability, reporting, prediction, and billing?
- How should outputs be reviewed before use?
- What evidence is saved for audit and reproducibility?
Any chapter that relies on internal repository language, unresolved TODOs, local development paths, or duplicate product narratives should be revised before publication.
Methodology And Formula Audit
Every active service family should have a methodology path from service description to model mathematics. Where a model has a standard objective, estimator, likelihood, split criterion, score, distance, ranking loss, or diagnostic statistic, the handbook should name it.
The formula audit checks that:
- formulas render as math, not stacked plain text;
- each model or model family explains the quantity being estimated or optimized;
- count, classification, regression, ranking, clustering, survival, time-series, media, network, recommendation, anomaly, and graphical-model workflows use service-appropriate metrics;
- model limitations and assumptions are stated without overstating certainty;
- planned or conditional behavior is not presented as guaranteed active behavior.
If a model is implementation-specific or does not have one clean textbook objective, the handbook should explain the estimator or decision rule rather than forcing a misleading optimization equation.
Figures, Tables, And Accessibility Audit
Publication outputs should support both screen reading and print review.
The figure and table audit checks that:
- important figures have meaningful captions or surrounding explanation;
- plots are described as evidence, not conclusions;
- tables fit in PDF and DOCX layouts where possible;
- image assets render in HTML, PDF, and DOCX builds;
- model comparison, readiness, billing, and audit tables use consistent terminology;
- decorative assets do not obscure the reading order.
Where a plot or metric is workflow-specific, the handbook should explain why it matters for that service rather than implying that all workflows produce the same evidence.
Evidence And Traceability Audit
The handbook should make clear which claims are product behavior, methodology background, billing policy, or operational guidance.
The traceability audit checks that:
- service descriptions align with the active service catalog;
- upload and data-format guidance matches the shared dataset reader and media manifest workflows;
- assistant and AI report descriptions match their controlled, evidence-grounded role;
- billing chapters describe credits, reservations, settlement, refunds, and ledger evidence consistently;
- job-artifact claims use saved evidence rather than broad inference;
- generated handbook exports are treated as outputs rather than source files.
Editorial Risk Review
The editorial risk review identifies areas that require careful human approval before public distribution:
- medical, clinical, public-health, financial, legal, or regulated use cases;
- claims about fairness, causality, compliance, deployment readiness, or scientific validity;
- pricing, refund, rights, and permission language;
- third-party trademarks, library references, and service-provider descriptions;
- AI-generated report language that might be mistaken for peer-reviewed findings.
High-risk language should be conservative, source-grounded, and explicit about human review.
Release Checklist
Before publishing an edition:
- Confirm the source Markdown is the source of truth.
- Run model-objective and publication-readiness checks.
- Render HTML, PDF, and DOCX from Quarto.
- Open the rendered HTML and confirm the book structure is intact.
- Spot-check PDF math, figures, tables, and page breaks.
- Spot-check DOCX headings, equations, lists, and tables.
- Confirm service counts and model catalog summaries match the active app.
- Confirm Publication Notes, rights language, scope, and disclaimer are present.
- Confirm the edition date and citation guidance are current.
- Record any known limitations that remain before external release.
Readiness Classification
Use these labels during editorial review:
- Internal draft: suitable for product development and review, but not for external publication.
- External review draft: coherent enough for selected reviewers, but still subject to editorial and legal review.
- Publisher review candidate: complete enough to submit for editorial, design, rights, and production review.
- Published edition: approved, rendered, archived, and distributed under the applicable rights and permissions.
The label should be assigned to the edition as a whole. Individual chapters may have different maturity levels, but the public edition should carry the most conservative classification that applies.
Source: docs/book/appendices/service-workflow-checklist.md
Service Workflow Checklist
This appendix mirrors the restored 20-service coverage checklist.
| # | Service | Product Route | Related handbook section |
|---|---|---|---|
| 1 | tabular_classification |
/tabular-classification |
Cross-Sectional Services |
| 2 | tabular_regression |
/tabular-regression |
Cross-Sectional Services |
| 3 | tabular_count_regression |
/tabular-count-regression |
Cross-Sectional Services |
| 4 | longitudinal_classification |
/longitudinal-classification |
Longitudinal Services |
| 5 | longitudinal_regression |
/longitudinal-regression |
Longitudinal Services |
| 6 | longitudinal_count_regression |
/longitudinal-count-regression |
Longitudinal Services |
| 7 | time_series_classification |
/time-series-classification |
Time-Series Services |
| 8 | time_series_regression |
/time-series-regression |
Time-Series Services |
| 9 | time_series_count_regression |
/time-series-count-regression |
Time-Series Services |
| 10 | text_classification |
/text-classification |
Text and Media Services |
| 11 | image_classification |
/image-classification |
Text and Media Services |
| 12 | audio_classification |
/audio-classification |
Text and Media Services |
| 13 | video_classification |
/video-classification |
Text and Media Services |
| 14 | survival |
/survival |
Specialized Services |
| 15 | anomaly_detection |
/anomaly-detection |
Specialized Services |
| 16 | clustering |
/clustering |
Specialized Services |
| 17 | recommendation_system |
/recommendation-system |
Advanced Systems |
| 18 | ranking_models |
/ranking |
Advanced Systems |
| 19 | network_analysis |
/network-analysis |
Advanced Systems |
| 20 | graphical_models |
/graphical-models |
Advanced Systems |
The operational checklist is maintained with the service workflow documentation.
Live-Monitor Runtime Guardrail
For service workflows whose async training entry points wrap long synchronous model fits, the shared pipeline must offload training from the FastAPI event loop. This guardrail currently applies to:
- longitudinal services
- time-series services
ranking_modelssurvival- media classification services
This keeps websocket updates, polling fallback, auth-status checks, and progress bar tracking responsive while model training continues.
Dataset Evaluation Contract Coverage
The shared explicit-split contract applies to supervised and evaluation-oriented workflows where held-out rows have a clear meaning. Tabular, text, longitudinal, time-series, survival, ranking, and recommendation services consume split roles directly. Media classification consumes split roles through the label manifest. Labeled anomaly detection can evaluate on supplied validation/test rows; unlabeled anomaly detection remains unsupervised.
Clustering, graphical models, and network analysis should use their own validation contracts: stability and profile review for clustering, dependency stability or held-out likelihood for graphical models, and graph-aware node/edge/phase validation for network analysis.
Source: docs/book/appendices/workflow-selection-matrix.md
Workflow Selection Matrix
This appendix gives a one-page decision aid for choosing the right service before training. It is meant to complement the narrative workflow-choice chapter with a faster lookup table.
Fast Selection Questions
Use these questions in order:
- Is the data tabular, repeated over time, purely time-ordered, text, media, graph-structured, or interaction-based?
- Is the goal prediction, grouping, ranking, anomaly detection, recommendation, or time-to-event modeling?
- Does the target exist already, and if so is it categorical, continuous, count, event, or ranking relevance?
- Are repeated subject structure or temporal order part of the truth, not just extra columns?
Service Matrix
| Service | Best When | Core Input Shape | Target / Output Type | Key Required Columns Or Files | Do Not Use When |
|---|---|---|---|---|---|
tabular_classification |
one row per observation and a categorical target | cross-sectional table | class label | predictors plus target |
the same subject appears repeatedly or time order is analytically important |
tabular_regression |
one row per observation and a continuous target | cross-sectional table | numeric target | predictors plus target |
repeated-measure or forecasting structure matters |
tabular_count_regression |
one row per observation and a count-like target | cross-sectional table | non-negative count target | predictors plus target |
count evolves as a true time series or repeated subject process |
longitudinal_classification |
repeated observations per subject with a categorical outcome | panel / repeated measures | class label | subject_id, time, predictors, target |
there is only one row per subject or grouping is artificial |
longitudinal_regression |
repeated observations per subject with a continuous outcome | panel / repeated measures | numeric target | subject_id, time, predictors, target |
time is not meaningful and rows are independent |
longitudinal_count_regression |
repeated observations per subject with count outcomes | panel / repeated measures | count target | subject_id, time, predictors, target |
the task is better treated as pure sequence forecasting |
time_series_classification |
ordered sequences or temporal patterns need class prediction | temporal sequence | class label | time, sequence features, target |
samples are independent tabular rows |
time_series_regression |
forecasting or continuous temporal estimation is the main goal | temporal sequence | forecast / continuous target | time, target, optional exogenous features |
there is no meaningful order or horizon |
time_series_count_regression |
forecasting count values over time | temporal sequence | count forecast | time, target, optional exogenous features |
count is cross-sectional rather than serial |
text_classification |
raw documents, notes, or messages drive the prediction | text rows | class label | text, target |
the important signal is mostly structured metadata instead of text |
image_classification |
labels are predicted from images | image files | class label | image files plus labels | the input is really tabular features extracted elsewhere |
audio_classification |
labels are predicted from sound recordings | audio files | class label | audio files plus labels | the input is better represented as a ready-made tabular summary only |
video_classification |
labels are predicted from clips or videos | video files | class label | video files plus labels | a still image per sample is enough |
anomaly_detection |
the goal is to flag unusual observations without a standard supervised target | feature table | anomaly score / flag | feature columns | a clean supervised target already exists |
clustering |
the goal is to group similar records without labels | feature table | cluster assignment | feature columns | the main goal is prediction against known labels |
survival |
the goal is time-to-event modeling with censoring | tabular survival table | survival risk / curve / event-time distribution | time, event, predictors |
censoring is absent and simple classification/regression is enough |
recommendation_system |
the goal is to recommend items to users | interaction table | user-item affinity | user_id, item_id, rating or implicit preference signal |
the task is ordinary supervised tabular prediction |
ranking_models |
items must be ordered within query or group contexts | grouped ranking table | ranked ordering / relevance | query_id, features, relevance |
there is no grouped ranking problem |
network_analysis |
graph structure, adjacency, or phase-by-phase network change is central to the task | edge list, adjacency matrix, and optional phase/wave metadata | node-level, graph-level, embedding, or phase-comparison outputs | node identifiers, graph structure, optional labels and phase/wave column | the structure is not actually relational |
graphical_models |
conditional dependence, hidden state, or state-space structure among variables is central | tabular variables, optional time/order column | dependency graph, precision/partial-correlation structure, hidden-state or Kalman diagnostics | selected variables, optional time, optional anchor/outcome variable |
the edges are already observed nodes/edges that should use network_analysis |
Practical Choice Heuristics
- If repeated subjects appear in the data, prefer longitudinal over ordinary tabular unless you have a strong reason not to.
- If time order changes what counts as leakage or what should be predicted next, prefer time-series services over ordinary tabular ones.
- If there is no target and the goal is discovery, start with clustering or anomaly detection rather than forcing supervised training.
- If censoring matters, use survival rather than recoding the problem into a simpler target and losing the survival structure.
- If user-item interaction is the core data object, use recommendation instead of general tabular modeling.
- If network phases or waves are the analytic question, map the phase column explicitly instead of treating it as an ordinary feature.
- If edges are inferred among variables rather than observed between actors/nodes, use Graphical Models instead of Network Analysis.
Red Flags That Usually Mean The Wrong Workflow Was Chosen
- The same subject appears in both train and test, but the workflow is cross-sectional.
- A forecasting task is being run without a real time index.
- A survival task has event and time columns but is being treated as plain classification.
- Raw text is heavily compressed into ad hoc numeric features before the text service is even considered.
- Ranking is attempted through ordinary classification labels without query grouping.
- Recommendation data is flattened into a tabular prediction problem with user and item IDs as plain features.
- A phased network is uploaded with the phase column left in the feature list, which hides the phase-comparison diagnostics.
- A graphical-model question is flattened into ordinary regression even though the main output should be an interpretable dependency graph.
Minimal Review Checklist Before Launch
- Confirm the target type really matches the service.
- Confirm the required identifying columns exist and are clean.
- Confirm whether evaluation should use an internal split, a split column, or separate train/validation/test files.
- Confirm whether a sampling-weight column is needed because the modeling file represents a sampled population.
- Confirm the product outputs you need are supported by the service family.
- Confirm the workflow reflects the real structure of the study, not just the convenient shape of the CSV.
Deep References
Source: docs/book/appendices/model-family-matrix.md
Model Family Matrix
This appendix maps major method families to service families.
| Model Family | Cross-Sectional | Longitudinal | Time Series | Text | Media | Specialized | Advanced Systems |
|---|---|---|---|---|---|---|---|
| Linear / GLM | yes | yes | partial | no | no | partial | no |
| Tree models | yes | yes | partial | no | no | yes | partial |
| Boosting | yes | yes | partial | no | partial | yes | yes |
| Neural networks | yes | partial | yes | yes | yes | yes | yes |
| Bayesian / generative | yes | partial | partial | no | no | partial | no |
| Survival models | no | partial | no | no | no | yes | no |
| Clustering | partial | partial | partial | partial | partial | yes | partial |
| Recommendation/ranking | no | no | partial | partial | no | no | yes |
| Graph models | no | no | no | no | no | partial | yes |
Use this as a navigation aid, not a substitute for the detailed service chapters.
Source: docs/book/appendices/upload-forms-model-registry-summary.md
Upload Forms And Model Registry Summary
This appendix summarizes the current relationship between upload workflows and the service catalog model registry.
The implementation source of truth is the live service catalog, the shared upload templates, and the service-specific media model registries. This appendix is the reader-facing summary of that live inventory.
The current catalog-backed inventory is:
| Measure | Count |
|---|---|
| Service workflows / upload forms | 20 |
| Configured model options across service workflows | 268 |
| Unique model values across service workflows | 223 |
In public product copy, this can be summarized as 250+ model configurations across 20 workflows. The precise current count is 268.
Per-Service Counts
| Service | Model options |
|---|---|
| Cross-Sectional Classification | 16 |
| Cross-Sectional Regression | 14 |
| Cross-Sectional Count Regression | 22 |
| Longitudinal Classification | 13 |
| Longitudinal Regression | 13 |
| Longitudinal Count Regression | 14 |
| Time Series Classification | 15 |
| Time Series Regression | 15 |
| Time Series Count Regression | 15 |
| Text Classification | 12 |
| Image Classification | 13 |
| Audio Classification | 12 |
| Video Classification | 13 |
| Anomaly Detection | 18 |
| Clustering | 11 |
| Survival Analysis | 9 |
| Recommendation System | 8 |
| Ranking Models | 15 |
| Network Analysis | 13 |
| Graphical Models | 7 |
Interpretation
The service catalog now separates two ideas:
supported_models: the full model list represented in the upload workflow and catalog.preset_model_values: curated subsets for Fast, Balanced, Best Accuracy, and Low Cost setup choices.
Therefore, a preset count is not the same as a service's full model count. The full count should come from supported_models.
Upload Catalog UX Contract
Model variety is part of the product value. Upload forms that expose
models_to_train should mount the model catalog after a successful readiness
preview instead of hiding it behind a generic advanced drawer or showing it
before the user has mapped the dataset roles.
The expected pattern is:
- upload and map required roles
- preview readiness and server-computed dataset shape
- show the first comparison strategy
- show the visible model catalog for broadening, narrowing, or targeting model families
- keep hyperparameters, runtime overrides, and detailed method settings in secondary tuning sections
- confirm cost and launch training
Regression coverage should continue to check that upload-visible model values
match SERVICE_CATALOG, that model controls are clearly labeled, and that the
live-monitor bootstrap does not regress on inline upload forms.
The cross-sectional count regression workflow exposes 22 configured options,
including count-specific aliases for the added classical and neural comparison
set: svm_count, knn_count, mlp_count, gradient_boosting_count,
ada_boost_count, keras_mlp_count, keras_cnn_count, and
keras_rnn_count. Legacy submitted names such as gradient_boosting,
ada_boost, keras_mlp, and keras_cnn are canonicalized to these
count-specific IDs before training.
The time-series classification service currently exposes 15 configured options:
lstm_classifier, gru_classifier, cnn_1d, cnn_lstm, transformer_ts,
tcn_classifier, inception_time, arima_classifier,
auto_arima_classifier, var_classifier, garch_classifier,
exponential_smoothing_classifier, prophet_classifier, rocket, and
minirocket.
Maintenance Rule
When a model is added to an upload form, it must also be added to the matching supported_models list in SERVICE_CATALOG. The regression test tests/test_service_catalog_upload_model_parity.py checks this alignment without importing heavy ML runtime modules.
Source: docs/book/appendices/reproducibility-checklist-template.md
Reproducibility Checklist Template
This appendix is a reusable checklist for auditing a single job before sharing results, quoting metrics, or exporting report outputs.
How To Use This Template
Use one copy per job. The goal is not bureaucracy. The goal is to make sure the visible UI, saved artifacts, and downstream manuscript all point to the same durable truth.
Job Identity
- Job ID:
- Service:
- Created at:
- Reviewer:
- Review date:
Workflow Choice
- Confirm the chosen service matches the real data structure.
- Confirm target type matches the workflow type.
- Confirm repeated subject structure or time order was not ignored.
- Confirm the service family is appropriate for the actual study question.
Notes:
Input Contract
- Confirm required columns or files were present.
- Confirm obvious identifier or leakage columns were handled appropriately.
- Confirm missingness and data-quality warnings were reviewed.
- Confirm any domain-critical fields were mapped correctly.
Notes:
Training Evidence
- Confirm the final job status is terminal and believable.
- Confirm the best model is visible and has supporting metrics.
- Confirm runner-up models, failures, and skips are explainable.
- Confirm the selection metric matches the use case.
- Confirm no stale partial recovery payload is outranking the final training result.
Notes:
Metrics And Validation
- Confirm displayed metrics are consistent across summary tables and plots.
- Confirm validation design fits the workflow family.
- Confirm suspiciously perfect scores were reviewed for leakage or evaluation errors.
- Confirm model selection did not depend on a pathological threshold or degenerate output.
Notes:
Artifact Inventory
- Confirm the result directory exists and contains the expected core files.
- Confirm plots displayed in the UI exist on disk or in the saved manifest.
- Confirm comparison outputs, model artifacts, and metadata are present.
- Confirm downloadable outputs reflect the current saved state.
Notes:
SHAP And Explainability
- Confirm SHAP was either completed or explicitly unsupported.
- Confirm SHAP plots are registered in the durable manifest, not only present on disk.
- Confirm any SHAP fallback model is documented if the best model was not directly explainable.
- Confirm explainability language matches what artifacts actually exist.
Notes:
AI Report And Manuscript
- Confirm the report is grounded in the saved job payload and not generic fallback context.
- Confirm references shown in the manuscript are resolved and consistent.
- Confirm saved completions or declarations are reflected in the current manuscript view.
- Confirm the downloadable report matches the in-app report state.
- Confirm validation metadata does not show missing critical context.
Notes:
Billing And Settlement
- Confirm billing lines correspond to authoritative ledger entries.
- Confirm reservation, settlement, refund, or no-charge wording is coherent.
- Confirm add-on billing for SHAP or AI report reflects actual outcome.
- Confirm completed workflow success is not being confused with settlement success.
Notes:
Regeneration And Recovery
- Confirm whether any output was regenerated after the original training run.
- Confirm regeneration used the real saved context.
- Confirm recovered outputs are labeled honestly as recovered only when recovery truly happened.
- Confirm old stale siblings or fragments are not competing with final outputs.
Notes:
Final Release Decision
- Ready to cite externally: yes / no
- Ready to export and share: yes / no
- Needs retraining: yes / no
- Needs regeneration only: yes / no
- Needs engineering review: yes / no
Reviewer Summary
- Main strengths:
- Main risks:
- Required next action:
Deep References
Source: docs/book/appendices/publication-style-sheet.md
Publication Style Sheet
This style sheet governs future edits to the Xalec AutoML Services Handbook. Its purpose is to keep the book coherent, publication-ready, and distinct from internal engineering notes.
Editorial Positioning
Write the handbook as a professional product and methodology reference. The primary reader is a user, analyst, reviewer, administrator, or evaluator who needs to understand the workflow and evidence. Do not assume the reader is inside the source repository.
Use a calm, precise, evidence-oriented tone:
- prefer "the platform" or "Xalec AutoML Services" over informal shorthand;
- prefer "workflow" over "screen" when describing the analytic process;
- prefer "saved evidence" or "job artifacts" over "files on disk" in reader-facing chapters;
- describe AI reports as reviewable drafts, not final scientific manuscripts;
- describe assistant answers as grounded handbook or job-artifact readings, not autonomous expert judgment.
Reader-Facing Versus Developer-Facing Material
Reader-facing chapters should explain:
- what the workflow does;
- what data shape it expects;
- what metrics, plots, reports, and artifacts it produces;
- what limitations and review steps matter;
- how billing, readiness, explainability, and reports should be interpreted.
Developer-facing material belongs in the Admin And Developer Appendix or in external contribution documentation. Avoid repository paths, route names, module names, command-line snippets, or local startup instructions in front matter, overview, getting-started, service-reference, and methodology chapters unless they are essential for traceability.
Mathematical Style
Every model-methodology entry should provide, where applicable:
- plain-language purpose;
- algebraic or probabilistic formulation;
- optimization objective or estimator definition;
- assumptions;
- interpretation guidance;
- service-context note when the same model family appears in multiple workflows.
Use display math for equations:
$$
\hat{y}_i = \beta_0 + x_i^\top\beta
$$
Do not render equations as stacked plain text. Inline math is acceptable for short symbols such as $x_i$, $y_i$, $\theta$, or $S(t\mid x)$.
When a method does not optimize a differentiable objective, say so explicitly and name the estimator, split criterion, ranking rule, or diagnostic quantity that defines the method.
Formula Audit Rule
Each service-family mathematics appendix must include:
- an Objective Lookup By Model Identifier section;
- one model or model-family entry per service-visible identifier group;
- an Optimization objective section for each model entry, except explicitly labelled non-model contract sections;
- enough mathematical notation for the reader to understand what is fitted, estimated, ranked, clustered, or diagnosed.
Status Language
Use status terms consistently:
- Active: exposed in the service workflow and expected to run when selected, subject to data shape and runtime guardrails.
- Skipped: available in principle but not run for a specific job because of dependency, data, runtime, or configuration constraints.
- Failed: attempted but did not finish successfully for a specific job.
- Planned: documented as a mathematical or product direction but not guaranteed to be selectable in the active workflow.
Do not mix planned and active models in a way that implies unsupported behavior is available.
Billing And Trust Language
Billing prose should use one consistent story:
- Subscription grants access and may include credits.
- Top-ups add wallet credits.
- Jobs estimate, reserve, settle, and refund credits according to saved evidence.
- The wallet ledger is the source of truth for account balance.
Avoid vague phrases such as "tokens" where the user-facing concept is credits. When a charge or refund is conditional, state the condition.
Assistant And AI Report Language
The assistant is a controlled handbook and job-artifact reader. It should not be described as a general analyst, autonomous agent, or independent scientific reviewer.
AI reports should be described as structured drafts grounded in saved job evidence. They require human review for factual accuracy, domain context, citations, limitations, declarations, and publication suitability.
Source And Traceability Policy
Source Markdown under docs/book/** is the handbook source of truth. Generated
HTML, PDF, and DOCX files are publication outputs. Do not edit generated
exports to change content.
When a lower-level implementation detail is needed for audit, place it in a traceability note, source-document map, or developer appendix rather than in the main narrative.
EDA Display Policy
Feature-distribution plots use the observed data type as the default display
contract. Numeric and boolean features are rendered as numeric distributions;
low cardinality alone does not turn a numeric variable into a categorical
bar chart. Explicitly categorical/text features use category distributions,
with declared ordinal order preserved and missingness shown as a distinct
Missing category. Numeric year/cohort fields may use categorical display
only when their names explicitly identify them as discrete strata.
Outcome shares and prevalence trends preserve a zero baseline but use an adaptive upper limit derived from the observed values and confidence interval, with padding and a maximum of 1.0. This keeps low-prevalence signals readable without allowing the chart to exaggerate a non-zero baseline. Numeric outcome trends use a data-scaled axis instead.
Prohibited Drift Patterns
Avoid:
- unresolved placeholders;
- "TODO", "TBD", or "FIXME" language in book source;
- generic product claims not backed by current service behavior;
- exact local file paths in reader-facing chapters;
- mixing demo, local development, and production behavior without labeling the context;
- presenting planned models as active;
- publishing formulas without objectives or objectives without interpretation.
Pre-Publication Checklist
Before publishing a new handbook build:
- Run the model-objective audit.
- Run the publication-readiness tests.
- Render HTML, PDF, and DOCX from Quarto.
- Check the front matter and overview for implementation chatter.
- Spot-check formulas in the PDF.
- Confirm service counts and model counts match the active service catalog.
- Confirm AI report and assistant sections describe reviewable grounded evidence, not autonomous conclusions.
Source: docs/book/appendices/hypothetical-data-generator.md
Hypothetical Data Generator
This appendix documents the repository's synthetic validation dataset pipeline. It is intended for developers, administrators, and reviewers who need repeatable test data for service smoke tests, workflow checks, readiness previews, and RAG or report-evaluation fixtures.
The generator is not a production user workflow. It should not be presented as a source of real research evidence, billing evidence, model-performance evidence, or customer training data.
Location And Entrypoint
The pipeline lives under:
hypothetical_data_generator/hypothetical_data_generator/main.pyhypothetical_data_generator/generators/hypothetical_data_generator/utils/features.py
The main entrypoint is:
python hypothetical_data_generator/main.py
Running the entrypoint writes generated files to one folder per canonical service type:
hypothetical_data_generator/datasets/
tabular_classification/
tabular_regression/
longitudinal_classification/
time_series_classification/
text_classification/
image_classification/
audio_classification/
video_classification/
...
By default the generator asks the app's shared dataset reader for the accepted tabular upload extensions and attempts to export each structured dataset in those formats:
python hypothetical_data_generator/main.py --formats all
For faster local smoke runs, generate only the core formats:
python hypothetical_data_generator/main.py --formats core
You may also pass a comma-separated list:
python hypothetical_data_generator/main.py --formats csv,tsv,parquet,jsonl
Every service folder receives a dataset_manifest.json showing which variants
were written and which were skipped because the local Python environment cannot
write that format. This matters for readable-but-hard-to-write formats such as
legacy .xls, SAS7BDAT, and optional SPSS/R exports when pyreadstat or
pyreadr is not installed.
Purpose
Use the generated datasets to exercise platform behavior across the 20 service families without depending on private uploaded data.
Appropriate uses include:
- smoke-testing upload forms and Preview Data Readiness
- validating train/test schema compatibility
- checking model-registration and service-routing behavior
- reproducing known edge cases with controlled data
- evaluating report generation, artifact discovery, assistant retrieval, and UI rendering
- creating safe fixtures for tests that must not include real row-level data
Do not use these files to claim real-world model accuracy, external validity, or deployment readiness.
Generated Dataset Families
main.py currently orchestrates these dataset groups:
| Family | Example outputs | Intended service coverage |
|---|---|---|
| Family | Service folder | Example stems |
| --- | --- | --- |
| Classification | tabular_classification/ |
classification_train_2class, classification_train_3class |
| Regression | tabular_regression/ |
regression_train |
| Count regression | tabular_count_regression/ |
countreg_train |
| Longitudinal classification | longitudinal_classification/ |
long_classification_2_train, long_classification_3_train |
| Longitudinal regression | longitudinal_regression/ |
long_regression_train |
| Longitudinal count regression | longitudinal_count_regression/ |
long_count_regression_train |
| Time-series classification | time_series_classification/ |
single_ts_classification_*, multi_ts_classification_* |
| Time-series regression | time_series_regression/ |
single_ts_stock_regression_*, multi_ts_forex_regression_* |
| Time-series count regression | time_series_count_regression/ |
single_ts_claims_count_regression_*, multi_ts_claims_count_regression_* |
| Text classification | text_classification/ |
text_classification_train |
| Survival | survival/ |
survival_train, survival_competing_train |
| Clustering | clustering/ |
clustering |
| Recommendation | recommendation_system/ |
recommendation_train |
| Graph/network | network_analysis/ |
network_upload_combined, network_adjacency_matrix, graph_nodes_reference, graph_edges_reference |
| Anomaly detection | anomaly_detection/ |
anomaly_detection |
| Ranking | ranking_models/ |
ranking |
| Image, audio, video | image_classification/, audio_classification/, video_classification/ |
labels.csv |
Some generators produce train/test splits; others produce one dataset file when the corresponding service expects unsupervised, graph, ranking, or recommendation style inputs.
Network-analysis fixtures now mirror the /network-analysis upload form:
network_upload_combined.*is the default edge-list fixture and can be uploaded directly. It containssource,target,node_id,node_label,phase, and numeric node-feature columns in one table.network_adjacency_matrix.*exercises adjacency-matrix mode withnode_id,node_label, optionalphase, node features, and one adjacency column per node.graph_nodes_reference.*andgraph_edges_reference.*are reference tables for inspection or custom joins. They are not standalone supervised training uploads because the live form accepts one uploaded tabular file.
Shared Feature And Target Logic
The generator builds mixed feature tables using helpers in
hypothetical_data_generator/utils/features.py:
- continuous features from normal distributions
- ordinal features with ordered integer levels
- categorical features with small symbolic categories
- count features from Poisson draws
- latent risk scores that combine numeric, categorical, time, and group effects
- missing values, mild numeric outliers, and rare
Unknowncategorical values
Binary targets are intentionally imbalanced. The helper
assign_binary_target(...) selects a positive prevalence inside a configured
range, currently 5-10% for the main binary classification-style datasets. It
uses a noisy latent risk score and then swaps a small number of boundary labels
to avoid a perfectly separable rule.
Multiclass targets are intentionally uneven rather than uniform. The default three-class distribution is approximately 52%, 31%, and 17%, with boundary swaps to introduce overlap between neighboring risk bands.
Regression and count-regression targets include nonlinear signal and noise:
- ordinary regression adds heteroskedastic noise and sinusoidal risk effects
- count regression uses negative-binomial or Poisson-like rates with extra zeros
- longitudinal and time-series regression include subject/series effects and seasonal or time-varying components
Longitudinal And Time-Series Structure
Longitudinal datasets include:
subject_idtime- repeated rows per subject
- subject-aware train/test splitting
- optional count outcomes
The split helper attempts to preserve binary positive-class prevalence across train and test subjects when a binary target is present.
Time-series datasets include:
series_idtime- repeated observations per series
- single-series and multiple-series variants
- per-series future-tail train/test splitting
- optional classification, regression, and count-regression targets
The time-series branch now uses domain-shaped demonstration data rather than generic feature names:
- time-series regression fixtures include separate stock-market and forex
datasets with columns such as
symbol,asset_type,open_price,trade_volume,sentiment_score, and a continuoustargetclose/exchange value. Stock and forex instruments are intentionally not mixed inside one training file because their target scales are different. - time-series count-regression fixtures model monthly insurance claim counts
across claim lines such as health, vehicle, life, property, and travel. They
include columns such as
claim_line,policy_segment,active_policies,risk_event_index,loss_severity_index,claims_backlog_index, and a non-negative integertarget - time-series classification fixtures model weather outcomes across stations
with columns such as
station,region,avg_temp_c,rainfall_mm,wind_speed_kph, and class labels such asNormal Weather,Severe Weather,Clear,Rain, andStorm
Single-series variants contain one instrument, claim line, or weather station. Multiple-series variants contain a small panel of a few instruments, claim lines, or stations. The split keeps every series in both train and test, with each test file representing the future tail for that same known series. This design makes the datasets useful for checking whether workflows preserve temporal order, detect grouped series correctly, and forecast known future periods without collapsing multiple series into one line.
Survival Structure
Survival datasets include:
subject_idevent_timeevent_observedevent_type- mixed feature columns
The event indicator is generated from a rare positive target process, and event time is tied to latent risk so higher-risk subjects tend to have earlier events. The competing-risks mode assigns nonzero event types among observed events using uneven risk weights.
Ranking, Recommendation, Graph, Clustering, And Anomaly Structure
Ranking data uses query/document groups with graded relevance labels. The relevance labels are tied to a noisy latent score, with small swaps to avoid a perfect ranking rule.
Clustering data uses blob-style structure plus mixed feature columns and
feature-level missingness. The cluster column is a generated reference label
for validation and inspection; clustering workflows should still be treated as
unsupervised when selecting features.
Recommendation, graph/network, anomaly, and text datasets are generated by their
respective modules under hypothetical_data_generator/generators/. They are
intended to exercise file contracts and workflow behavior, not to represent a
production benchmark.
Media workflows are intentionally not exported as statistical tables. Their
folders contain a labels.csv contract fixture and a manifest describing the
accepted media extensions. Use real image, audio, or video files when testing
end-to-end media training.
Realism Guardrails
The generated data is deliberately less ideal than textbook examples:
- binary outcomes are rare rather than balanced
- multiclass targets are uneven
- labels are noisy and not perfectly separable
- numeric outliers are present
- missing values vary by column
- categorical columns may contain rare
Unknownvalues - grouped data preserves subject/series identity
- count outcomes may include extra zeros
These choices make the datasets better at exposing brittle preprocessing, readiness, metric, confidence-interval, and plotting behavior.
Reproducibility And Change Control
Most generator functions accept random_state, and the default pipeline uses a
stable seed. If generator logic changes, reviewers should record:
- which generator files changed
- which datasets were regenerated
- the command used to regenerate them
- which export formats were requested and which were skipped in the manifests
- whether class balance, train/test splits, and required columns still match the target service workflows
- whether any tests or saved fixtures depend on previous generated values
Because generated datasets can be large and are not product source code, avoid committing regenerated dataset files unless a specific test fixture or documentation change requires them. Prefer committing generator code and manifests only when they are part of a small, intentional fixture.
Validation Checklist
After changing the generator, verify the affected dataset family:
- required role columns exist for the target service
- train/test files, when produced, have compatible schemas
- binary positive-class prevalence remains inside the intended range
- multiclass distributions are uneven but non-empty
- grouped splits do not mix held-out subjects or series into training
- missingness and
Unknownvalues are limited to feature columns - count targets are nonnegative and include realistic dispersion
- survival event columns are internally consistent
- ranking groups contain multiple documents and graded relevance labels
- generated files remain safe to use as public tests because they contain no real user data
- each structured service folder accounts for every extension in the shared tabular upload reader, either as written or explicitly skipped
- media service folders stay manifest-based and do not pretend to be tabular statistical datasets
Source: docs/book/appendices/model-selection-and-fallback-rules.md
Model Selection And Fallback Rules
This appendix explains an important product truth: a completed workflow is not just "the best model won." In practice, the platform may filter models before training, skip models during training, settle on a winner using service-specific metrics, and use fallbacks for explainability, reporting, or degraded runtime conditions.
Why This Appendix Exists
Users and reviewers often want to know:
- Why did this model win?
- Why was a different model used for SHAP?
- Why did one workflow show a result even though some artifacts were missing?
- What should count as an acceptable fallback versus a warning sign?
This appendix answers those questions at a product level.
The Four Selection Layers
The platform effectively makes decisions at four layers:
- model availability and preflight filtering
- successful-versus-failed training execution
- best-model selection among the successful candidates
- downstream fallback choice for explainability, reporting, or recovery
Those layers should not be confused with each other.
Layer 1: Preflight Availability
Some requested models may never enter the real training race because:
- optional dependencies are unavailable
- the runtime does not support the selected backend
- the service has stricter access checks for that family
- the input does not satisfy the model's contract
A healthy workflow should distinguish:
- requested and trained
- requested but preflight-unavailable
- requested but failed during fit
If the system hides that distinction, the user cannot tell whether the candidate pool was truly broad or already narrowed before training started.
Layer 2: Successful Training Output
Only successfully trained models should enter the final best-model comparison.
Important consequence:
- a model can be theoretically supported yet still be irrelevant to the final race if it failed during fit
- a completed job can still contain a narrower actual candidate pool than the user expected
For auditability, the visible result should make failed and skipped candidates explicit.
Layer 3: Best-Model Selection
The winner should be selected using the service-appropriate comparison metric, not a vague or shifting notion of "best."
Examples of healthy selection logic:
- classification winners should be chosen with attention to the configured classification metric and threshold behavior
- regression winners should be chosen on regression loss or fit metrics, not downstream visual appeal
- anomaly detection winners may use a composite score rather than one metric alone
- recommendation and ranking families should use their own ranking-aware evaluation logic
Questions a reviewer should ask:
- Which metric actually determined the winner?
- Was that metric the right one for the business or research question?
- Were runner-ups meaningfully close?
- Did a pathological threshold or degenerate probability pattern distort the result?
Near-Tie And Pathology Rule
When two models are very close, pure metric ordering may not be enough. A stronger product rule is:
- prefer the more stable, interpretable, or deployable model when performance differences are negligible
- avoid declaring a brittle winner when its threshold behavior or output distribution is obviously pathological
This matters because a "win" that cannot be interpreted, explained, or reproduced cleanly may be less useful than a slightly weaker but healthier model.
Layer 4: Explainability Fallback
The best model and the SHAP model do not always have to be the same thing.
A healthy SHAP fallback happens when:
- the winning model is not directly SHAP-friendly
- a strong tree or other explainable surrogate from the same run exists
- the UI clearly explains which model powered the explanation
An unhealthy SHAP fallback happens when:
- the fallback model is weak or unrelated
- the UI implies the winning model itself was explained
- the SHAP output exists only on disk and is not durably registered
The rule should be:
- keep the true training winner visible as the winner
- keep the SHAP generator visible as the explainer model when it differs
- do not collapse those roles into one misleading label
Reporting Fallback
AI reporting can also use fallback behavior. That can be acceptable, but only under strict conditions.
Healthy report fallback:
- uses the real saved job payload
- reflects what artifacts actually exist
- discloses quality or evidence limits when needed
- preserves resolved references and validation warnings
Unhealthy report fallback:
- invents generic context because structured job context is missing
- silently substitutes a templated report without telling the reviewer
- cites references unrelated to the actual study domain
The core rule is simple:
- fallback may degrade style or richness
- fallback must not degrade truthfulness
Artifact Fallback And Recovery
There is also a difference between:
- a genuine recovered artifact
- a normal artifact found on disk after the fact
Recovered should mean:
- the output was previously stale or interrupted
- the system promoted it through a repair or recovery path
Recovered should not mean:
- the artifact simply existed and was read back normally
That distinction matters because the wording changes how much trust the user places in the output.
Billing Is Not The Same As Model Selection
Selection logic and billing logic intersect, but they are not the same process.
Important separation:
- training may reserve based on intended candidate count
- settlement may use actual successful model count
- SHAP and report add-ons may succeed functionally yet still refund or settle differently depending on evidence and usage
So a winning model does not by itself explain the final charge.
Reviewer Checklist For Selection And Fallback
- Identify the actual comparison metric that selected the winner.
- Confirm that only successful models entered the final race.
- Check whether runner-ups were materially close.
- Check whether the explanation model differs from the winning model.
- Check whether fallback artifacts are labeled as fallback or recovery honestly.
- Check whether the report was generated from the real saved context.
- Check whether billing lines describe reserve, settle, and refund math clearly.
Healthy Language Versus Risky Language
Healthy wording:
- best model selected by the configured comparison metric
- SHAP generated from a fallback explainer model
- report regenerated from saved job context
- completed with partial recovery
Risky wording:
- best overall model without saying by what metric
- SHAP for the winning model when it actually used a fallback surrogate
- recovered when no recovery occurred
- billing recorded when the ledger is still empty or placeholder-only
Practical Principle
The platform should prefer honest multi-step truth over one oversimplified headline.
A stronger user-facing explanation is:
- this model won training
- this other model powered SHAP
- this report was regenerated from the saved artifact set
- this billing line shows reservation, settlement, and net charge separately
That is more trustworthy than pretending all workflow layers collapse into one neat label.
Deep References
Source: docs/book/appendices/source-document-map.md
Source Document Map
This appendix is a reader-friendly map to the authoritative handbook sections. It deliberately avoids exposing repository filenames in the published book. Exact source locations remain available to maintainers in the repository and developer appendix.
Maintenance Rule
When the handbook structure changes, update this map and the Quarto chapter list. Repository source paths belong in maintainer documentation, not in the published reader experience.
Source: docs/book/appendices/per-model-mathematical-appendix.md
Per-Model Mathematical Appendix
This appendix introduces the book-native model mathematics reference.
Purpose
The service-family appendices that follow summarize each visible model family at the level needed for publication and review. Each family appendix includes:
- algebraic formulation
- optimization objective
- core assumptions
- interpretation guidance
- workflow role
- material runtime or availability caveats
The goal is for readers to understand what each model is trying to optimize and how its outputs should be interpreted without needing to inspect implementation files.
Coverage Rule
Every service-visible model identifier should map to one of the mathematical entries in the appendices. When several identifiers share the same mathematical family, the appendix states the shared objective and then explains the identifier-level distinction.
If a model is planned, constrained, or exposed only as a compatibility branch, the appendix should say so explicitly and distinguish that status from active fitted models.
Coverage Status
| Family | Status In Book Appendix | Source Of Truth Today |
|---|---|---|
| Cross-sectional | Book-native lookup and objectives available | service documentation and service catalog |
| Longitudinal | Book-native lookup and objectives available | service documentation and service catalog |
| Time series | Book-native lookup and objectives available | service documentation and service catalog |
| Text | Book-native lookup and objectives available | service documentation and service catalog |
| Media | Book-native lookup and objectives available | service documentation and service catalog |
| Survival | Book-native lookup and objectives available | service documentation and service catalog |
| Specialized | Book-native lookup and objectives available | service documentation and service catalog |
| Advanced systems | Book-native lookup and objectives available | service documentation and service catalog |
What "Fully Migrated" Means
For each model, the target book entry should contain:
- canonical identifier
- service mapping
- theoretical or algebraic formulation
- optimization objective
- training/inference interpretation
- material caveats when they affect availability or interpretation
Why This Matters
Model names can be deceptively similar across services. A publishable handbook should therefore make the mathematical family, objective function, and service context visible in the book itself.
How To Use The Appendices
Use the family appendices when you need to answer questions such as:
- What does this model optimize?
- Is this model predictive, descriptive, structural, or diagnostic?
- Which assumptions matter most?
- Which metrics should be used to evaluate it?
- Is this identifier a distinct mathematical model or a service-specific implementation of a shared family?
The appendices should be read together with the Service Reference and Metrics and Validation chapters.
Source: docs/book/appendices/per-model-cross-sectional-mathematics.md
Per-Model Mathematics: Cross-Sectional Family
This appendix documents the cross-sectional model family in book form. It covers the core mathematical forms for cross-sectional row-wise models used across tabular classification, regression, and count workflows.
Scope
This chapter now covers the full documented cross-sectional model inventory at the level of mathematical family, optimization objective, and canonical workflow role.
The coverage includes:
- linear and generalized linear models
- tree and ensemble models
- boosting families
- probabilistic classifiers
- nearest-neighbor and margin-based models
- neural tabular models
This appendix is the book-level reference for the complete documented cross-sectional family rather than only a starter subset.
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
logistic_regression |
classification | covered |
linear_regression |
regression | covered |
ridge_regression |
regression | covered |
lasso_regression |
regression | covered |
elastic_net_regression |
regression | covered |
poisson_regressor |
count regression | covered |
negative_binomial |
count regression | covered |
decision_tree |
classification/regression/count variants | covered as family form |
random_forest |
classification | covered |
random_forest_regression |
regression | covered via family form |
random_forest_count |
count regression | covered via family form |
xgboost |
classification | covered |
xgboost_regression |
regression | covered via family form |
xgboost_count |
count regression | covered via family form |
lightgbm |
classification | covered |
lightgbm_regression |
regression | covered via family form |
lightgbm_count |
count regression | covered via family form |
catboost |
classification | covered |
catboost_regression |
regression | covered via family form |
catboost_poisson |
count regression | covered via family form |
svm |
classification | covered |
svm_regression |
regression | covered |
svm_count |
count regression | covered via family form |
knn |
classification | covered |
knn_regression |
regression | covered |
knn_count |
count regression | covered via family form |
gaussian_nb |
classification | covered |
multinomial_nb |
classification | covered |
mlp |
classification | covered |
mlp_regression |
regression | covered via family form |
mlp_count |
count regression | covered via family form |
keras_mlp |
classification | covered |
keras_mlp_regression |
regression | covered via family form |
keras_mlp_count |
count regression | covered via family form |
keras_cnn |
classification | covered |
keras_cnn_regression |
regression | covered via family form |
keras_cnn_count |
count regression | covered via family form |
keras_rnn_count |
count regression | covered via family form |
gradient_boosting |
classification | covered |
gradient_boosting_regression |
regression | covered via family form |
gradient_boosting_count |
count regression | covered via family form |
extra_trees |
classification | covered |
extra_trees_regression |
regression | covered via family form |
extra_trees_count |
count regression | covered via family form |
ada_boost |
classification | covered |
ada_boost_regression |
regression | covered via family form |
ada_boost_count |
count regression | covered via family form |
decision_tree_regression |
regression | covered via family form |
decision_tree_count |
count regression | covered via family form |
zero_inflated_poisson |
count regression | covered |
hurdle_model |
count regression | covered |
glm_log_link |
count regression | covered |
gam_poisson |
count regression | covered |
Common Notation
- $x_i \in \mathbb{R}^p$: processed feature vector for observation $i$
- $y_i$: target value, class label, or count
- $\hat{y}_i$: model prediction
- $f(x)$: fitted prediction function
- $L(\theta)$: loss or objective
- $\theta$: model parameters
Workflow Context
Cross-sectional services use one row per unit of analysis. Classification models estimate class membership or class probability, regression models estimate a continuous target, and count-regression models estimate non-negative event counts. The same family name may therefore appear in more than one workflow while using a task-specific loss.
Objective Lookup By Model Identifier
Some runtime model IDs share the same mathematical objective because they are task variants of the same estimator family. Use this lookup to map an individual service-visible model ID to the objective section below.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
logistic_regression |
penalized logistic / softmax cross-entropy | Linear And Generalized Linear Models |
linear_regression |
ordinary least-squares error | Linear And Generalized Linear Models |
ridge_regression |
least-squares plus L2 penalty | Linear And Generalized Linear Models |
lasso_regression |
least-squares plus L1 penalty | Linear And Generalized Linear Models |
elastic_net_regression |
least-squares plus mixed L1/L2 penalty | Linear And Generalized Linear Models |
poisson_regressor, glm_log_link, gam_poisson |
Poisson log-link negative log-likelihood | Linear And Generalized Linear Models |
negative_binomial |
overdispersed count likelihood | Linear And Generalized Linear Models |
zero_inflated_poisson |
mixture count likelihood with structural-zero component | Linear And Generalized Linear Models |
hurdle_model |
two-part zero hurdle plus positive-count likelihood | Linear And Generalized Linear Models |
decision_tree, decision_tree_regression, decision_tree_count |
greedy impurity or prediction-loss reduction | Tree And Ensemble Models |
random_forest, random_forest_regression, random_forest_count |
bagged tree aggregation over impurity/loss splits | Tree And Ensemble Models |
extra_trees, extra_trees_regression, extra_trees_count |
randomized tree aggregation over impurity/loss splits | Tree And Ensemble Models |
gradient_boosting, gradient_boosting_regression, gradient_boosting_count |
additive stagewise loss minimization | Tree And Ensemble Models |
ada_boost, ada_boost_regression, ada_boost_count |
weighted additive boosting loss | Tree And Ensemble Models |
xgboost, xgboost_regression, xgboost_count |
regularized gradient-boosted tree objective | Tree And Ensemble Models |
lightgbm, lightgbm_regression, lightgbm_count |
gradient-boosted tree objective with histogram/leaf-wise optimization | Tree And Ensemble Models |
catboost, catboost_regression, catboost_poisson |
ordered boosting objective with task-specific loss | Tree And Ensemble Models |
svm, svm_regression, svm_count |
margin or epsilon-insensitive loss | Nearest-Neighbor And Margin Models |
knn, knn_regression, knn_count |
distance-weighted neighborhood rule without fitted global loss | Nearest-Neighbor And Margin Models |
gaussian_nb, multinomial_nb |
Naive Bayes likelihood under family-specific feature assumptions | Probabilistic Classifiers |
mlp, mlp_regression, mlp_count, keras_mlp, keras_mlp_regression, keras_mlp_count, keras_cnn, keras_cnn_regression, keras_cnn_count, keras_rnn_count |
neural supervised loss by task | Neural Tabular Models |
Linear And Generalized Linear Models
logistic_regression
Service:
tabular_classification
Algebraic formulation:
$$ P(Y_i = 1 \mid x_i) = \sigma(w^\top x_i + b) $$
where:
$$ \sigma(z)=\frac{1}{1+e^{-z}} $$
For multiclass settings, the model generalizes to a softmax form:
$$ P(Y_i = k \mid x_i)=\frac{\exp(w_k^\top x_i+b_k)}{\sum_j \exp(w_j^\top x_i+b_j)} $$
Optimization objective:
$$ \min_{w,b}\;-\sum_i \alpha_i\left[y_i\log p_i + (1-y_i)\log(1-p_i)\right] + \lambda \lVert w \rVert_2^2 $$
Interpretation: This is the canonical logistic classification baseline for tabular classification. It is useful when calibrated class probabilities and coefficient-style interpretation matter.
linear_regression
Service:
tabular_regression
Algebraic formulation:
$$ \hat{y}_i = \beta_0 + x_i^\top \beta $$
Optimization objective:
$$ \min_{\beta_0,\beta}\sum_{i=1}^{n}(y_i-\beta_0-x_i^\top \beta)^2 $$
Interpretation: This is ordinary least squares over the processed tabular feature matrix.
ridge_regression
Service:
tabular_regression
Algebraic formulation:
$$ \hat{y}_i = \beta_0 + x_i^\top \beta $$
Optimization objective:
$$ \min_{\beta_0,\beta}\sum_{i=1}^{n}(y_i-\beta_0-x_i^\top \beta)^2 + \lambda \lVert \beta \rVert_2^2 $$
Interpretation: Ridge adds an L2 penalty that shrinks coefficients without forcing most to exactly zero.
lasso_regression
Service:
tabular_regression
Algebraic formulation:
$$ \hat{y}_i = \beta_0 + x_i^\top \beta $$
Optimization objective:
$$ \min_{\beta_0,\beta}\sum_{i=1}^{n}(y_i-\beta_0-x_i^\top \beta)^2 + \lambda \lVert \beta \rVert_1 $$
Interpretation: Lasso encourages sparse solutions and can zero out coefficients entirely.
elastic_net_regression
Service:
tabular_regression
Algebraic formulation:
$$ \hat{y}_i = \beta_0 + x_i^\top \beta $$
Optimization objective:
$$ \min_{\beta_0,\beta}\sum_{i=1}^{n}(y_i-\beta_0-x_i^\top \beta)^2 + \lambda_1 \lVert \beta \rVert_1 + \lambda_2 \lVert \beta \rVert_2^2 $$
Interpretation: Elastic net combines lasso sparsity with ridge-style shrinkage.
poisson_regressor
Service:
tabular_count_regression
Algebraic formulation:
$$ \mu_i = \exp(\beta_0 + x_i^\top \beta) $$
with:
$$ Y_i \sim \operatorname{Poisson}(\mu_i) $$
Optimization objective:
The Poisson model maximizes the log-likelihood, or equivalently minimizes the negative log-likelihood:
$$ \min_{\beta_0,\beta}\sum_i \left(\mu_i - y_i \log \mu_i\right) $$
up to constants not involving the parameters.
Interpretation: This is the canonical GLM for count outcomes when the mean and variance are approximately aligned under Poisson assumptions.
negative_binomial
Service:
tabular_count_regression
Algebraic formulation:
$$ \mu_i = \exp(\beta_0 + x_i^\top \beta) $$
with variance:
$$ \operatorname{Var}(Y_i \mid x_i)=\mu_i + \alpha \mu_i^2 $$
Optimization objective:
Negative binomial regression maximizes the negative-binomial log-likelihood under the chosen parameterization of mean and dispersion.
Interpretation: This is the over-dispersion-aware alternative to Poisson count regression and is often more appropriate when count variance materially exceeds the mean.
zero_inflated_poisson
Service:
tabular_count_regression
Algebraic formulation:
Zero-inflated Poisson models combine a structural-zero process with an ordinary Poisson count process:
$$ P(Y_i=0)=\pi_i + (1-\pi_i)e^{-\lambda_i} $$
$$ P(Y_i=y)= (1-\pi_i)\frac{e^{-\lambda_i}\lambda_i^y}{y!}, \quad y>0 $$
where:
$$ \lambda_i = \exp(x_i^\top \beta), \qquad \pi_i = \sigma(z_i^\top \gamma) $$
Optimization objective:
The model maximizes the joint zero-inflated likelihood over both the count-process parameters and the inflation-process parameters.
Interpretation: This is the count model family for datasets with more zeros than a standard Poisson process can explain.
hurdle_model
Service:
tabular_count_regression
Algebraic formulation:
Hurdle models separate the zero/nonzero decision from the positive-count process:
$$ P(Y_i = 0)=1-\pi_i $$
$$ P(Y_i = y \mid y>0)=\frac{f(y;\theta_i)}{1-f(0;\theta_i)}, \quad y>0 $$
with:
$$ \pi_i = \sigma(z_i^\top \gamma) $$
Optimization objective:
The hurdle formulation maximizes a two-part likelihood: one part for crossing the zero hurdle and one part for the positive counts.
Interpretation: Unlike zero-inflated models, hurdle models assume all zeros come from the hurdle process and all positive counts come from the truncated count model.
glm_log_link
Service:
tabular_count_regression
Algebraic formulation:
The generalized linear count model with log link uses:
$$ g(\mu_i)=\log(\mu_i)=x_i^\top \beta $$
so that:
$$ \mu_i=\exp(x_i^\top\beta) $$
Optimization objective:
The exact likelihood depends on the chosen GLM family, but the defining feature is the log-link mapping from linear predictor to positive mean.
Interpretation: This entry is the flexible GLM-style count baseline where the link function is part of the main model identity.
gam_poisson
Service:
tabular_count_regression
Algebraic formulation:
A Poisson generalized additive model replaces the purely linear predictor with smooth component functions:
$$ \log(\mu_i)=\beta_0 + \sum_{j=1}^{p} f_j(x_{ij}) $$
Optimization objective:
GAM fitting typically maximizes the penalized Poisson log-likelihood:
$$ \max \ell(\theta) - \sum_j \lambda_j J(f_j) $$
where $J(f_j)$ is a smoothness penalty for each component function.
Interpretation:
gam_poisson is the smooth nonlinear count-regression alternative to a strictly linear Poisson GLM.
Tree And Ensemble Models
decision_tree
Service:
tabular_classification, tabular_regression, tabular_count_regression
Algebraic formulation:
Decision trees partition the feature space into regions $R_m$ and predict:
$$ \hat{f}(x)=\sum_{m=1}^{M} c_m I(x \in R_m) $$
Optimization objective:
Trees greedily choose splits to reduce impurity or prediction loss. Typical objectives include:
- Gini impurity or entropy for classification
- squared error for regression
- count-regression variants using regression-style tree loss on count targets
Interpretation: The same tree family underlies classification, regression, and count-like regression entries, with different split criteria and output interpretation.
random_forest
Service:
tabular_classification
Algebraic formulation:
For classification:
$$ \hat{y}(x)=\operatorname{mode}{T_b(x)}_{b=1}^{B} $$
For regression and count variants:
$$ \hat{f}(x)=\frac{1}{B}\sum_{b=1}^{B}T_b(x) $$
Optimization objective:
Each tree is fit on a bootstrap sample with random feature subsampling, and the forest aggregates across those fitted trees rather than solving one single global convex objective.
Interpretation:
This family covers random_forest, random_forest_regression, and random_forest_count with different output types but the same bagged-tree mathematics.
xgboost
Service: classification, regression, and count variants
Algebraic formulation:
XGBoost builds an additive tree ensemble:
$$ \hat{y}i = F_M(x_i)=\sum^{M} f_m(x_i), \quad f_m \in \mathcal{F} $$
Optimization objective:
$$ \min \sum_i \ell(y_i,\hat{y}i) + \sum^{M}\Omega(f_m) $$
with one common regularizer:
$$ \Omega(f)=\gamma T + \frac{1}{2}\lambda \sum_{j=1}^{T} w_j^2 $$
where $T$ is the number of leaves and $w_j$ are leaf weights.
Interpretation: The classification, regression, and count entries differ mainly in the chosen loss $\ell$, while the boosting structure remains the same.
lightgbm
Service: classification, regression, and count variants
Algebraic formulation:
LightGBM also learns an additive ensemble:
$$ \hat{y}i = \sum^{M} f_m(x_i) $$
Optimization objective:
$$ \min \sum_i \ell(y_i,\hat{y}i) + \sum^{M}\Omega(f_m) $$
Interpretation: Mathematically, LightGBM remains gradient boosting over trees, but its implementation emphasizes histogram-based split finding and leaf-wise growth for efficiency.
catboost
Service: classification, regression, and count variants
Algebraic formulation:
CatBoost also fits an additive boosted ensemble:
$$ \hat{y}i = \sum^{M} f_m(x_i) $$
Optimization objective:
$$ \min \sum_i \ell(y_i,\hat{y}i) + \sum^{M}\Omega(f_m) $$
Interpretation: Its distinguishing feature is not a different high-level optimization family, but the use of ordered boosting and category-handling strategies that are especially valuable for tabular data with categorical features.
gradient_boosting
Service: classification, regression, and count-like regression variants
Algebraic formulation:
Gradient boosting fits an additive model:
$$ F_M(x)=\sum_{m=1}^{M}\nu h_m(x) $$
where each new weak learner $h_m$ is trained to improve the current ensemble.
Optimization objective:
For differentiable loss functions, the new learner is fit to pseudo-residuals:
$$ r_{im}=-\left[\frac{\partial L(y_i,F(x_i))}{\partial F(x_i)}\right]{F=F} $$
Interpretation:
This family covers gradient_boosting for classification, gradient_boosting_regression, and the count-regression use of GradientBoostingRegressor as a flexible nonlinear baseline.
extra_trees
Service: classification, regression, and count-like regression variants
Algebraic formulation:
Extra Trees use an ensemble aggregation similar to random forests:
$$ \hat{f}(x)=\frac{1}{B}\sum_{b=1}^{B}T_b(x) $$
or majority vote in classification.
Optimization objective:
The family differs from standard random forests by using more randomized split selection. It does not solve one global convex objective; instead it fits many randomized trees and aggregates them.
Interpretation:
This family covers extra_trees, extra_trees_regression, and extra_trees_count.
ada_boost
Service: classification and regression variants
Algebraic formulation:
AdaBoost builds a weighted additive ensemble:
$$ F_M(x)=\sum_{m=1}^{M}\alpha_m h_m(x) $$
Optimization objective:
For classification, AdaBoost can be viewed as minimizing an exponential loss:
$$ \min \sum_i \exp(-y_i F(x_i)) $$
Regression variants adapt the sequential reweighting idea to regression loss.
Interpretation:
This family covers ada_boost and ada_boost_regression as stagewise additive ensembles that emphasize observations that were harder for earlier weak learners.
Distance, Margin, And Probabilistic Models
svm
Service:
tabular_classification
Algebraic formulation:
For the soft-margin linear form:
$$ \min_{w,b,\xi}\frac{1}{2}\lVert w \rVert^2 + C\sum_i \xi_i $$
subject to:
$$ y_i(w^\top x_i + b)\ge 1-\xi_i,\quad \xi_i \ge 0 $$
Optimization objective:
The objective balances margin maximization against slack penalties for misclassification.
Interpretation: Kernelized forms replace the inner product with $K(x_i,x_j)$, but the same margin-maximization idea remains central.
svm_regression
Service:
tabular_regression
Algebraic formulation:
Support vector regression learns:
$$ \hat{y}_i = w^\top x_i + b $$
Optimization objective:
The $\epsilon$-insensitive formulation is:
$$ \min_{w,b,\xi,\xi^}\frac{1}{2}\lVert w \rVert^2 + C\sum_i(\xi_i+\xi_i^) $$
subject to:
$$ y_i - (w^\top x_i+b)\le \epsilon + \xi_i $$
$$ (w^\top x_i+b) - y_i \le \epsilon + \xi_i^* $$
Interpretation: SVR optimizes a margin-like objective for regression by ignoring small residuals inside the $\epsilon$ tube.
knn
Service: classification and regression variants
Algebraic formulation:
For classification:
$$ \hat{y}(x)=\operatorname{mode}{y_i : x_i \in N_k(x)} $$
For regression:
$$ \hat{f}(x)=\frac{1}{k}\sum_{x_i \in N_k(x)} y_i $$
Optimization objective:
KNN does not learn a global parametric objective during fitting. The main "optimization" is distance-based neighbor retrieval at inference time.
Interpretation:
This family covers knn and knn_regression.
gaussian_nb
Service:
tabular_classification
Algebraic formulation:
Naive Bayes applies:
$$ P(y \mid x_1,\ldots,x_p) \propto P(y)\prod_{j=1}^{p}P(x_j \mid y) $$
with Gaussian feature-conditionals:
$$ x_j \mid y=c \sim \mathcal{N}(\mu_{jc}, \sigma_{jc}^2) $$
Optimization objective:
Parameter estimation is by class-conditional mean/variance estimation and class-prior estimation, rather than iterative gradient optimization.
Interpretation: Gaussian NB is appropriate when continuous features are modeled as approximately Gaussian within class.
multinomial_nb
Service:
tabular_classification
Algebraic formulation:
The class posterior still follows Bayes' rule:
$$ P(y \mid x) \propto P(y)\prod_{j=1}^{p} P(x_j \mid y) $$
with multinomial/count-like feature assumptions for $x_j$.
Optimization objective:
The model estimates class priors and multinomial event probabilities, commonly with additive smoothing, rather than solving a gradient-based objective.
Interpretation: Multinomial NB is most natural for count-like, frequency-like, or non-negative feature representations.
Neural Tabular Models
mlp
Service: classification and regression variants
Algebraic formulation:
For a basic one-hidden-layer network:
$$ h = \phi(W_1x + b_1) $$
$$ \hat{y} = g(W_2h + b_2) $$
Optimization objective:
Classification typically minimizes cross-entropy:
$$ \min_\theta -\sum_i \sum_c y_{ic}\log \hat{p}_{ic} $$
Regression variants typically minimize squared error:
$$ \min_\theta \sum_i (y_i-\hat{y}_i)^2 $$
Interpretation:
This family covers mlp and mlp_regression, with the main change being the output layer and loss.
keras_mlp
Service: classification and regression variants
Algebraic formulation:
The mathematical form remains a feedforward multilayer perceptron:
$$ h^{(l)} = \phi(W^{(l)}h^{(l-1)} + b^{(l)}) $$
Optimization objective:
Keras/TensorFlow implementations optimize the task-specific loss, commonly cross-entropy for classification or mean-squared error for regression, using gradient-based optimizers such as Adam.
Interpretation:
The distinction from mlp is mainly the neural-network backend and configuration flexibility rather than a different mathematical family.
keras_cnn
Service: classification and regression variants
Algebraic formulation:
A one-dimensional convolution on reshaped tabular features can be written as:
$$ z_t = \phi\left(b + \sum_{k=0}^{K-1} w_k x_{t+k}\right) $$
followed by deeper feature maps and dense prediction layers.
Optimization objective:
The model minimizes a task-specific neural objective, typically:
- cross-entropy for classification
- squared error for regression
Interpretation: For tabular workflows, this is a learned local-pattern architecture imposed on reshaped feature vectors rather than a naturally spatial image model.
Cross-Sectional Family Status
This appendix covers the full documented cross-sectional inventory at the level of mathematical family, algebraic form, optimization objective, assumptions, and workflow role.
Source: docs/book/appendices/per-model-longitudinal-mathematics.md
Per-Model Mathematics: Longitudinal Family
This appendix documents the longitudinal model family in book form. Longitudinal services differ from cross-sectional services because subject identity, repeated measurements, and time ordering are part of the model contract.
Scope
This appendix covers the main longitudinal model families used for repeated-measure workflows:
- classical panel and repeated-measures models
- GPBoost-style grouped boosting models
- historical-tree and historical-boosting families
- mixed-effects tree ensembles
- REEM-style longitudinal tree families
- longitudinal random-forest baselines
- longitudinal Poisson count regression
The core mathematical and methodological forms are represented directly in the book so readers can compare repeated-measure models without reading internal engineering notes.
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
fixed_effects_logistic |
longitudinal classification | covered |
gee_logistic |
longitudinal classification | covered |
glmm_logistic |
longitudinal classification | covered |
lmm_linear |
longitudinal regression | covered |
gee_linear |
longitudinal regression | covered |
fixed_effects_linear |
longitudinal regression | covered |
gpboost_classifier |
longitudinal classification | covered |
gpboost_regressor |
longitudinal regression | covered |
gpboost_count_regressor |
longitudinal count regression | covered |
htb |
classification/regression/count variants | covered as family form |
hrf |
longitudinal regression | covered as family form |
hcb |
classification/regression/count variants | covered as family form |
mert |
longitudinal regression | covered |
merf |
longitudinal regression | covered |
mecb |
longitudinal regression | covered |
reem_tree |
longitudinal regression | covered |
reem_forest |
longitudinal regression | covered |
reem_catboost |
longitudinal regression | covered |
poisson_regressor |
longitudinal count regression | covered |
poisson_gee |
longitudinal count regression | covered |
nb_gee |
longitudinal count regression | covered |
poisson_glmm |
longitudinal count regression | covered |
Common Notation
- $i$: subject or panel unit
- $t$: time, visit, or repeated-measure index
- $x_{it}$: covariate vector for subject $i$ at time $t$
- $y_{it}$: target for subject $i$ at time $t$
- $b_i$: subject-specific random effect
- $H_{it}$: history available up to time $t$
Workflow Context
Longitudinal services preserve subject identity and repeated observations. The high-level rule is:
- classical models preserve subject-aware repeated-measure structure through fixed effects, GEE, or mixed-effects formulations
- GPBoost models combine grouped random effects with boosted-tree components
- historical models (
htb,hrf,hcb) emphasize ordered within-subject history - mixed-effects ensemble families (
mert,merf,mecb,reem_*) alternate or combine nonlinear prediction with subject-level random effects
Objective Lookup By Model Identifier
Some longitudinal IDs are task-specific wrappers around the same repeated-measure objective. This lookup maps each visible model ID to the objective section below.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
fixed_effects_logistic |
fixed-effects logistic likelihood | Classical Panel And Repeated-Measures Models |
gee_logistic |
generalized estimating equations with working correlation | Classical Panel And Repeated-Measures Models |
glmm_logistic |
mixed-effects logistic likelihood | Classical Panel And Repeated-Measures Models |
lmm_linear |
linear mixed-model likelihood / REML-style fit | Classical Panel And Repeated-Measures Models |
gee_linear |
Gaussian generalized estimating equations | Classical Panel And Repeated-Measures Models |
fixed_effects_linear |
within-subject fixed-effects least squares | Classical Panel And Repeated-Measures Models |
gpboost_classifier, gpboost_regressor, gpboost_count_regressor |
boosting loss plus grouped random-effects estimation | GPBoost-Style Models |
htb, hrf, hcb |
historical feature construction plus tree/forest/boosting objective | Historical Tree And Historical Boosting Families |
mert, merf, mecb |
nonlinear tree/ensemble prediction plus subject random effects | Mixed-Effects Tree Ensembles |
reem_tree, reem_forest, reem_catboost |
repeated random-effects update plus tree/forest/CatBoost fit | REEM Family |
poisson_regressor |
Poisson log-link likelihood over repeated count outcomes | Longitudinal Count GLM |
poisson_gee, nb_gee |
generalized estimating equations for correlated count outcomes | Longitudinal Count GEE And GLMM |
poisson_glmm |
Poisson mixed-model likelihood with subject random intercepts | Longitudinal Count GEE And GLMM |
Classical Panel And Repeated-Measures Models
fixed_effects_logistic
Service:
longitudinal_classification
Algebraic formulation:
$$ \Pr(Y_{it}=1 \mid x_{it}, \alpha_i)=\sigma(\alpha_i + x_{it}^\top \beta) $$
Optimization objective:
The model maximizes a logistic likelihood while controlling for subject-specific fixed effects $\alpha_i$.
Interpretation: This is the panel-logistic form that absorbs subject-level heterogeneity into fixed intercept shifts rather than random effects.
gee_logistic
Service:
longitudinal_classification
Algebraic formulation:
$$ \Pr(Y_{it}=1 \mid x_{it})=\sigma(x_{it}^\top \beta) $$
with correlation handled through a working covariance structure for repeated observations within subject.
Optimization objective:
Generalized estimating equations solve a quasi-score equation rather than maximizing a full likelihood under a detailed subject-level random-effects model.
Interpretation: GEE is population-averaged rather than subject-specific.
glmm_logistic
Service:
longitudinal_classification
Algebraic formulation:
$$ \Pr(Y_{it}=1 \mid x_{it}, b_i)=\sigma(x_{it}^\top \beta + z_{it}^\top b_i) $$
Optimization objective:
The generalized linear mixed model maximizes a marginal or approximated mixed-effects likelihood with random effects $b_i$.
Interpretation: This is the subject-specific logistic path among the classical longitudinal classifiers.
lmm_linear
Service:
longitudinal_regression
Algebraic formulation:
$$ y_{it}=x_{it}^\top \beta + z_{it}^\top b_i + \varepsilon_{it} $$
where:
$$ b_i \sim \mathcal{N}(0,D), \qquad \varepsilon_{it}\sim \mathcal{N}(0,\sigma^2) $$
Optimization objective:
The linear mixed model maximizes a mixed-effects Gaussian likelihood over fixed effects, random-effects covariance, and residual variance.
gee_linear
Service:
longitudinal_regression
Algebraic formulation:
$$ \mathbb{E}[Y_{it}\mid x_{it}] = x_{it}^\top \beta $$
with subject-level covariance handled through a working correlation structure.
Optimization objective:
GEE solves estimating equations for the mean model while using a robust covariance estimator for inference.
fixed_effects_linear
Service:
longitudinal_regression
Algebraic formulation:
$$ y_{it}=\alpha_i + x_{it}^\top \beta + \varepsilon_{it} $$
Optimization objective:
The fixed-effects model estimates within-subject effects after absorbing subject-specific intercepts $\alpha_i$.
Interpretation: This model is valuable when time-invariant subject heterogeneity is important and should not be modeled as an ordinary pooled intercept.
GPBoost-Style Models
gpboost_classifier, gpboost_regressor, gpboost_count_regressor
Services: classification, regression, and longitudinal count regression variants
Algebraic formulation:
These models combine boosted trees with grouped random effects:
$$ \eta_{it}=F(x_{it}) + z_{it}^\top b_i $$
where $F(\cdot)$ is the boosted-tree component and $b_i$ captures subject/group-specific effects.
Optimization objective:
The objective combines task-specific boosting loss with random-effects estimation over grouped structure.
Interpretation: This family is useful when both nonlinear predictor interactions and subject/group-level dependence matter.
Historical Tree And Historical Boosting Families
htb, hrf, hcb
Services: longitudinal classification, regression, and count-regression variants
Algebraic formulation:
These historical models can be summarized as learning a score from both current covariates and available history:
$$ \hat{y}{it}=f(x, H_{it}) $$
where $H_{it}$ encodes subject-specific longitudinal history up to time $t$.
Optimization objective:
The detailed optimization depends on the backend learner:
- boosting-style objective for
htb - forest-style aggregation for
hrf - CatBoost-backed historical optimization for
hcb
Interpretation: The defining feature is not only the learner type, but the explicit use of ordered subject history as a first-class input.
Mixed-Effects Tree Ensembles
mert, merf, mecb
Service:
Longitudinal family: longitudinal_regression, longitudinal_count_regression, and selected longitudinal_classification wrappers where the fitted backend exposes the required outcome interface.
Algebraic formulation:
These models blend nonlinear tree/ensemble prediction with mixed-effects structure. The Gaussian notation below is the canonical regression form; classification and count workflows use the same subject/random-effect idea with service-appropriate response links, losses, and probability/count outputs.
$$ y_{it}=f(x_{it}) + z_{it}^\top b_i + \varepsilon_{it} $$
Optimization objective:
The tree or ensemble component and the random-effects component are estimated iteratively or in alternating updates rather than through one closed-form global solution.
Interpretation:
mertpairs mixed-effects structure with a regression treemerfpairs it with a forestmecbpairs it with a CatBoost-style backend
REEM Family
reem_tree, reem_forest, reem_catboost
Service:
Longitudinal family: longitudinal_regression, longitudinal_count_regression, and selected longitudinal_classification wrappers where the fitted backend exposes the required outcome interface.
Algebraic formulation:
REEM-style models also follow the same mixed-effects decomposition in the regression case. In classification and count services, the implementation adapts the fixed-effect learner and output layer to the service-specific target while keeping the repeated random-effects update idea.
$$ y_{it}=f(x_{it}) + z_{it}^\top b_i + \varepsilon_{it} $$
Optimization objective:
The REEM idea iterates between fitting the tree/ensemble component and re-estimating random effects from residual structure.
Interpretation: The variants differ primarily in the nonlinear learner used for $f(\cdot)$:
- tree
- forest
- CatBoost-backed learner
Longitudinal Count GLM
poisson_regressor
Service:
longitudinal_count_regression
Algebraic formulation:
$$ \mu_{it}=\exp(\alpha_i + x_{it}^\top \beta) $$
with:
$$ Y_{it}\sim \operatorname{Poisson}(\mu_{it}) $$
Optimization objective:
The model maximizes the Poisson log-likelihood for repeated count outcomes while preserving subject identity in the workflow contract.
Interpretation: This is the count-regression baseline for repeated-measure event-frequency data.
Longitudinal Count GEE And GLMM
poisson_gee
Service:
longitudinal_count_regression
Algebraic formulation:
$$ E(Y_{it}\mid x_{it})=\mu_{it}, \quad \log(\mu_{it})=x_{it}^\top\beta $$
with a subject-level working correlation across repeated observations.
Optimization objective:
The model solves generalized estimating equations for a Poisson mean model while clustering observations by subject.
Interpretation: This is a marginal count model. It estimates population-average effects while allowing repeated observations from the same subject to be correlated.
nb_gee
Service:
longitudinal_count_regression
Algebraic formulation:
$$ E(Y_{it}\mid x_{it})=\mu_{it}, \quad Var(Y_{it}\mid x_{it})=\mu_{it}+\alpha\mu_{it}^2 $$
Optimization objective:
The model solves GEE with a negative-binomial variance function for overdispersed repeated count outcomes.
Interpretation: This is the marginal count option for panels where the variance is larger than the mean.
poisson_glmm
Service:
longitudinal_count_regression
Algebraic formulation:
$$ Y_{it}\mid b_i \sim \operatorname{Poisson}(\mu_{it}), \quad \log(\mu_{it})=x_{it}^\top\beta + b_i $$
with:
$$ b_i\sim N(0,\sigma_b^2) $$
Optimization objective:
The implementation fits a subject random-intercept Poisson mixed model. Predictions for new subjects use the fixed-effect population mean because no subject-specific random effect is available before observing that subject.
Interpretation: This is the subject-specific classical count option for repeated event totals.
Longitudinal Family Status
This appendix covers the documented longitudinal inventory at the level of mathematical family, algebraic form, optimization objective, assumptions, and workflow role.
Source: docs/book/appendices/per-model-time-series-mathematics.md
Per-Model Mathematics: Time-Series Family
This appendix documents the time-series model family in book form. Time-series services differ from both cross-sectional and longitudinal services because sequence order, horizon structure, lag behavior, and temporal validation discipline are central to the workflow contract.
Scope
This appendix covers the major time-series model families used for temporal classification, forecasting, and count forecasting:
- ROCKET and MiniROCKET families
- InceptionTime-style temporal convolution families
- recurrent models such as LSTM and GRU
- CNN-1D and CNN-LSTM hybrids
- transformer and TCN families
- classical forecasting families including ARIMA, AutoARIMA, exponential smoothing, VAR, GARCH, and Prophet
- count-forecasting adaptations of the same sequence and classical families
This appendix provides book-native mathematical coverage for the main time-series model families.
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
rocket |
time-series classification | covered |
minirocket |
time-series classification | covered |
inception_time |
time-series classification | covered |
lstm_classifier |
time-series classification | covered |
gru_classifier |
time-series classification | covered |
cnn_1d |
time-series classification | covered |
cnn_lstm |
time-series classification | covered |
transformer_ts |
time-series classification | covered |
tcn_classifier |
time-series classification | covered |
arima_regressor |
time-series regression | covered |
auto_arima_regressor |
time-series regression | covered |
exponential_smoothing_regressor |
time-series regression | covered |
var_regressor |
time-series regression | covered |
garch_regressor |
time-series regression | covered |
lstm_regressor |
time-series regression | covered |
prophet_regressor |
time-series regression | covered |
gru_regressor |
time-series regression | covered |
transformer_regressor |
time-series regression | covered |
tcn_regressor |
time-series regression | covered |
cnn_lstm_regressor |
time-series regression | covered |
cnn_1d_regressor |
time-series regression | covered |
inception_regressor |
time-series regression | covered |
rocket_regressor |
time-series regression | covered |
minirocket_regressor |
time-series regression | covered |
tcn_count |
time-series count regression | covered |
count_arima |
time-series count regression | covered |
count_auto_arima |
time-series count regression | covered |
count_exponential_smoothing |
time-series count regression | covered |
count_garch |
time-series count regression | covered |
count_inception |
time-series count regression | covered |
count_rocket |
time-series count regression | covered |
count_minirocket |
time-series count regression | covered |
count_var |
time-series count regression | covered |
count_prophet |
time-series count regression | covered |
lstm_count |
time-series count regression | covered |
gru_count |
time-series count regression | covered |
cnn_1d_count |
time-series count regression | covered |
cnn_lstm_count |
time-series count regression | covered |
transformer_count |
time-series count regression | covered |
Common Notation
- $x_{1:T}$: an input sequence over time steps $1,\ldots,T$
- $y_t$: target at time $t$
- $\hat{y}_{t+h}$: forecast or predicted output at horizon $h$
- $X_{\text{panel}} \in \mathbb{R}^{n \times c \times t}$: reconstructed panel tensor with samples, channels, and time positions
- $F(\cdot)$: fitted time-series prediction function
Workflow Context
Time-series services preserve sequence order, horizon discipline, and temporal validation. The high-level rule is:
- sequence-native models operate on panel/tensor-style temporal inputs or reconstructed lag panels
- classical forecasting models operate on ordered series, horizons, and family-specific statistical assumptions
- count-forecasting models adapt the same temporal families for non-negative count targets
Objective Lookup By Model Identifier
Several time-series IDs are classification, regression, or count variants of the same temporal family. This lookup maps each ID to the objective section below.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
rocket, rocket_regressor, count_rocket |
random convolutional transform plus task-specific linear loss | Kernel-Transform Time-Series Families |
minirocket, minirocket_regressor, count_minirocket |
deterministic convolutional transform plus task-specific linear loss | Kernel-Transform Time-Series Families |
inception_time, inception_regressor, count_inception |
temporal convolutional supervised loss | Deep Temporal Classification And Forecasting Families |
lstm_classifier, lstm_regressor, lstm_count |
recurrent sequence loss by task | Deep Temporal Classification And Forecasting Families |
gru_classifier, gru_regressor, gru_count |
gated recurrent sequence loss by task | Deep Temporal Classification And Forecasting Families |
cnn_1d, cnn_1d_regressor, cnn_1d_count |
one-dimensional convolutional supervised loss | Deep Temporal Classification And Forecasting Families |
cnn_lstm, cnn_lstm_regressor, cnn_lstm_count |
convolutional feature extraction plus recurrent supervised loss | Deep Temporal Classification And Forecasting Families |
transformer_ts, transformer_regressor, transformer_count |
attention-based temporal supervised loss | Deep Temporal Classification And Forecasting Families |
tcn_classifier, tcn_regressor, tcn_count |
dilated temporal-convolution supervised loss | Deep Temporal Classification And Forecasting Families |
arima_regressor, count_arima |
ARIMA likelihood / information-criterion fit | Classical Forecasting Families |
auto_arima_regressor, count_auto_arima |
ARIMA likelihood with model-order search | Classical Forecasting Families |
exponential_smoothing_regressor, count_exponential_smoothing |
exponential-smoothing likelihood or squared forecast error | Classical Forecasting Families |
var_regressor, count_var |
vector-autoregression least-squares likelihood | Classical Forecasting Families |
garch_regressor, count_garch |
conditional-variance likelihood | Classical Forecasting Families |
prophet_regressor, count_prophet |
decomposable trend/seasonality likelihood with priors | Classical Forecasting Families |
Kernel-Transform Time-Series Families
rocket, rocket_regressor, count_rocket
Algebraic formulation:
ROCKET-style methods transform a time series through a bank of convolutional kernels:
$$ \phi(x) = [\phi_1(x), \phi_2(x), \ldots, \phi_K(x)] $$
where each $\phi_k(x)$ is a summary induced by a fixed kernel over the sequence.
Optimization objective:
The transform itself is fixed/randomized; the downstream optimization depends on the packaged classifier/regressor head or fallback backend used by the runtime.
Interpretation: The key idea is random convolutional feature extraction followed by a simpler supervised learner on the transformed feature space.
minirocket, minirocket_regressor, count_minirocket
Algebraic formulation:
MiniROCKET is a streamlined ROCKET-family transform with a restricted but highly efficient kernel scheme:
$$ \phi_{\text{mini}}(x) = [\tilde{\phi}_1(x), \ldots, \tilde{\phi}_K(x)] $$
Optimization objective:
As with ROCKET, the learning problem is largely pushed into the downstream classifier/regressor over the transformed features.
Interpretation: The mathematics stays in the random-kernel-transform family, but the implementation emphasizes efficiency and compactness.
Deep Temporal Classification And Forecasting Families
inception_time, inception_regressor, count_inception
Algebraic formulation:
Inception-style temporal models learn parallel convolutional paths with different receptive fields:
$$ h_t = \operatorname{Concat}\left(f^{(1)}(x_{1:T}), f^{(2)}(x_{1:T}), \ldots, f^{(m)}(x_{1:T})\right) $$
Optimization objective:
The network minimizes task-specific loss such as:
- cross-entropy for classification
- squared or count-aware loss for regression/count forecasting
Interpretation: These models capture temporal patterns at multiple scales simultaneously.
lstm_classifier, lstm_regressor, lstm_count
Algebraic formulation:
An LSTM updates gated hidden and cell states:
$$ h_t, c_t = \operatorname{LSTM}(x_t, h_{t-1}, c_{t-1}) $$
Optimization objective:
The model minimizes sequence-task loss, commonly cross-entropy for classification or squared/count-adapted forecasting loss.
Interpretation: LSTM models are useful when long-range temporal dependencies matter.
gru_classifier, gru_regressor, gru_count
Algebraic formulation:
GRU updates can be summarized as:
$$ h_t = (1-z_t)\odot h_{t-1} + z_t \odot \tilde{h}_t $$
with update and reset gates controlling temporal memory.
Optimization objective:
The model minimizes task-specific sequence loss by gradient-based optimization.
Interpretation: GRU provides a lighter recurrent alternative to LSTM.
cnn_1d, cnn_1d_regressor, cnn_1d_count
Algebraic formulation:
Temporal one-dimensional convolution can be written as:
$$ z_t = \phi\left(b + \sum_{k=0}^{K-1} w_k x_{t+k}\right) $$
Optimization objective:
The network minimizes task-specific prediction loss after temporal convolutional feature extraction.
Interpretation: CNN-1D models emphasize local temporal pattern detection.
cnn_lstm, cnn_lstm_regressor, cnn_lstm_count
Algebraic formulation:
The CNN-LSTM family composes a temporal convolutional feature extractor with recurrent sequence modeling:
$$ h_{1:T} = \operatorname{LSTM}(\operatorname{CNN}(x_{1:T})) $$
Optimization objective:
The hybrid model minimizes task-specific sequence loss after both convolutional and recurrent processing.
Interpretation: This family mixes local temporal feature extraction with longer-range recurrent memory.
transformer_ts, transformer_regressor, transformer_count
Algebraic formulation:
Transformer-style temporal models use scaled dot-product attention:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V $$
Optimization objective:
The network minimizes task-specific loss after self-attention over temporal representations.
Interpretation: These models are designed to capture global temporal interactions without strictly sequential recurrence.
tcn_classifier, tcn_regressor, tcn_count
Algebraic formulation:
Temporal convolutional networks use causal and often dilated convolutions, which can be summarized as:
$$ z_t = \phi\left(\sum_{k=0}^{K-1} w_k x_{t-dk}\right) $$
where $d$ is a dilation factor.
Optimization objective:
The network minimizes task-specific sequence loss while preserving causal temporal structure.
Interpretation: TCNs offer long receptive fields without recurrent hidden-state updates.
Classical Forecasting Families
arima_regressor, count_arima
Algebraic formulation:
An ARIMA$(p,d,q)$ model on differenced series can be written as:
$$ \phi(B)(1-B)^d y_t = \theta(B)\varepsilon_t $$
where $B$ is the backshift operator.
Optimization objective:
ARIMA models typically estimate parameters by likelihood-based optimization over autoregressive and moving-average terms.
Interpretation: This is the core autoregressive forecasting baseline.
auto_arima_regressor, count_auto_arima
Algebraic formulation:
The fitted model remains ARIMA-family:
$$ \phi(B)(1-B)^d y_t = \theta(B)\varepsilon_t $$
Optimization objective:
AutoARIMA adds model-order selection over candidate $(p,d,q)$ specifications, usually guided by information criteria such as AIC or BIC.
Interpretation: The mathematical family is ARIMA; the distinguishing feature is automated order selection.
exponential_smoothing_regressor, count_exponential_smoothing
Algebraic formulation:
Exponential smoothing updates level/trend/seasonal components recursively, for example:
$$ \ell_t = \alpha y_t + (1-\alpha)\ell_{t-1} $$
with additional trend/seasonality updates depending on the specific ETS form.
Optimization objective:
Parameters are fit to minimize forecast error or maximize the implied state-space likelihood under the selected exponential-smoothing formulation.
Interpretation: This family emphasizes smooth recursive updating rather than explicit autoregressive lag polynomials.
var_regressor, count_var
Algebraic formulation:
For a multivariate series:
$$ y_t = c + A_1 y_{t-1} + \cdots + A_p y_{t-p} + \varepsilon_t $$
Optimization objective:
VAR estimation solves a multivariate autoregressive fitting problem, often via least-squares or likelihood-based estimation.
Interpretation: VAR is the classical multivariate temporal-dependence model.
garch_regressor, count_garch
Algebraic formulation:
GARCH models volatility through conditional variance updates such as:
$$ \sigma_t^2 = \omega + \alpha \varepsilon_{t-1}^2 + \beta \sigma_{t-1}^2 $$
Optimization objective:
Parameters are estimated by maximizing the likelihood of the residual/variance process under the chosen GARCH specification.
Interpretation: This family focuses on conditional heteroskedasticity rather than only mean forecasting.
prophet_regressor, count_prophet
Algebraic formulation:
Prophet-style models decompose the series into components:
$$ y(t)=g(t)+s(t)+h(t)+\varepsilon_t $$
where:
- $g(t)$ is trend
- $s(t)$ is seasonality
- $h(t)$ is holiday or event effect
Optimization objective:
The model estimates additive (or multiplicative) components under a regularized forecasting framework.
Interpretation: This family is useful when trend/seasonality decomposition is central to the forecasting task.
Time-Series Family Status
This appendix covers the documented time-series inventory at the level of mathematical family, algebraic form, optimization objective, assumptions, and workflow role.
Source: docs/book/appendices/per-model-text-mathematics.md
Per-Model Mathematics: Text Family
This appendix documents the text-service model family in book form. The text family is unusually consistent at the workflow level because the active inventory is dominated by transformer encoders fine-tuned for classification, but the underlying pretraining objectives, tokenization assumptions, and architectural constraints still matter for interpretation.
Scope
This appendix covers the active text-classification inventory:
- BERT-family encoders
- RoBERTa-family encoders
- XLM-R multilingual encoders
- DistilBERT compressed encoders
- MPNet permutation-aware encoders
- ELECTRA discriminator-family encoders
- ALBERT parameter-sharing encoders
- XLNet permutation-language-model encoders
- MobileBERT mobile-oriented encoders
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
distilbert-base-uncased |
text classification | covered |
roberta-base |
text classification | covered |
xlm-roberta-base |
text classification | covered |
bert-base-uncased |
text classification | covered |
microsoft/mpnet-base |
text classification | covered |
google/electra-base-discriminator |
text classification | covered |
albert-base-v2 |
text classification | covered |
xlnet-base-cased |
text classification | covered |
google/mobilebert-uncased |
text classification | covered |
roberta-large |
text classification | covered |
bert-large-uncased |
text classification | covered |
google/electra-small-discriminator |
text classification | covered |
Common Notation
- $x = (w_1, \ldots, w_T)$: an input token sequence
- $e_t$: token embedding at position $t$
- $h_t^{(\ell)}$: hidden state at layer $\ell$
- $h_{\mathrm{cls}}$: pooled sequence representation used by the classifier head
- $y \in {1, \ldots, K}$: class label
- $\hat{p}(y \mid x)$: predicted class distribution
Workflow Context
Text-classification services convert raw text into tokenized inputs, fine-tune a pretrained encoder, and evaluate supervised classification outputs. The high-level rule is:
- the service tokenizes raw text, batches encoded inputs, fine-tunes a pretrained encoder, and emits classification metrics and artifacts
- the mathematical differences across models come primarily from encoder architecture and pretraining objective, not from a different downstream classifier head
- the fine-tuning objective is generally supervised cross-entropy over the task labels
Objective Lookup By Model Identifier
All active text IDs use the shared downstream supervised classifier objective; their differences come from encoder architecture and pretraining objective.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
bert-base-uncased, bert-large-uncased |
masked-language-model encoder plus supervised cross-entropy fine-tuning | BERT-Derived Masked-Language-Model Encoders |
distilbert-base-uncased |
distilled transformer encoder plus supervised cross-entropy fine-tuning | BERT-Derived Masked-Language-Model Encoders |
albert-base-v2 |
parameter-sharing transformer encoder plus supervised cross-entropy fine-tuning | BERT-Derived Masked-Language-Model Encoders |
google/mobilebert-uncased |
mobile-optimized transformer encoder plus supervised cross-entropy fine-tuning | BERT-Derived Masked-Language-Model Encoders |
roberta-base, roberta-large |
RoBERTa encoder plus supervised cross-entropy fine-tuning | RoBERTa-Style Encoders |
xlm-roberta-base |
multilingual RoBERTa encoder plus supervised cross-entropy fine-tuning | RoBERTa-Style Encoders |
microsoft/mpnet-base |
permutation-aware MPNet encoder plus supervised cross-entropy fine-tuning | Alternative Pretraining Objectives |
google/electra-base-discriminator, google/electra-small-discriminator |
ELECTRA discriminator encoder plus supervised cross-entropy fine-tuning | Alternative Pretraining Objectives |
xlnet-base-cased |
permutation-language-model encoder plus supervised cross-entropy fine-tuning | Alternative Pretraining Objectives |
Shared Transformer Fine-Tuning Objective
For all active text models, the downstream classifier head can be summarized as:
$$ \hat{p}(y \mid x) = \operatorname{softmax}(W h_{\mathrm{cls}} + b) $$
with supervised objective:
$$ \mathcal{L}{\mathrm{cls}} = - \sum^{n} \sum_{k=1}^{K} \mathbf{1}(y_i = k)\log \hat{p}_{ik} $$
Interpretation: The book-level difference between text models is mostly about how $h_{\mathrm{cls}}$ is produced, what inductive bias the encoder learned during pretraining, and what runtime tradeoffs follow from model size and tokenizer family.
BERT-Derived Masked-Language-Model Encoders
bert-base-uncased, bert-large-uncased
Algebraic formulation:
BERT-family encoders build contextual states through stacked self-attention and feed-forward blocks:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V $$
with encoder updates:
$$ h^{(\ell+1)} = \operatorname{FFN}\left(\operatorname{MHSA}(h^{(\ell)})\right) $$
Optimization objective:
Pretraining is based on masked-language modeling plus next-sentence style supervision in the original BERT formulation; downstream fine-tuning uses supervised classification loss.
Interpretation: These models are the canonical bidirectional transformer baselines in the text service.
distilbert-base-uncased
Algebraic formulation:
DistilBERT keeps the same encoder family but compresses depth while preserving transformer hidden-state computation:
$$ h_{\mathrm{distil}}^{(\ell+1)} = \operatorname{TransformerBlock}(h_{\mathrm{distil}}^{(\ell)}) $$
Optimization objective:
The pretrained checkpoint is produced through distillation from a larger teacher model; task fine-tuning still uses classification cross-entropy.
Interpretation: This is the efficiency-oriented BERT-family branch, trading some representational depth for faster runtime and lighter memory use.
albert-base-v2
Algebraic formulation:
ALBERT remains a transformer encoder but factorizes embeddings and shares parameters across layers:
$$ E \approx E_1 E_2 $$
with repeated use of shared block parameters across depth.
Optimization objective:
The encoder inherits ALBERT-style pretraining and is fine-tuned with standard classification loss in the service.
Interpretation: The important mathematical distinction is parameter sharing and factorized embedding structure, not a different task head.
google/mobilebert-uncased
Algebraic formulation:
MobileBERT is still a transformer encoder, but it uses a bottlenecked mobile-friendly architecture:
$$ h^{(\ell+1)} = \operatorname{MobileTransformerBlock}(h^{(\ell)}) $$
Optimization objective:
The pretrained encoder is optimized for mobile-efficiency constraints; downstream training remains supervised classification fine-tuning.
Interpretation: This is the lightweight deployment-oriented transformer branch.
RoBERTa-Style Encoders
roberta-base, roberta-large
Algebraic formulation:
RoBERTa retains the same bidirectional self-attention encoder family as BERT:
$$ h^{(\ell+1)} = \operatorname{FFN}\left(\operatorname{MHSA}(h^{(\ell)})\right) $$
Optimization objective:
The distinction is in pretraining practice: dynamic masking and removal of next-sentence prediction from the original BERT recipe. Fine-tuning in the service still minimizes classification cross-entropy.
Interpretation:
RoBERTa models are BERT-like encoders with a stronger pretraining recipe and frequently stronger text-classification performance at the cost of larger runtime for the large checkpoint.
xlm-roberta-base
Algebraic formulation:
XLM-R keeps the RoBERTa-style bidirectional transformer encoder but over multilingual tokenization and multilingual corpora:
$$ h_{\mathrm{xlmr}} = \operatorname{TransformerEncoder}(x_{\mathrm{subword}}) $$
Optimization objective:
Pretraining follows multilingual masked-language modeling; downstream classification uses the same supervised head as the rest of the service.
Interpretation: The key difference is multilingual representation learning rather than a different classifier family.
Alternative Pretraining Objectives
microsoft/mpnet-base
Algebraic formulation:
MPNet combines masked-token prediction with permutation-aware dependency modeling in the encoder:
$$ h_{\mathrm{mpnet}} = \operatorname{PermutationAwareEncoder}(x) $$
Optimization objective:
The checkpoint is pretrained to capture masked and positional dependency structure more efficiently than vanilla MLM-only setups; fine-tuning again uses classification cross-entropy.
Interpretation: The important difference is the pretraining objective, which aims to improve contextual representations for downstream tasks.
google/electra-base-discriminator, google/electra-small-discriminator
Algebraic formulation:
ELECTRA-style encoders learn by replaced-token detection:
$$ \hat{p}(r_t = 1 \mid x) = \sigma(w^\top h_t + b) $$
where $r_t$ indicates whether token $t$ was replaced by a generator during pretraining.
Optimization objective:
Pretraining minimizes token-level replaced-token-detection loss rather than pure masked-token reconstruction. The discriminator encoder is then fine-tuned for supervised classification.
Interpretation: These models are interesting because their pretraining objective is discriminative rather than generative.
xlnet-base-cased
Algebraic formulation:
XLNet uses permutation language modeling over factorized token orderings:
$$ \mathcal{L}{\mathrm{XLNet}} = \sum \log p(x_{z_t} \mid x_{z_{<t}}) $$
where $z$ is a sampled permutation of token positions.
Optimization objective:
The pretrained checkpoint uses permutation-based autoregressive learning; downstream fine-tuning in the service is still ordinary supervised classification.
Interpretation: This is the permutation-language-model branch rather than the masked-language-model branch.
Text Family Status
This appendix covers the active text-model inventory at the level of encoder mathematics, pretraining objective, downstream optimization contract, assumptions, and workflow role.
Source: docs/book/appendices/per-model-media-mathematics.md
Per-Model Mathematics: Media Family
This appendix documents the media-service model family in book form. Media services are broader than the text family because the active inventory spans image classification, audio classification, and video classification, each with its own input geometry and model families.
Scope
This appendix covers the documented active media inventory across:
- image CNN and vision-transformer backbones
- feature-based and deep audio classifiers
- 3D-CNN and transformer-style video classifiers
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
resnet50 |
image classification | covered |
resnet101 |
image classification | covered |
mobilenet_v3_large |
image classification | covered |
regnet_y_400mf |
image classification | covered |
inception_v3 |
image classification | covered |
resnext50_32x4d |
image classification | covered |
wideresnet50_2 |
image classification | covered |
deit_base_patch16_224 |
image classification | covered |
vit_b_16 |
image classification | covered |
densenet121 |
image classification | covered |
efficientnet_b0 |
image and audio classification | covered as shared family form |
efficientnet_v2_s |
image classification | covered |
convnext_tiny |
image classification | covered |
swin_t |
image classification | covered |
catboost_audio_features |
audio classification | covered |
cnn_mel |
audio classification | covered |
simple_cnn |
audio classification | covered |
crnn |
audio classification | covered |
lstm_attention |
audio classification | covered |
vggish |
audio classification | covered |
mobilenetv2_audio |
audio classification | covered |
conv3d_small |
video classification | covered |
mc3_18 |
video classification | covered |
r2plus1d_18 |
video classification | covered |
mvit_v2_s |
video classification | covered |
timesformer_tiny |
video classification | covered |
vivit_tiny |
video classification | covered |
Common Notation
- $x \in \mathbb{R}^{H \times W \times C}$: image tensor
- $s \in \mathbb{R}^{F \times T}$: spectrogram or audio time-frequency map
- $v \in \mathbb{R}^{T \times H \times W \times C}$: video clip tensor
- $h$: latent representation before the classifier head
- $\hat{p}(y \mid \cdot)$: predicted class distribution
Workflow Context
Media services learn from tensors rather than ordinary tabular rows. The high-level rule is:
- image models operate on resized image tensors and use CNN or transformer backbones
- audio models either learn on engineered summary features or on spectrogram tensors
- video models operate on ordered clip tensors and use 3D convolution or transformer-style tokenization
Objective Lookup By Model Identifier
All media IDs are classification workflows, but the input representation and backbone family differ. The lookup below maps each visible model ID to the objective section that defines its supervised loss and architecture family.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
resnet50, resnet101, wideresnet50_2 |
residual CNN cross-entropy classification | Image Classification Families |
resnext50_32x4d, regnet_y_400mf |
grouped/structured CNN cross-entropy classification | Image Classification Families |
mobilenet_v3_large, efficientnet_b0, efficientnet_v2_s |
efficient CNN cross-entropy classification | Image Classification Families |
densenet121, convnext_tiny |
dense/modern CNN cross-entropy classification | Image Classification Families |
inception_v3 |
multi-branch CNN cross-entropy classification | Image Classification Families |
vit_b_16, deit_base_patch16_224, swin_t |
vision-transformer cross-entropy classification | Image Classification Families |
catboost_audio_features |
feature-based boosting classification loss | Audio Classification Families |
simple_cnn, cnn_mel, vggish |
spectrogram CNN cross-entropy classification | Audio Classification Families |
lstm_attention, crnn |
recurrent/hybrid audio cross-entropy classification | Audio Classification Families |
mobilenetv2_audio |
image-backbone-adapted audio cross-entropy classification | Audio Classification Families |
conv3d_small, mc3_18, r2plus1d_18 |
3D CNN video cross-entropy classification | Video Classification Families |
mvit_v2_s, timesformer_tiny, vivit_tiny |
video-transformer cross-entropy classification | Video Classification Families |
Shared Supervised Objective
For the deep classification branches, the final supervised head is typically:
$$ \hat{p}(y \mid z) = \operatorname{softmax}(W z + b) $$
with task loss:
$$ \mathcal{L}{\mathrm{cls}} = - \sum^{n} \sum_{k=1}^{K} \mathbf{1}(y_i = k)\log \hat{p}_{ik} $$
Interpretation: Most media-model differences in the book come from how $z$ is constructed from pixels, spectrograms, or clips.
Image Classification Families
Residual CNN family: resnet50, resnet101, wideresnet50_2
Algebraic formulation:
Residual blocks learn:
$$ h_{\ell+1} = h_{\ell} + F(h_{\ell}; \theta_{\ell}) $$
Optimization objective:
The network minimizes classification cross-entropy through gradient-based optimization.
Interpretation: These models differ mainly in depth or channel width, not in the basic residual-learning principle.
Grouped and structured CNN family: resnext50_32x4d, regnet_y_400mf
Algebraic formulation:
ResNeXt-style grouped convolution can be summarized as:
$$ F(h) = \sum_{g=1}^{G} F_g(h) $$
while RegNet emphasizes a parameterized stage-width design over residual blocks.
Optimization objective:
Both remain supervised CNN classifiers optimized with classification loss.
Interpretation: These families alter convolutional capacity allocation rather than abandoning the residual-CNN paradigm.
Efficient CNN family: mobilenet_v3_large, efficientnet_b0, efficientnet_v2_s
Algebraic formulation:
MobileNet-style depthwise separable convolution decomposes spatial and channel mixing:
$$ \operatorname{Conv}(x) \approx \operatorname{Pointwise}(\operatorname{Depthwise}(x)) $$
EfficientNet-style scaling jointly adjusts depth, width, and resolution:
$$ d = \alpha^\phi,\quad w = \beta^\phi,\quad r = \gamma^\phi $$
subject to compound-scaling constraints.
Optimization objective:
These models still minimize supervised classification loss, but the architecture is explicitly tuned for efficiency-quality tradeoffs.
Interpretation: This is the efficiency-conscious CNN branch used across image and adapted-audio backbones.
Dense and modern CNN family: densenet121, convnext_tiny
Algebraic formulation:
DenseNet concatenates prior feature maps:
$$ h_{\ell} = F_{\ell}([h_0, h_1, \ldots, h_{\ell-1}]) $$
ConvNeXt remains a convolutional network but modernizes block design and training posture to resemble transformer-era performance patterns.
Optimization objective:
Both are supervised image classifiers trained with classification loss.
Interpretation: The key difference is connectivity style: dense reuse versus modernized convolutional staging.
Inception family: inception_v3
Algebraic formulation:
Inception-style blocks concatenate parallel receptive-field branches:
$$ h = \operatorname{Concat}(f_1(x), f_2(x), \ldots, f_m(x)) $$
Optimization objective:
The backbone minimizes classification loss, sometimes with auxiliary-head stabilization depending on runtime configuration.
Interpretation: This family captures multi-scale spatial patterns through parallel branch design.
Vision-transformer family: vit_b_16, deit_base_patch16_224, swin_t
Algebraic formulation:
Patch-based transformers embed image patches and apply self-attention:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V $$
ViT and DeiT operate on global patch tokens, while Swin uses windowed and shifted-window attention over local regions.
Optimization objective:
The model minimizes classification cross-entropy after attention-based visual representation learning.
Interpretation: This is the transformer branch of the image service, contrasting with the CNN branch in how spatial interactions are modeled.
Audio Classification Families
Feature-based audio boosting: catboost_audio_features
Algebraic formulation:
The model operates on engineered summary features $x \in \mathbb{R}^p$ derived from the spectrogram or waveform and fits an additive boosted-tree predictor:
$$ F_M(x) = \sum_{m=1}^{M} \eta f_m(x) $$
Optimization objective:
CatBoost optimizes a task loss through stage-wise gradient boosting over tree learners.
Interpretation: This branch is the compact, interpretable, feature-based baseline for audio.
Spectrogram CNN family: simple_cnn, cnn_mel, vggish
Algebraic formulation:
The spectrogram is treated as an image-like tensor:
$$ z = \operatorname{CNN}(s) $$
where $s \in \mathbb{R}^{F \times T}$ is a mel or related time-frequency representation.
Optimization objective:
The model minimizes classification cross-entropy after convolutional feature extraction.
Interpretation: These models differ mostly in depth and backbone complexity, not in the core spectrogram-CNN idea.
Recurrent and hybrid audio family: lstm_attention, crnn
Algebraic formulation:
For sequence-first audio:
$$ h_t = \operatorname{LSTM}(s_t, h_{t-1}) $$
with attention summary:
$$ \alpha_t = \operatorname{softmax}(u^\top h_t), \qquad z = \sum_t \alpha_t h_t $$
CRNN-style models prepend convolutional extraction before recurrent sequence modeling:
$$ h_{1:T} = \operatorname{LSTM}(\operatorname{CNN}(s)) $$
Optimization objective:
Both models minimize classification loss over the final pooled sequence representation.
Interpretation: These branches explicitly preserve temporal ordering after or alongside local spectral pattern extraction.
Adapted image-backbone audio family: efficientnet_b0, mobilenetv2_audio
Algebraic formulation:
Projected spectrogram channels are passed into an image-trained backbone:
$$ z = \operatorname{Backbone}(\Pi(s)) $$
where $\Pi$ is the channel-projection or adaptation map from audio representation to image-like tensor.
Optimization objective:
The adapted backbone is fine-tuned with supervised classification loss.
Interpretation: This branch reuses mature visual backbones for audio classification after representation bridging.
Video Classification Families
3D CNN family: conv3d_small, mc3_18, r2plus1d_18
Algebraic formulation:
Three-dimensional convolution over a clip can be summarized as:
$$ z_t = \phi\left(b + \sum_{\tau,i,j} w_{\tau i j} v_{t+\tau, i, j}\right) $$
Factorized spatiotemporal variants such as r2plus1d_18 split spatial and temporal operators across stages.
Optimization objective:
The backbone minimizes supervised video classification loss.
Interpretation: These models learn local motion and spatial patterns directly from clip tensors.
Video transformer family: mvit_v2_s, timesformer_tiny, vivit_tiny
Algebraic formulation:
Video transformers tokenize frames or tubelets and apply self-attention over spatiotemporal tokens:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V $$
TimeSformer separates temporal and spatial attention, while ViViT emphasizes tubelet tokenization; MViT introduces multiscale attention structure.
Optimization objective:
These models minimize classification loss after attention-based aggregation over video tokens.
Interpretation: This family is the global-context alternative to 3D convolutional video backbones.
Media Family Status
This appendix covers the active media inventory at the level of model-family mathematics, optimization contract, assumptions, and workflow role.
Source: docs/book/appendices/per-model-survival-mathematics.md
Per-Model Mathematics: Survival Family
This appendix chapter presents the survival-service mathematics. Survival workflows differ from ordinary classification and regression because censoring, time-to-event structure, and survival-function interpretation are built into the model contract.
Scope
This appendix covers the active survival inventory and separately labels planned or constrained competing-risk forms. Planned entries are included for mathematical traceability, not as a promise that every branch is available in every deployment.
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
cox_ph |
survival analysis | covered |
kaplan_meier |
survival analysis | covered |
rsf |
survival analysis | covered |
svm |
survival analysis | covered |
deepsurv |
survival analysis | covered |
deephit_single |
survival analysis | covered |
survival_cnn |
survival analysis | covered |
survival_transformer |
survival analysis | covered |
deephit |
competing-risk survival analysis | covered |
cause_specific_cox |
planned competing-risk extension | documented for mathematical traceability |
competing_rsf |
planned competing-risk extension | documented for mathematical traceability |
cif_neural_net |
planned competing-risk extension | documented for mathematical traceability |
competing_deephit |
planned competing-risk extension | documented for mathematical traceability |
Common Notation
- $T$: event time
- $C$: censoring time
- $\tilde{T} = \min(T, C)$: observed time
- $\delta = \mathbf{1}(T \le C)$: event indicator
- $x_i$: covariate vector for subject $i$
- $S(t \mid x)$: survival function
- $h(t \mid x)$: hazard function
- $F_r(t \mid x)$: cumulative incidence for event type $r$
Workflow Mapping
The high-level rule is:
- classical methods use tabular covariates with censoring-aware estimators
- deep methods map covariates into neural survival representations
- the service maintains a distinction between active standard survival paths and planned competing-risk extensions
Objective Lookup By Model Identifier
Survival IDs differ by censoring contract, hazard representation, and competing-risk support. This lookup maps each ID to the objective section below.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
kaplan_meier |
nonparametric product-limit estimator without fitted loss | Classical Survival Baselines |
cox_ph |
Cox partial likelihood | Classical Survival Baselines |
rsf |
survival-tree split criteria with forest aggregation | Classical Survival Baselines |
svm |
margin-based survival ranking loss | Classical Survival Baselines |
deepsurv |
neural Cox partial-likelihood loss | Deep Survival Families |
deephit_single |
censored discrete-time survival likelihood and ranking loss | Deep Survival Families |
survival_cnn |
convolutional discrete-time survival loss | Deep Survival Families |
survival_transformer |
attention-based discrete-time survival loss | Deep Survival Families |
deephit |
competing-risk DeepHit likelihood plus ranking loss | Competing-Risk Deep Family |
cause_specific_cox |
planned cause-specific Cox partial likelihood | Planned Competing-Risk Forms |
competing_rsf |
planned competing-risk forest split criterion | Planned Competing-Risk Forms |
cif_neural_net |
planned cumulative-incidence neural likelihood | Planned Competing-Risk Forms |
competing_deephit |
planned multi-event DeepHit objective | Planned Competing-Risk Forms |
Classical Survival Baselines
kaplan_meier
Algebraic formulation:
The Kaplan-Meier estimator is:
$$ \hat{S}(t) = \prod_{t_j \le t}\left(1 - \frac{d_j}{n_j}\right) $$
where $d_j$ is the number of events at time $t_j$ and $n_j$ is the risk-set size just before $t_j$.
Optimization objective:
There is no gradient-based optimization objective; this is a nonparametric product-limit estimator.
Interpretation: This is the canonical baseline survival curve estimator without covariate-parametric structure.
cox_ph
Algebraic formulation:
The Cox proportional-hazards model assumes:
$$ h(t \mid x_i) = h_0(t)\exp(x_i^\top \beta) $$
Optimization objective:
The model estimates $\beta$ by maximizing the Cox partial likelihood:
$$ \ell(\beta) = \sum_{i:\delta_i=1}\left(x_i^\top \beta - \log \sum_{j \in R_i}\exp(x_j^\top \beta)\right) $$
Interpretation: This is the core semi-parametric hazard model in the survival family.
rsf
Algebraic formulation:
Random survival forests aggregate tree-based survival estimates:
$$ \hat{S}(t \mid x) = \frac{1}{B}\sum_{b=1}^{B} \hat{S}_b(t \mid x) $$
Optimization objective:
RSF does not optimize a differentiable neural objective; it grows survival trees using splitting rules derived from survival separation criteria.
Interpretation: This is the nonlinear tree-ensemble survival branch.
svm
Algebraic formulation:
Survival SVM variants typically learn a ranking margin over comparable survival pairs:
$$ \min_{w} \frac{1}{2}\lVert w \rVert^2 + C \sum_{(i,j)\in \mathcal{P}} \max\left(0, 1 - w^\top(x_i - x_j)\right) $$
Optimization objective:
The model optimizes a margin-based ranking objective adapted to survival ordering.
Interpretation: This branch emphasizes ordering or ranking of risk rather than direct hazard parameterization.
Deep Survival Families
deepsurv
Algebraic formulation:
DeepSurv replaces the linear Cox risk score with a neural network:
$$ h(t \mid x) = h_0(t)\exp(f_\theta(x)) $$
Optimization objective:
The network minimizes the negative Cox partial log-likelihood with respect to neural parameters $\theta$.
Interpretation: This is the neural generalization of Cox PH.
deephit_single
Algebraic formulation:
DeepHitSingle learns a discrete-time event-time distribution:
$$ \hat{p}(T = t \mid x) = \operatorname{softmax}(g_\theta(x))_t $$
Optimization objective:
The network optimizes a censored discrete-time survival loss, commonly combining likelihood-style and ranking-style terms.
Interpretation: This branch predicts a discrete survival distribution directly instead of a proportional-hazards risk score.
survival_cnn
Algebraic formulation:
The model uses convolutional feature extraction before a discrete-time survival head:
$$ z = \operatorname{CNN}(x), \qquad \hat{p}(T=t \mid x) = \operatorname{softmax}(Wz+b)_t $$
Optimization objective:
The network minimizes a survival-aware discrete-time objective over event-time bins.
Interpretation: This is a convolutional feature-learning branch for survival risk estimation.
survival_transformer
Algebraic formulation:
Transformer-style survival models use self-attention over tabular or sequence-like inputs:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V $$
followed by a survival head over the latent representation.
Optimization objective:
The model minimizes a censored discrete-time or related survival loss over the transformed representation.
Interpretation: This is the attention-based deep survival branch.
Competing-Risk Deep Family
deephit
Algebraic formulation:
DeepHit for competing risks learns event-specific discrete distributions:
$$ \hat{p}(T=t, E=r \mid x) = \operatorname{softmax}(g_\theta(x))_{t,r} $$
Optimization objective:
The model minimizes a competing-risk loss that respects both event type and censoring structure, often blending likelihood and ranking components.
Interpretation: This is the active competing-risk deep survival branch documented in the service chapter.
Planned Competing-Risk Forms
cause_specific_cox
Algebraic formulation:
For event type $r$:
$$ h_r(t \mid x) = h_{0r}(t)\exp(x^\top \beta_r) $$
Optimization objective:
For each cause $r$, the intended estimator maximizes a cause-specific Cox partial likelihood, treating other event types as censored for that cause:
$$ \ell_r(\beta_r) = \sum_{i:E_i=r} \left[ x_i^\top\beta_r - \log\sum_{j \in R_i}\exp(x_j^\top\beta_r) \right] $$
Equivalently, the fitted branch would minimize $-\sum_r \ell_r(\beta_r)$ across event-specific hazard models.
Status: Documented as a planned competing-risk extension. Treat it as a mathematical reference unless the active service catalog exposes it for training.
competing_rsf
Algebraic formulation:
A competing-risk forest estimates event-specific cumulative incidence or cause-specific survival quantities through an ensemble of survival trees.
Optimization objective:
There is no single differentiable global objective. Each tree is grown using competing-risk split criteria that seek stronger separation in event-specific cumulative incidence or cause-specific risk:
$$ \max_{\text{split}} \; \Delta_{\mathrm{CR}}(\text{parent}, \text{left}, \text{right}) $$
where $\Delta_{\mathrm{CR}}$ denotes the improvement in a competing-risk separation criterion such as cause-specific log-rank or cumulative-incidence separation. The forest aggregates the resulting event-specific estimates.
Status: Documented as a planned competing-risk extension. Treat it as a mathematical reference unless the active service catalog exposes it for training.
cif_neural_net
Algebraic formulation:
The network would learn event-specific cumulative incidence functions:
$$ F_r(t \mid x) = \Pr(T \le t, E=r \mid x) $$
Optimization objective:
The intended neural branch would minimize a censored competing-risk likelihood over event type and time bins, often with calibration or ranking terms:
$$ \min_{\theta} -\sum_i \left[ \delta_i \log \hat{p}{\theta}(T_i, E_i \mid x_i) + (1-\delta_i)\log \hat{S}(\tilde{T}_i \mid x_i) \right] $$
where $\hat{S}_{\theta}(\tilde{T}_i \mid x_i)$ is the model-implied probability of remaining event-free beyond the censoring time.
Status: Documented as a planned competing-risk extension. Treat it as a mathematical reference unless the active service catalog exposes it for training.
competing_deephit
Algebraic formulation:
This would remain in the DeepHit family with explicit multi-event discrete-time output heads.
Optimization objective:
The intended objective is the competing-risk DeepHit loss, combining event-time likelihood with a ranking term:
$$ \min_{\theta} \mathcal{L}{\mathrm{likelihood}}(\theta) + \alpha\,\mathcal{L}}(\theta) $$
where the likelihood term handles censored event-time/event-type observations and the ranking term encourages higher cumulative incidence for subjects who experience an event earlier.
Status: Documented as a planned competing-risk extension. Treat it as a mathematical reference unless the active service catalog exposes it for training.
Survival Family Status
This appendix captures the active survival inventory and records planned competing-risk forms so readers can distinguish fitted workflow behavior from mathematical extensions.
Source: docs/book/appendices/per-model-specialized-mathematics.md
Per-Model Mathematics: Specialized Family
This appendix documents the specialized-service model family in book form. The specialized family is heterogeneous by design because it groups together unsupervised clustering and anomaly-detection workflows that do not share a single prediction contract.
Scope
This appendix covers the documented specialized families across:
- clustering
- anomaly detection
It also distinguishes between supervised prediction metrics and unsupervised structure or anomaly-score diagnostics.
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
kmeans |
clustering | covered |
dbscan |
clustering | covered |
hierarchical |
clustering | covered |
optics |
clustering | covered |
spectral |
clustering | covered |
auto_gmm |
clustering | covered |
birch |
clustering | covered |
hdbscan |
clustering | covered |
mean_shift |
clustering | covered as family form |
affinity_propagation |
clustering | covered as family form |
Isolation Forest |
anomaly detection | covered |
One-Class SVM |
anomaly detection | covered |
Autoencoder |
anomaly detection | covered |
Local Outlier Factor |
anomaly detection | covered |
Elliptic Envelope |
anomaly detection | covered |
PCA |
anomaly detection | covered |
KNN |
anomaly detection | covered |
COPOD |
anomaly detection | covered |
MCD |
anomaly detection | covered |
Feature Bagging |
anomaly detection | covered |
IForest++ |
anomaly detection | covered |
VAE |
anomaly detection | covered |
DeepSVDD |
anomaly detection | covered |
DeepSAD |
anomaly detection | covered |
RRCF |
anomaly detection | covered |
HBOS |
anomaly detection | covered |
Denoising Autoencoder |
anomaly detection | covered |
GANomaly |
anomaly detection | covered |
Common Notation
- $x_i \in \mathbb{R}^p$: input observation
- $c_i$: cluster assignment
- $\mu_k$: cluster centroid or prototype for cluster $k$
- $s(x)$: anomaly score
- $z$: latent representation
- $\mathcal{N}_k(x)$: $k$-nearest-neighbor set around $x$
Workflow Context
Specialized services emphasize unsupervised structure and anomaly scoring. The high-level rule is:
- clustering models learn structure without label supervision
- anomaly models emit scores, ranks, or binary outlier flags rather than class probabilities in the usual supervised sense
- some labels represent exact backend estimators while others represent compatibility or fallback-driven runtime paths documented in the service chapter
Objective Lookup By Model Identifier
Specialized services include both unsupervised structure learning and anomaly scoring. This lookup maps each visible model ID to the objective section below.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
kmeans, mean_shift |
centroid distortion or kernel-density mode seeking | Clustering Families |
dbscan, optics, hdbscan |
density/reachability clustering rule rather than fitted loss | Clustering Families |
hierarchical, birch |
linkage or tree-style cluster aggregation criterion | Clustering Families |
spectral, auto_gmm, affinity_propagation |
graph cut, mixture likelihood, or exemplar-message objective | Clustering Families |
Isolation Forest, IForest++, RRCF |
isolation/partition anomaly score | Anomaly-Detection Families |
One-Class SVM, Local Outlier Factor, KNN |
margin, local-density, or neighbor-distance anomaly score | Anomaly-Detection Families |
Elliptic Envelope, MCD, PCA, HBOS, COPOD |
covariance, projection, histogram, or copula-tail score | Anomaly-Detection Families |
Autoencoder, Denoising Autoencoder, VAE, GANomaly |
reconstruction or generative anomaly loss | Anomaly-Detection Families |
DeepSVDD, DeepSAD |
hypersphere / semi-supervised deep anomaly objective | Anomaly-Detection Families |
Feature Bagging |
ensemble aggregation of base anomaly scores | Anomaly-Detection Families |
Clustering Families
Centroid and prototype clustering: kmeans, mean_shift
Algebraic formulation:
K-means minimizes within-cluster distortion:
$$ \min_{{c_i}, {\mu_k}} \sum_{i=1}^{n} \lVert x_i - \mu_{c_i} \rVert^2 $$
Mean-shift instead follows kernel-density modes through iterative updates:
$$ x^{(t+1)} = \frac{\sum_i K(x^{(t)} - x_i)x_i}{\sum_i K(x^{(t)} - x_i)} $$
Optimization objective:
K-means uses alternating assignment and centroid updates; mean-shift performs mode-seeking rather than fixed-$k$ distortion minimization.
Interpretation: These are the prototype and density-mode branches of clustering.
Density and reachability clustering: dbscan, optics, hdbscan
Algebraic formulation:
DBSCAN-style logic is based on neighborhood density:
$$ |N_{\varepsilon}(x_i)| \ge \mathrm{MinPts} $$
OPTICS generalizes this through reachability ordering, while HDBSCAN builds hierarchical density clusters across scale.
Optimization objective:
These methods do not minimize a single global supervised loss; they infer clusters from local density and connectivity structure.
Interpretation: These are the density-clustering branches, especially useful when cluster shapes are non-spherical or noise points matter.
Linkage and tree-style clustering: hierarchical, birch
Algebraic formulation:
Agglomerative hierarchical clustering repeatedly merges clusters under a linkage criterion:
$$ d(A,B) = \min_{x \in A, y \in B} d(x,y) $$
for single linkage, with analogous alternatives for complete, average, or Ward linkage.
BIRCH summarizes data through clustering-feature trees rather than pairwise full-dataset merging.
Optimization objective:
Hierarchical clustering follows a greedy merge procedure; BIRCH incrementally compresses data into CF-tree structures before global clustering.
Interpretation: These are the hierarchical structure-learning branches.
Graph and mixture clustering: spectral, auto_gmm, affinity_propagation
Algebraic formulation:
Spectral clustering uses graph Laplacian embeddings:
$$ L = D - W $$
and clusters in the eigenspace of $L$.
Gaussian mixture models assume:
$$ p(x) = \sum_{k=1}^{K} \pi_k \mathcal{N}(x \mid \mu_k, \Sigma_k) $$
Affinity propagation iterates message passing between exemplars and points.
Optimization objective:
- spectral clustering relies on graph-partition structure then downstream clustering in embedding space
- GMMs maximize data likelihood, typically via EM
- affinity propagation updates responsibilities and availabilities to choose exemplars
Interpretation: These are the graph-partition, probabilistic mixture, and exemplar-message-passing branches.
Anomaly-Detection Families
Isolation and partition-based methods: Isolation Forest, IForest++, RRCF
Algebraic formulation:
Isolation Forest-style scoring depends on expected path length:
$$ s(x) = 2^{- \frac{E[h(x)]}{c(n)}} $$
RRCF-style methods use random cut trees and related displacement or co-displacement logic to score unusual observations.
Optimization objective:
These methods rely on randomized partition structures rather than a supervised loss.
Interpretation: This family identifies anomalies by how easily they are isolated.
Margin, neighborhood, and local-density methods: One-Class SVM, Local Outlier Factor, KNN
Algebraic formulation:
One-Class SVM solves:
$$ \min_{w,\rho,\xi} \frac{1}{2}\lVert w \rVert^2 + \frac{1}{\nu n}\sum_i \xi_i - \rho $$
subject to:
$$ w^\top \phi(x_i) \ge \rho - \xi_i,\qquad \xi_i \ge 0 $$
LOF compares local reachability density to neighborhood density, and KNN anomaly scoring often uses neighbor distance:
$$ s(x) = \frac{1}{k}\sum_{j \in \mathcal{N}_k(x)} d(x, x_j) $$
Optimization objective:
These methods optimize or compute boundary, density, or neighbor-contrast structure rather than reconstruction.
Interpretation: This family emphasizes local geometry or margin separation in feature space.
Covariance, projection, and histogram methods: Elliptic Envelope, MCD, PCA, HBOS, COPOD
Algebraic formulation:
Elliptic-envelope and MCD methods assume robust covariance structure:
$$ d_M(x)^2 = (x - \mu)^\top \Sigma^{-1}(x - \mu) $$
PCA anomaly scoring is often based on residual reconstruction or low-rank projection error:
$$ s(x) = \lVert x - UU^\top x \rVert^2 $$
HBOS scores via marginal histogram rarity, while COPOD uses copula-inspired tail-probability scoring.
Optimization objective:
These methods estimate low-rank, covariance, histogram, or tail-structure summaries rather than train end-to-end discriminative networks.
Interpretation: This branch is useful when anomaly structure is statistical or geometric rather than sequential or semantic.
Reconstruction-based methods: Autoencoder, Denoising Autoencoder, VAE, GANomaly
Algebraic formulation:
Plain autoencoders minimize reconstruction loss:
$$ \mathcal{L}{\mathrm{AE}} = \sum_i \lVert x_i - g\theta(f_\theta(x_i)) \rVert^2 $$
Denoising autoencoders reconstruct from corrupted inputs:
$$ \mathcal{L}{\mathrm{DAE}} = \sum_i \lVert x_i - g\theta(f_\theta(\tilde{x}_i)) \rVert^2 $$
VAEs optimize:
$$ \mathcal{L}{\mathrm{VAE}} = \mathbb{E}[\log p_\theta(x \mid z)] - D_{\mathrm{KL}}(q_\phi(z \mid x) \parallel p(z)) $$
GANomaly-style models combine adversarial, reconstruction, and latent-consistency terms.
Optimization objective:
These methods learn a latent manifold of normal data and flag large reconstruction or latent-deviation errors as anomalous.
Interpretation: This is the reconstruction-learning branch of anomaly detection.
Hypersphere and semi-supervised deep methods: DeepSVDD, DeepSAD
Algebraic formulation:
Deep SVDD learns representations close to a center $c$:
$$ \min_{\theta} \sum_i \lVert f_\theta(x_i) - c \rVert^2 $$
Deep SAD extends the objective with anomaly-labeled contrast terms for semi-supervised learning.
Optimization objective:
The network compresses normal data into a compact latent region and pushes anomalies away when supervision is available.
Interpretation: This family is the deep hypersphere branch.
Ensemble and meta-anomaly methods: Feature Bagging
Algebraic formulation:
Feature bagging aggregates anomaly scores from multiple feature subsets:
$$ s(x) = \frac{1}{M}\sum_{m=1}^{M} s_m(x) $$
Optimization objective:
There is no single estimator loss; the method ensembles base anomaly scorers over resampled feature views.
Interpretation: This branch reduces dependence on one feature subspace.
Specialized Family Status
This appendix covers the specialized inventory at the level of clustering and anomaly-family mathematics, optimization or scoring rules, assumptions, and workflow role.
Source: docs/book/appendices/per-model-advanced-systems-mathematics.md
Per-Model Mathematics: Advanced Systems Family
This appendix documents the advanced-systems model family in book form. These services are system-oriented rather than purely estimator-oriented: recommendation depends on user-item structure, ranking depends on grouped preference ordering, network analysis depends on graph topology, and graphical models infer conditional-dependence structure among measured variables.
Scope
This appendix covers the documented advanced families across:
- recommendation systems
- learning to rank
- network analysis
- graphical models
Coverage Status
| Model Identifier | Workflow | Appendix Status |
|---|---|---|
collaborative_filtering |
recommendation | covered |
content_based |
recommendation | covered |
matrix_factorization |
recommendation | covered |
knn_user |
recommendation | covered |
knn_item |
recommendation | covered |
popularity_based |
recommendation | covered |
hybrid |
recommendation | covered |
clustering_based |
recommendation | covered |
XGBoost Ranker |
ranking | covered |
LightGBM Ranker |
ranking | covered |
CatBoost Ranker |
ranking | covered |
XGBoost Pairwise |
ranking | covered |
LightGBM Pairwise |
ranking | covered |
CatBoost Pairwise |
ranking | covered |
XGBoost Listwise |
ranking | covered |
LightGBM Listwise |
ranking | covered |
CatBoost Listwise |
ranking | covered |
Random Forest Relevance |
ranking | covered |
Extra Trees Relevance |
ranking | covered |
Gradient Boosting Relevance |
ranking | covered |
AdaBoost Relevance |
ranking | covered |
KNN Relevance |
ranking | covered |
MLP Relevance |
ranking | covered |
gcn |
network analysis | covered |
graphsage |
network analysis | covered |
gat |
network analysis | covered |
graphormer |
network analysis | covered |
node2vec |
network analysis | covered |
vgae |
network analysis | covered |
chebnet, sgc, armaconv, gatedgcn, splinecnn, monet, tagcn, supergat, graphbert, san, gt, gin, appnp, graph_autoencoder, dgi, deepwalk, line, sign, graphsaint |
network analysis | covered as broader family inventory |
gaussian_graphical_lasso |
graphical models | covered |
partial_correlation_network |
graphical models | covered |
ising_pseudolikelihood |
graphical models | covered |
bayesian_network_proxy |
graphical models | covered |
markov_chain_transition |
graphical models | covered |
hmm_gaussian |
graphical models | covered |
kalman_filter_state_space |
graphical models | covered |
Common Notation
- $R \in \mathbb{R}^{m \times n}$: user-item interaction matrix
- $u_i$, $v_j$: latent user and item vectors
- $q$: query or group in a ranking task
- $x_{qj}$: feature vector for item $j$ within query/group $q$
- $G = (V,E)$: graph with nodes $V$ and edges $E$
- $h_v^{(\ell)}$: node embedding for node $v$ at layer $\ell$
- $X \in \mathbb{R}^{n \times p}$: matrix of $p$ measured variables across $n$ observations
- $\Sigma$: covariance matrix
- $\Theta = \Sigma^{-1}$: precision matrix
- $s_t$: categorical state at ordered record or time $t$
Workflow Context
Advanced-system services model relationships, rankings, recommendations, graph structure, or conditional dependence. The high-level rule is:
- recommendation models learn or score user-item affinity
- ranking models optimize ordering quality within groups or queries
- network models learn node, edge, or graph representations under explicit graph structure
- graphical models estimate conditional-dependence, hidden-state, or state-space diagnostics from selected variables
Objective Lookup By Model Identifier
Advanced-system model IDs span recommenders, rankers, graph learners, and graphical models. This lookup maps each service-visible ID to the objective section below.
| Model Identifier(s) | Objective Family | Objective Section |
|---|---|---|
gaussian_graphical_lasso |
sparse precision-matrix likelihood | Graphical Model Families |
partial_correlation_network |
precision/partial-correlation dependency screening | Graphical Model Families |
ising_pseudolikelihood |
nodewise logistic pseudolikelihood | Graphical Model Families |
bayesian_network_proxy |
bounded dependency-score graph selection | Graphical Model Families |
markov_chain_transition |
transition-matrix negative log-likelihood | Graphical Model Families |
hmm_gaussian |
hidden-state sequence likelihood | Graphical Model Families |
kalman_filter_state_space |
Gaussian state-space likelihood | Graphical Model Families |
collaborative_filtering, matrix_factorization |
latent-factor reconstruction loss | Recommendation Families |
knn_user, knn_item |
similarity-neighborhood aggregation without fitted global loss | Recommendation Families |
content_based, popularity_based |
representation similarity or aggregate-rate scoring | Recommendation Families |
hybrid, clustering_based |
weighted recommender composition or cluster-conditioned scoring | Recommendation Families |
XGBoost Ranker, LightGBM Ranker, CatBoost Ranker |
backend ranking-aware boosted-tree objective | Ranking Families |
XGBoost Pairwise, LightGBM Pairwise, CatBoost Pairwise |
pairwise ranking loss | Ranking Families |
XGBoost Listwise, LightGBM Listwise, CatBoost Listwise |
listwise NDCG-style ranking objective | Ranking Families |
Random Forest Relevance, Extra Trees Relevance, Gradient Boosting Relevance, AdaBoost Relevance, KNN Relevance, MLP Relevance |
pointwise supervised relevance loss | Ranking Families |
random_forest, gradient_boosting, logistic_regression, mlp, svm, knn |
graph-feature supervised loss | Network Analysis Families |
gcn, graphsage, gat, gin, appnp, chebnet, sgc, tagcn, gatedgcn, armaconv, splinecnn, monet, supergat |
message-passing graph-supervised loss | Network Analysis Families |
graphormer, graphbert, san, gt |
graph-attention supervised loss | Network Analysis Families |
node2vec, deepwalk, line, sign, graphsaint |
random-walk or scalable graph embedding objective | Network Analysis Families |
vgae, graph_autoencoder, dgi |
graph reconstruction, variational, or contrastive objective | Network Analysis Families |
Graphical Model Families
Gaussian graphical lasso: gaussian_graphical_lasso
Algebraic formulation:
The Gaussian graphical model encodes conditional independence through zeros in the precision matrix $\Theta$.
Optimization objective:
$$ \min_{\Theta \succ 0} \; -\log\det(\Theta) + \operatorname{tr}(S\Theta) + \lambda \lVert \Theta \rVert_1 $$
where $S$ is the empirical covariance matrix. Non-zero off-diagonal elements in $\Theta$ define the inferred dependency graph.
Interpretation: This is the sparse conditional-dependence branch of the Graphical Models service.
Partial-correlation network: partial_correlation_network
Algebraic formulation:
Given a precision matrix $\Theta$, the partial correlation between variables $i$ and $j$ is:
$$ \rho_{ij \cdot -ij} = -\frac{\Theta_{ij}}{\sqrt{\Theta_{ii}\Theta_{jj}}} $$
Optimization objective:
The live branch estimates a stable empirical covariance or precision matrix and then thresholds partial correlations. When a penalized precision estimate is used, the objective is the same sparse precision objective as graphical lasso:
$$ \min_{\Theta \succ 0} \; -\log\det(\Theta) + \operatorname{tr}(S\Theta) + \lambda \lVert \Theta \rVert_1 $$
When the empirical inverse is used directly, there is no separate fitted predictive loss; the "objective" is conditional-dependence screening from the estimated precision structure.
Interpretation: This gives a dependency-network proxy from the empirical precision matrix.
Ising pseudolikelihood: ising_pseudolikelihood
Algebraic formulation:
For binary variables $x_j \in {0,1}$, nodewise logistic regressions approximate the Ising dependency structure:
$$ P(X_j = 1 \mid X_{-j}) = \sigma\left(\alpha_j + \sum_{k \ne j} \beta_{jk} X_k\right) $$
The service symmetrizes nodewise coefficients to form a diagnostic dependency graph.
Optimization objective:
The pseudolikelihood objective fits one conditional logistic model per node and sums their negative log-likelihoods:
$$ \min_{{\alpha_j,\beta_j}{j=1}^{p}} -\sum^{p}\sum_{i=1}^{n} \left[ x_{ij}\log p_{ij} + (1-x_{ij})\log(1-p_{ij}) \right] + \lambda \sum_{j=1}^{p}\lVert \beta_j \rVert_1 $$
where $p_{ij}=P(X_{ij}=1 \mid X_{i,-j})$. The regularization term is optional at the implementation level, but it is the standard way to stabilize sparse Ising-style neighborhoods.
Bayesian-network proxy: bayesian_network_proxy
Algebraic formulation:
This first rollout uses bounded pairwise dependency screening as a practical proxy. It should not be interpreted as a full causal DAG learner.
The proxy scores pairwise dependency strengths, orients an interpretable diagnostic graph by a stable variable order, and reports edge count, density, mean absolute edge weight, and structure score. Full DAG structure learning, constraint-based conditional-independence testing, score-based search, and formal causal discovery are future additions rather than claims made by this model.
Optimization objective:
The proxy is a bounded dependency-screening estimator rather than a full DAG search. Its score can be read as selecting high-strength pairwise dependencies subject to acyclicity and edge-budget constraints:
$$ \max_{A \in \mathcal{D}} \sum_{i \ne j} A_{ij}\,s_{ij} - \lambda \lVert A \rVert_0 $$
where $A$ is the directed adjacency matrix, $\mathcal{D}$ is the set of allowed directed acyclic or stably ordered graphs, and $s_{ij}$ is the pairwise dependency score.
Markov chain transition model: markov_chain_transition
Algebraic formulation:
For an ordered state sequence $s_1,\ldots,s_T$, the first-order Markov transition probability is:
$$ P(s_t = j \mid s_{t-1}=i) = P_{ij} $$
The empirical transition matrix estimates:
$$ \hat{P}{ij} = \frac{N}{\sum_k N_{ik}} $$
where $N_{ij}$ is the observed count of transitions from state $i$ to state $j$.
Optimization objective:
The maximum-likelihood estimate minimizes the negative transition log-likelihood under row-wise simplex constraints:
$$ \min_{P} -\sum_{i,j} N_{ij}\log P_{ij} \quad \text{subject to} \quad P_{ij}\ge 0,\ \sum_j P_{ij}=1 $$
Diagnostic metrics:
- transition entropy, normalized over observed outgoing state probabilities
- self-transition rate, $\sum_i N_{ii}/\sum_{ij}N_{ij}$
- number of states
- transition sparsity and density
Interpretation: This branch produces a transition matrix and directed transition graph. It describes observed state dynamics and does not infer causal mechanisms.
Gaussian hidden-state proxy: hmm_gaussian
Algebraic formulation:
The ordered hidden-state proxy approximates latent states with Gaussian mixture components and reports transition diagnostics:
$$ P(z_t \mid z_{t-1}), \quad x_t \mid z_t \sim \mathcal{N}(\mu_{z_t}, \Sigma_{z_t}) $$
Optimization objective:
The hidden-state proxy maximizes the likelihood of the observed ordered sequence under latent states, or equivalently minimizes negative log-likelihood:
$$ \min_{\theta} -\log p_{\theta}(x_{1:T}) = -\log \sum_{z_{1:T}} p_{\theta}(z_1) \prod_{t=2}^{T}p_{\theta}(z_t \mid z_{t-1}) \prod_{t=1}^{T}p_{\theta}(x_t \mid z_t) $$
It reports hidden-state count, transition-style edge density, AIC, and BIC when the fitted proxy exposes them. These metrics compare compactness and fit of the proxy state representation; they are not supervised classification scores.
Kalman local-level trace: kalman_filter_state_space
Algebraic formulation:
The state-space diagnostic uses a local-level model:
$$ y_t = \alpha_t + \epsilon_t,\quad \alpha_t = \alpha_{t-1} + \eta_t $$
where $\epsilon_t$ is observation noise and $\eta_t$ is state evolution noise.
Optimization objective:
The state-space branch estimates latent states and variance parameters by maximizing the Gaussian state-space likelihood, or equivalently minimizing:
$$ \min_{\theta} -\log p_{\theta}(y_{1:T}) $$
The Kalman recursion supplies the one-step predictive likelihood and filtered state estimates used by this objective.
The service reports one-step trace RMSE as a state-space diagnostic. Lower RMSE is better for this model, while structure-score-style metrics remain the comparison signal used by the broader graphical-model table.
Confidence Intervals And Plot Contract
This section is a display and uncertainty contract, not a model entry. The model-level objective functions are defined in the sections above.
Graphical-model metrics use bounded confidence intervals where a valid resampling basis exists:
- dependency-structure models use nonparametric row bootstrap over selected measured variables;
- Markov transition metrics resample transition counts before recomputing transition entropy, self-transition rate, sparsity, and density;
- hidden-state and Kalman diagnostics report fitted-proxy intervals when the underlying source signal is available.
The service should save:
- one EDA
Variable Correlationvisual for the selected variables, deduplicated across legacyeda/andplots/locations; - missingness, variable distribution, boxplot, dependency-preview, state, and sequence-coverage EDA plots when the relevant columns exist;
- shared model-comparison and training-time plots;
- model-result plots for dependency graphs, precision/partial-correlation heatmaps, transition matrices/graphs, hidden-state sequences, and Kalman traces where the corresponding models ran.
Recommendation Families
Matrix-factor and collaborative filtering family: collaborative_filtering, matrix_factorization
Algebraic formulation:
A latent-factor recommender approximates the interaction matrix as:
$$ R_{ij} \approx u_i^\top v_j $$
or, more generally:
$$ R \approx UV^\top $$
Optimization objective:
The model minimizes a reconstruction objective over observed interactions, often with regularization:
$$ \min_{U,V} \sum_{(i,j)\in \Omega} (R_{ij} - u_i^\top v_j)^2 + \lambda(\lVert U \rVert_F^2 + \lVert V \rVert_F^2) $$
Interpretation: This is the core latent-factor branch of the recommender service.
Similarity and neighborhood recommendation: knn_user, knn_item
Algebraic formulation:
User-based recommendation predicts from similar users:
$$ \hat{R}{ij} = \frac{\sum(i)} s(i,u)R_{uj}}{\sum_{u \in \mathcal{N}(i)} |s(i,u)|} $$
Item-based recommendation uses analogous neighborhood aggregation over similar items.
Optimization objective:
These models do not learn deep parameters in the same way as factor models; they rely on similarity computation and neighborhood aggregation.
Interpretation: This is the local-similarity branch of recommendation.
Content and popularity recommendation: content_based, popularity_based
Algebraic formulation:
Content-based recommenders score user-item fit from item features and user profiles:
$$ \hat{s}(u,i) = f(\phi_u, \psi_i) $$
where $\phi_u$ and $\psi_i$ are user and item representations.
Popularity models use aggregate interaction counts or rates:
$$ \hat{s}(i) \propto \sum_u R_{ui} $$
Optimization objective:
Content-based models optimize representation-based similarity or supervised preference fit; popularity models typically require no learned personalized optimization.
Interpretation: These families cover cold-start-friendly feature scoring and non-personalized baseline ranking.
Composite recommendation: hybrid, clustering_based
Algebraic formulation:
Hybrid recommenders combine components:
$$ \hat{s}(u,i) = \alpha s_{\mathrm{cf}}(u,i) + (1-\alpha)s_{\mathrm{content}}(u,i) $$
Clustering-based recommenders group users or items and score within cluster structure.
Optimization objective:
Hybrid systems optimize or tune weighted combinations; clustering-based recommenders depend on upstream cluster learning plus cluster-conditioned scoring.
Interpretation: These are system-composition branches rather than single-estimator families.
Ranking Families
Learning-to-rank backends: XGBoost Ranker, LightGBM Ranker, CatBoost Ranker
Algebraic formulation:
These models learn a scoring function:
$$ f(x_{qj}) $$
and order items within each query/group by descending score.
Optimization objective:
Depending on backend and configuration, they optimize a ranking-aware objective, but at the book level they can be read as boosted-tree ranking functions over grouped examples. The current implementation uses XGBoost rank:ndcg, LightGBM lambdarank, and CatBoost YetiRank for these default ranker entries.
Interpretation: These are the tree-based ranking backends differentiated mostly by implementation library and objective configuration.
Pairwise ranking: XGBoost Pairwise, LightGBM Pairwise, CatBoost Pairwise
Algebraic formulation:
Pairwise ranking learns preferences over item pairs:
$$ \Pr(x_{qi} \succ x_{qj}) = \sigma(f(x_{qi}) - f(x_{qj})) $$
Optimization objective:
The model minimizes a pairwise loss such as logistic or hinge-style penalties over preference pairs.
Implementation mapping:
XGBoost Pairwiseuses XGBoost'srank:pairwiseobjective.LightGBM Pairwiseuses a LambdaRank configuration tuned toward top-of-list behavior.CatBoost Pairwiseuses CatBoostPairLogit.
Interpretation: This branch directly optimizes pair ordering rather than isolated item labels.
Listwise ranking: XGBoost Listwise, LightGBM Listwise, CatBoost Listwise
Algebraic formulation:
Listwise ranking optimizes the quality of an entire ranked list within group $q$:
$$ \mathcal{L}_{\mathrm{list}} = \sum_q \mathcal{L}\bigl(\pi_q, f(X_q)\bigr) $$
where $\pi_q$ is the target list ordering or graded-relevance structure.
Optimization objective:
These models optimize list-level ranking surrogates aligned more closely with metrics such as NDCG.
Implementation mapping:
XGBoost Listwiseuses an NDCG-oriented grouped ranking configuration.LightGBM Listwiseusesrank_xendcg.CatBoost Listwiseuses CatBoostQuerySoftMax.
Interpretation: This is the most ranking-native objective family in the advanced ranking service.
Pointwise relevance baselines: Random Forest Relevance, Extra Trees Relevance, Gradient Boosting Relevance, AdaBoost Relevance, KNN Relevance, MLP Relevance
Algebraic formulation:
Pointwise relevance baselines learn a scalar relevance scoring function:
$$ \hat{r}{qj} = f(x) $$
and then rank items within query/group $q$ by descending $\hat{r}_{qj}$.
Optimization objective:
These models fit ordinary supervised relevance-score objectives rather than consuming query groups during training:
$$ \min_f \sum_{q,j} \ell(r_{qj}, f(x_{qj})) $$
where $\ell$ is a regression-style relevance loss or an estimator-specific approximation.
Interpretation: These baselines are useful controls because they show how much ranking quality is achievable by scoring each candidate independently. In the implementation they are still evaluated with grouped ranking metrics such as NDCG, MAP, and MRR, but they should not be interpreted as full learning-to-rank objectives.
Network Analysis Families
Graph-feature baseline family: random_forest, gradient_boosting, logistic_regression, mlp, svm, knn
These models operate on structural node features derived from the graph, such as degree, centrality, clustering, and optional user-supplied node attributes.
Algebraic formulation:
Let $G=(V,E)$ be the aggregate graph and let
$$ x_v = g(v, G, A_v) $$
denote the feature vector for node $v$, where $A_v$ contains optional node attributes. A supervised baseline then learns
$$ \hat{y}v = f\theta(x_v) $$
for labeled nodes.
Optimization objective:
The objective depends on the downstream task and selected baseline:
$$ \min_{\theta}\sum_{v \in V_L}\ell(y_v, f_\theta(x_v)) $$
where $V_L$ is the labeled node set and $\ell$ is cross-entropy for classification, squared error for regression-style node scores, or the estimator-specific margin/loss used by SVM or nearest-neighbor baselines.
Interpretation: These models are useful when graph structure can be summarized into node-level features and when graph-native dependencies are unavailable or intentionally skipped.
Phased network diagnostics
Algebraic formulation:
When a phase or wave column is mapped, the service forms phase-specific graphs $G_t=(V_t,E_t)$ for diagnostic comparison while keeping the aggregate graph for the default supervised training contract.
Common phase summaries include:
$$ \rho_t = \frac{|E_t|}{|V_t|(|V_t|-1)} $$
for directed density and
$$ c_t(v) \in {\deg_t(v), b_t(v), \mathrm{close}_t(v), \mathrm{eig}_t(v)} $$
for centrality trajectories of important actors across phases.
Optimization objective:
This is not a predictive model branch. It computes deterministic graph diagnostics from each phase-specific graph:
$$ G_t = (V_t, E_t), \qquad d_t(v)=\sum_u A_{t,vu} $$
There is no learned loss function unless these diagnostics are later passed into a supervised graph-feature baseline.
Interpretation: This is the CAVIAR-style workflow: it explains how graph size, density, components, and central actors change by phase without treating phase as an ordinary predictive feature.
Message-passing GNN family: gcn, graphsage, gat, gin, appnp, chebnet, sgc, tagcn, gatedgcn, armaconv, splinecnn, monet, supergat
Algebraic formulation:
A generic message-passing layer can be written as:
$$ h_v^{(\ell+1)} = \phi\left(h_v^{(\ell)}, \square_{u \in \mathcal{N}(v)} \psi(h_v^{(\ell)}, h_u^{(\ell)}, e_{uv})\right) $$
with family-specific choices for aggregation, normalization, and attention.
Optimization objective:
The live service uses graph-supervised objectives such as node-classification loss over labeled nodes.
Interpretation: This is the core graph-neural-network branch.
Transformer-style graph family: graphormer, graphbert, san, gt
Algebraic formulation:
These models extend attention to graph-structured tokens:
$$ \operatorname{Attention}(Q,K,V)=\operatorname{softmax}\left(\frac{QK^\top + B_{\mathrm{graph}}}{\sqrt{d_k}}\right)V $$
where $B_{\mathrm{graph}}$ encodes structural bias from distances, edges, or positional graph information.
Optimization objective:
The models optimize graph-supervised objectives after attention-based graph representation learning.
Interpretation: This is the graph-transformer branch rather than local message passing only.
Random-walk and embedding family: node2vec, deepwalk, line, sign, graphsaint
Algebraic formulation:
Node2Vec-style objectives learn embeddings from walk-based context:
$$ \max_f \sum_{u \in V} \log \Pr(N_S(u) \mid f(u)) $$
where $N_S(u)$ is a sampled walk neighborhood.
Optimization objective:
These models optimize unsupervised or scalable embedding objectives, then optionally feed downstream supervised tasks.
Interpretation: This branch learns graph structure through sampled contexts rather than full message passing.
Graph autoencoding family: vgae, graph_autoencoder, dgi
Algebraic formulation:
VGAE-style decoders reconstruct adjacency:
$$ \hat{A}_{ij} = \sigma(z_i^\top z_j) $$
with latent variables $z_i$ produced by a graph encoder.
Optimization objective:
VGAE uses variational objectives; related graph autoencoder or mutual-information models such as DGI use reconstruction or contrastive objectives.
Interpretation: This is the graph-representation-learning branch centered on latent structure recovery.
Advanced-Systems Family Status
This appendix covers the advanced-systems inventory at the level of recommendation, ranking, graph, and graphical-model mathematics, optimization or scoring rules, assumptions, and workflow role.