Exercise 1: Credit Data Preparation Prompt Engineering

Objective:

Learn to craft effective prompts for comprehensive credit data preparation and feature engineering.

Background:

Credit Analytics Data Scientists are responsible for preparing and transforming data for credit risk analysis. A key challenge is developing robust data preparation pipelines that handle complex financial data sources.

Exercise:

1. Scenario:

You need to prepare and transform data from multiple sources for a credit risk modeling project that will predict small business loan defaults.

2. Basic Prompt Example:

How should I prepare data for a credit risk model?

3. Prompt Improvement Activity:

  • Identify the limitations of the basic prompt
  • Add specific details about the data sources
  • Include context about the modeling objectives
  • Request structured data preparation methodology
  • Ask for feature engineering recommendations

4. Advanced Prompt Template:

I am a Credit Analytics Data Scientist at a [size] financial institution preparing data for a small business loan default prediction model with these characteristics:

Data sources:
- Internal loan performance data: [size, format, time period]
- Financial statement data: [balance sheets, income statements, cash flow statements]
- Payment history data: [delinquencies, payment patterns]
- Credit bureau data: [business and personal credit reports]
- Macroeconomic data: [indicators, sources, granularity]
- Alternative data: [any non-traditional data sources]

Data challenges:
- Missing values: [extent and patterns of missingness]
- Data quality issues: [inconsistencies, errors, outliers]
- Class imbalance: [default rate in historical data]
- Temporal considerations: [point-in-time vs. current data]
- Regulatory constraints: [data usage limitations, privacy requirements]

Modeling objectives:
- Target variable: 90+ day delinquency within 12 months
- Model type: [logistic regression, machine learning, etc.]
- Interpretability requirements: [need for transparent features]
- Performance goals: [discrimination power, calibration]
- Implementation constraints: [production environment limitations]

Please help me develop a comprehensive data preparation and feature engineering plan by:

1. Outlining a structured data preparation approach that includes:
   - Data exploration methodology
   - Data quality assessment framework
   - Missing value handling strategy
   - Outlier detection and treatment
   - Data integration approach
   - Temporal alignment considerations
   - Train/test/validation splitting strategy

2. For each data source, recommend:
   - Key variables to extract
   - Necessary transformations
   - Quality checks to perform
   - Derived features to create
   - Common pitfalls to avoid
   - Documentation requirements

3. Suggesting feature engineering techniques for:
   - Financial statement data (ratios, trends, volatility measures)
   - Payment behavior (delinquency patterns, utilization metrics)
   - Credit bureau information (score transformations, attribute extraction)
   - Macroeconomic factors (relevant indicators, transformations, lags)
   - Alternative data sources (meaningful signals, transformations)
   - Interaction terms and non-linear transformations

4. Recommending approaches for:
   - Feature selection methodology
   - Multicollinearity assessment
   - Handling class imbalance
   - Point-in-time feature creation
   - Feature stability testing
   - Data pipeline documentation
   - Reproducibility and version control

Format your response as a comprehensive data preparation and feature engineering plan that balances statistical rigor with practical implementation considerations.

5. Evaluation Criteria:

  • Does the prompt clearly describe the data sources and their characteristics?
  • Does it provide context about data challenges and modeling objectives?
  • Does it request a structured data preparation approach?
  • Does it ask for specific feature engineering techniques for each data source?
  • Does it consider practical implementation considerations?

6. Practice Activity:

Create your own advanced prompt for credit data preparation related to:

  1. A retail credit card fraud detection model
  2. A commercial real estate loan loss forecasting model
  3. A consumer loan prepayment prediction model

Exercise 2: Credit Model Development Prompt Engineering

Objective:

Develop skills to craft prompts that help design and implement effective credit risk models using advanced analytics.

Background:

Credit Analytics Data Scientists must develop models that accurately predict credit risk. A key challenge is selecting and implementing appropriate modeling techniques that balance predictive power with interpretability and regulatory compliance.

Exercise:

1. Scenario:

You need to develop a machine learning model to predict early warning signs of credit deterioration in a commercial loan portfolio.

2. Basic Prompt Example:

What machine learning model should I use for early warning signs?

3. Prompt Improvement Activity:

  • Identify the limitations of the basic prompt
  • Add specific details about the commercial loan portfolio
  • Include context about early warning objectives
  • Request structured model development methodology
  • Ask for model evaluation and implementation recommendations

4. Advanced Prompt Template:

I am a Credit Analytics Data Scientist at a [size] financial institution developing a machine learning model to predict early warning signs of credit deterioration in our commercial loan portfolio with these characteristics:

Portfolio details:
- Loan types: [term loans, lines of credit, etc.]
- Industry segments: [distribution across sectors]
- Size range: $[X] to $[Y] in exposure
- Current portfolio performance: [delinquency rates, charge-offs]
- Available historical data: [time period, default events]
- Current early warning approach: [manual reviews, simple rules]

Early warning objectives:
- Prediction horizon: 3-6 months before severe deterioration
- Warning signs to detect: [covenant breaches, payment issues, financial deterioration]
- Desired sensitivity/specificity balance
- Action triggers: [watch list placement, relationship manager notification]
- False positive tolerance: [resource constraints for follow-up]
- Explainability requirements: [need to justify to relationship managers]

Technical constraints:
- Data refresh frequency: [daily, weekly, monthly]
- Implementation environment: [technology stack, processing limitations]
- Integration requirements: [existing systems, workflows]
- Monitoring capabilities: [drift detection, performance tracking]
- Regulatory considerations: [model risk management, fair lending]

