Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ check: copyright format lint test verify-copyright verify-exposed-credentials en
.PHONY: docs quarto-docs

notebook:
@python notebooks/templates/e2e_template.py
poetry run python notebooks/templates/e2e_template.py
git status | grep -v 'notebooks/templates'
223 changes: 223 additions & 0 deletions notebooks/code_samples/capital_markets/capital_markets_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
- id: model_metadata
title: Model Metadata and Stakeholders
index_only: true
sections:
- id: metadata
title: Metadata
parent_section: model_metadata
guidelines:
- Provide detailed metadata to uniquely identify the model, ensuring
that each entry is traceable and consistent with internal records.
- Specify the platform to enable validation and governance teams to
understand technical dependencies.
- Metadata should be aligned with enterprise systems (e.g., Model Risk
Management System).
- Be specific about versioning and any platform customizations.
- id: stakeholders
title: Stakeholders
parent_section: model_metadata
guidelines:
- List all individuals responsible for the development, use, and
oversight of the model.
- Ensure clarity in responsibilities to avoid overlap and gaps in
accountability.
- Include specific roles, such as "Data Scientist," "Validation Lead,"
or "Business Analyst," and describe their responsibilities relative to
the model.
- id: business_context
title: Business Context and Purpose
index_only: true
sections:
- id: business_problem
title: Business Problem and Objectives
parent_section: business_context
guidelines:
- Clearly describe the problem the model addresses and its alignment
with business goals.
- Include specific use cases, outputs, and highlight regulatory
expectations to demonstrate compliance.
- Specify compliance requirements, such as IFRS, Basel III or SR11-7, as
applicable.
- id: products_and_risks
title: Products and Risks
parent_section: business_context
guidelines:
- Detail how the model impacts products or processes and specify
associated risks (e.g., market, credit, or operational risks).
- Provide a description of business impacts and compliance with
applicable regulations.
- id: model_design
title: Model Methodology and Design
index_only: true
sections:
- id: theoretical_foundations
title: Theoretical Foundations
parent_section: model_design
guidelines:
- Explain the methodology, assumptions, and logic underlying the model.
- Clearly document how key risks (e.g., credit default or liquidity) are
addressed within the model.
- Highlight any simplifications or approximations and their implications.
- id: architecture
title: Model Architecture
parent_section: model_design
guidelines:
- Use diagrams to illustrate the model's structure and data flow.
- Include visual flowcharts detailing how inputs are transformed into
outputs.
- Highlight dependencies affecting validation or performance.
- id: selection
title: Model Selection and Justification
parent_section: model_design
guidelines:
- Document the decision-making process, including comparisons to
alternative approaches.
- Provide rationale for model selection using performance metrics like
R-squared or RMSE.
- Highlight reasons for rejecting alternatives.
- id: model_data
title: Model Data
index_only: true
sections:
- id: input_data
title: Input Data
parent_section: model_data
guidelines:
- Detail the provenance and quality of input data, including
preprocessing steps like imputation or outlier detection.
- Highlight known issues, such as stale data or incomplete time series.
- Suggest standard tests, e.g., null value checks, distribution
matching, or correlation analysis.
- id: dataset_characteristics
title: Development Dataset
parent_section: model_data
guidelines:
- Summarize dataset characteristics like size, representativeness, and
scope.
- Include validation metrics such as sampling error or coverage ratios.
- id: outputs
title: Outputs
parent_section: model_data
guidelines:
- Define outputs, their usage, and storage mechanisms.
- Highlight data formats (e.g., APIs, flat files) and ensure outputs are
validated for consistency and accuracy.
- id: model_testing
title: Model Testing
index_only: true
sections:
- id: diagnostic_testing
title: Diagnostic Testing
parent_section: model_testing
guidelines:
- Provide details of diagnostic tests performed to ensure model
performance and identify anomalies.
- Include standard diagnostic tests such as - Residual analysis to check
model predictions. - Comparison of predicted versus actual outcomes
for validity.
- Summarize findings and highlight any performance gaps.
- id: sensitivity_stress_testing
title: Sensitivity and Stress Testing
parent_section: model_testing
guidelines:
- Sensitivity Testing. Describe how changes in input variables affect
model outputs.
- Stress Testing. Document model performance under extreme conditions or
assumptions.
- Use tests to measure how minor changes in key parameters affect
results.
- Simulate scenarios like extreme economic downturns to evaluate
robustness.
- id: performance_testing
title: Performance Testing
parent_section: model_testing
guidelines:
- Provide details of performance metrics such as RMSE, AUC, or
precision/recall.
- Benchmark comparisons. Compare performance with industry standards or
alternative models.
- Include visual aids like ROC curves or confusion matrices to
illustrate performance.
- id: back_testing
title: Back-Testing
parent_section: model_testing
guidelines:
- Highlight alignment of predictions with observed outcomes through
historical analysis.
- Test model predictions against historical data outcomes.
- Document discrepancies and propose remediation steps.
- id: implementation
title: Model Implementation
index_only: true
sections:
- id: production_environment
title: Production Environment
parent_section: implementation
guidelines:
- Describe the implementation environment, such as cloud platforms like
AWS or GCP.
- Highlight integration points, such as database connectors or REST
APIs, ensuring consistency with design specifications.
- id: implementation_testing
title: Implementation Testing
parent_section: implementation
guidelines:
- Document verification steps, including parallel runs against legacy
systems and end-to-end pipeline testing.
- id: limitations_adjustments
title: Assumptions, Limitations, and Adjustments
index_only: true
sections:
- id: assumptions
title: Assumptions
parent_section: limitations_adjustments
guidelines:
- List assumptions critical to model functionality and provide
justifications.
- Include potential impact analyses if assumptions fail.
- id: limitations
title: Limitations
parent_section: limitations_adjustments
guidelines:
- Highlight known limitations and mitigation strategies.
- Discuss implications for model performance or reliability.
- id: adjustments
title: Adjustments
parent_section: limitations_adjustments
guidelines:
- Document overrides and their justification, including governance
processes.
- id: monitoring_controls_documentation
title: Model Monitoring and Controls
index_only: true
sections:
- id: ongoing
title: Ongoing Model Monitoring
parent_section: monitoring_controls_documentation
guidelines:
- Outline a monitoring plan, including performance metrics, monitoring
frequency, and escalation thresholds.
- Include drift analysis of input data distributions and stability
metrics for output consistency.
- id: governance
title: Governance
parent_section: monitoring_controls_documentation
guidelines:
- Define access controls, version management, and governance frameworks.
- Highlight periodic audits and role-based access controls.
- id: documentation_references
title: Documentation References
index_only: true
sections:
- id: supporting_documents
title: Supporting Documents
parent_section: documentation_references
guidelines:
- Provide references to related documentation, such as validation
reports.
- Maintain a change log for systematic traceability.
- id: appendices
title: Appendices
parent_section: documentation_references
guidelines:
- Use appendices for supplementary data, testing results, and glossaries.
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,25 @@
"\n",
"1. In the left sidebar that appears for your model, click **Documents** and select **Documentation**.\n",
"\n",
"2. Under **TEMPLATE**, select `Capital markets`.\n",
"2. Under **TEMPLATE**, select `Capital Markets`.\n",
"\n",
"3. Click **Use Template** to apply the template."
]
},
{
"cell_type": "markdown",
"id": "41c4edca",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\" style=\"background-color: #B5B5B510; color: black; border: 1px solid #083E44; border-left-width: 5px; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);border-radius: 5px;\"><span style=\"color: #083E44;\"><b>Can't select this template?</b></span>\n",
"<br></br>\n",
"Your organization administrators may need to add it to your template library:\n",
"<ul>\n",
"<li><a href=\"capital_markets_template.yaml\" style=\"color: #DE257E;\"><b>Download Template YAML</b></a></li>\n",
"<li><a href=\"https://docs.validmind.ai/guide/templates/customize-document-templates.html\" style=\"color: #DE257E;\"><b>Customize Document Templates</b></a></li>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "2012eb82",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
- id: code_overview
title: Codebase Overview
guidelines:
- Describe the overall structure of the source code repository.
- Identify main modules, folders, and scripts.
- Highlight entry points for training, inference, and evaluation.
- State the main programming languages and frameworks used.
contents:
- content_type: text
content_id: code_structure_summary
- id: model_overview
title: Model Overview
guidelines:
- Describe the overall structure of the source code repository.
- Identify main modules, folders, and scripts.
- Highlight entry points for training, inference, and evaluation.
- State the main programming languages and frameworks used.
contents:
- content_type: text
content_id: model_overview
- id: environment_setup
title: Environment and Dependencies
guidelines:
- List Python packages and system dependencies (OS, compilers, etc.).
- Reference environment files (requirements.txt, environment.yml,
Dockerfile).
- Include setup instructions using Conda, virtualenv, or containers.
contents:
- content_type: text
content_id: setup_instructions
- id: data_interface
title: Data Ingestion and Preprocessing
guidelines:
- Specify data input formats and sources.
- Document ingestion, validation, and transformation logic.
- Explain how raw data is preprocessed and features are generated.
contents:
- content_type: text
content_id: data_handling_notes
- id: model_implementation
title: Model Implementation Details
guidelines:
- Describe the core model code structure (classes, functions).
- Link code to theoretical models or equations when applicable.
- Note custom components like loss functions or feature selectors.
contents:
- content_type: text
content_id: model_code_description
- id: training_pipeline
title: Model Training Pipeline
guidelines:
- Explain the training process, optimization strategy, and hyperparameters.
- Describe logging, checkpointing, and early stopping mechanisms.
- Include references to training config files or tuning logic.
contents:
- content_type: text
content_id: training_logic_details
- id: evaluation_pipeline
title: Evaluation and Validation Code
guidelines:
- Describe how validation is implemented and metrics are calculated.
- Include plots and diagnostic tools (e.g., ROC, SHAP, confusion matrix).
- State how outputs are logged and persisted.
contents:
- content_type: text
content_id: evaluation_logic_notes
- id: inference_pipeline
title: Inference and Scoring Logic
guidelines:
- Detail how the trained model is loaded and used for predictions.
- Explain I/O formats and APIs for serving or batch scoring.
- Include any preprocessing/postprocessing logic required.
contents:
- content_type: text
content_id: inference_mechanism
- id: configuration_management
title: Configuration and Parameters
guidelines:
- Describe configuration management (files, CLI args, env vars).
- Highlight default parameters and override mechanisms.
- Reference versioning practices for config files.
contents:
- content_type: text
content_id: config_control_notes
- id: testing_and_validation
title: Unit and Integration Testing
guidelines:
- List unit and integration tests and what they cover.
- Mention testing frameworks and coverage tools used.
- Explain testing strategy for production-readiness.
contents:
- content_type: text
content_id: test_strategy_overview
- id: logging
title: Logging and Monitoring Hooks
guidelines:
- Describe logging configuration and structure.
- Highlight real-time monitoring or observability integrations.
- List key events, metrics, or alerts tracked.
contents:
- content_type: text
content_id: logging_notes
- id: version_control
title: Code and Model Versioning
guidelines:
- Describe Git usage, branching, tagging, and commit standards.
- Include model artifact versioning practices (e.g., DVC, MLflow).
- Reference any automation in CI/CD.
contents:
- content_type: text
content_id: version_tracking_description
- id: security_and_compliance
title: Security and Access Control
guidelines:
- Document access controls for source code and data.
- Include any encryption, PII handling, or compliance measures.
- Mention secure deployment practices.
contents:
- content_type: text
content_id: security_policies_notes
- id: execution_examples
title: Example Runs and Scripts
guidelines:
- Provide working script examples (e.g., `train.py`, `predict.py`).
- Include CLI usage instructions or sample notebooks.
- Link to demo datasets or test scenarios.
contents:
- content_type: text
content_id: runnable_examples
- id: known_issues_and_todos
title: Known Issues and Future Improvements
guidelines:
- List current limitations or technical debt.
- Outline proposed enhancements or refactors.
- Reference relevant tickets, GitHub issues, or roadmap items.
contents:
- content_type: text
content_id: issues_and_improvements_log
Loading