Please help me develop a comprehensive credit early warning model by:

1. Recommending appropriate modeling approaches:
   - Comparison of suitable algorithms (tree-based, neural networks, etc.)
   - Pros and cons of each approach for this specific use case
   - Ensemble methods to consider
   - Handling class imbalance in the modeling approach
   - Appropriate threshold selection methodology
   - Recommended approach with rationale

2. Outlining a model development methodology:
   - Feature importance and selection approach
   - Hyperparameter tuning strategy
   - Cross-validation framework
   - Performance metric selection and justification
   - Model stability assessment
   - Interpretability techniques
   - Bias detection and mitigation

3. For the recommended approach, provide:
   - Detailed implementation steps
   - Code structure recommendations
   - Common implementation pitfalls
   - Computational efficiency considerations
   - Testing and quality assurance approach
   - Documentation requirements

4. Suggesting an implementation and deployment strategy:
   - Model scoring process design
   - Alert generation and prioritization
   - Integration with existing workflows
   - User interface considerations
   - Feedback loop mechanisms
   - Monitoring and maintenance approach
   - Periodic retraining framework

Format your response as a comprehensive early warning model development plan that balances predictive power with practical implementation considerations and regulatory requirements.

5. Evaluation Criteria:

  • Does the prompt clearly describe the commercial loan portfolio and early warning objectives?
  • Does it provide context about technical constraints?
  • Does it request comparison of appropriate modeling approaches?
  • Does it ask for detailed implementation steps and deployment strategy?
  • Does it consider regulatory requirements and practical constraints?

6. Practice Activity:

Create your own advanced prompt for credit model development related to:

  1. A behavioral scoring model for credit line management
  2. A loss forecasting model for stress testing
  3. A customer response model for credit marketing campaigns

Exercise 3: Credit Portfolio Analytics Prompt Engineering

Objective:

Learn to craft prompts that help generate actionable insights from credit portfolio data for risk management and strategy.

Background:

Credit Analytics Data Scientists must analyze portfolio data to identify trends, opportunities, and risks. A key challenge is translating complex analytical findings into actionable business insights.

Exercise:

1. Scenario:

You need to develop a comprehensive credit portfolio analysis to identify concentration risks, performance trends, and optimization opportunities.

2. Basic Prompt Example:

How should I analyze our credit portfolio?

3. Prompt Improvement Activity:

  • Identify the limitations of the basic prompt
  • Add specific details about the credit portfolio
  • Include context about analysis objectives
  • Request structured analytical approaches
  • Ask for visualization and communication recommendations

4. Advanced Prompt Template:

I am a Credit Analytics Data Scientist at a [size] financial institution conducting a comprehensive analysis of our credit portfolio with these characteristics:

Portfolio composition:
- Loan types: [consumer, commercial, mortgage, etc.]
- Total exposure: $[X] billion
- Number of accounts: approximately [Y]
- Geographic distribution: [regional concentration]
- Industry sectors: [for commercial portfolio]
- Risk rating distribution: [current risk profile]
- Performance metrics: [delinquency rates, charge-offs by segment]

Analysis objectives:
- Identify concentration risks (geographic, industry, borrower)
- Detect emerging performance trends and early warning signals
- Assess risk-adjusted returns across segments
- Identify optimization opportunities (pricing, exposure limits)
- Support strategic planning and risk appetite setting
- Enhance regulatory reporting and stress testing capabilities

Available data:
- Account-level performance data: [time period, granularity]
- Borrower information: [demographics, financials]
- Collateral details: [for secured lending]
- Pricing and profitability data: [margins, fee income]
- Macroeconomic indicators: [relevant to portfolio performance]
- Risk parameters: [PD, LGD, EAD estimates]

Please help me develop a comprehensive credit portfolio analysis framework by:

1. Recommending key analytical approaches for:
   - Concentration risk assessment (single name, sector, geographic)
   - Vintage analysis and cohort performance tracking
   - Migration analysis and transition matrices
   - Correlation and contagion risk assessment
   - Risk-adjusted return analysis
   - Stress testing and scenario analysis
   - Comparative benchmarking

2. For each analytical approach, provide:
   - Detailed methodology and calculation steps
   - Required data elements and preparation
   - Statistical techniques to employ
   - Interpretation guidelines
   - Common pitfalls and limitations
   - Business implications and action triggers

3. Suggesting effective visualization techniques for:
   - Executive-level portfolio overview
   - Detailed risk manager dashboards
   - Trend analysis and forecasting
   - Concentration visualization
   - Performance attribution
   - Scenario comparison
   - Drill-down capabilities

4. Recommending approaches for:
   - Translating analytical findings into business recommendations
   - Prioritizing identified risks and opportunities
   - Developing actionable insights for different stakeholders
   - Creating effective reporting frameworks
   - Implementing ongoing monitoring mechanisms
   - Measuring impact of portfolio actions

Format your response as a comprehensive credit portfolio analysis framework that balances analytical rigor with practical business application.

5. Evaluation Criteria:

  • Does the prompt clearly describe the credit portfolio and analysis objectives?
  • Does it provide context about available data?
  • Does it request specific analytical approaches with detailed methodologies?
  • Does it ask for effective visualization techniques?
  • Does it consider practical business application of analytical findings?

6. Practice Activity:

Create your own advanced prompt for credit portfolio analytics related to:

  1. A CECL/IFRS 9 provision forecasting analysis
  2. A credit strategy optimization for a specific product line
  3. A competitive analysis of market credit risk and pricing