1 / 15

Hands-On Prompt Engineering Workshop

TeleConnect Customer Churn Analysis

Workshop Overview

Apply prompt engineering techniques to solve a real business analytics problem using the TeleConnect customer churn dataset from previous weeks.

Duration

60 minutes total

  • Setup: 5 minutes
  • Challenges: 50 minutes
  • Debrief: 5 minutes

What You'll Need

  • TeleConnect churn dataset
  • AI platform (ChatGPT/Claude/Gemini)
  • Document for tracking prompts
  • Critical thinking mindset

Workshop Setup

5 minutes

Before You Begin

  1. Access the TeleConnect customer churn dataset
  2. Review the business problem and analysis goals
  3. Choose your AI platform (ChatGPT, Claude, Gemini, etc.)
  4. Open a document to track your prompts and iterations

Dataset Reminder: TeleConnect Churn Data

50 customers with 14 features including CustomerID, Age, Gender, MonthlyCharges, TotalCharges, ContractLength, DataUsageGB, CustomerServiceCalls, PaymentMethod, AccountAge, InternationalPlan, DeviceProtection, StreamingService, and Churn.

Business Context: TeleConnect is a regional telecom company with 20% annual churn rate. Your analysis will help reduce customer loss and improve profitability.

Four Progressive Challenges

Each challenge builds on prompt engineering skills:

Challenge Focus Time Key Skill
1. Data Understanding Explore dataset structure 10 min CRAFT framework, clear instructions
2. Causal Analysis Identify confounders & causation 15 min Chain of Thought, domain knowledge
3. Model Interpretation Explain ML results 15 min Audience awareness, format specification
4. Code Generation Production-ready code 10 min Technical precision, quality requirements

Remember

Document all your prompts and iterations. The learning is in the refinement process, not just the final output.

Challenge 1: Data Understanding

10 minutes

Scenario

You're a new analyst at TeleConnect. You need to understand the customer churn dataset quickly to begin your analysis.

Your Task

Write a prompt to get the AI to:

  1. Explain what each feature in the dataset represents
  2. Identify which features are likely most important for predicting churn
  3. Suggest potential data quality issues to check
  4. Recommend appropriate visualizations for exploring the data

Requirements

Challenge 1: Deliverables

What to Submit

  1. Your prompt (documented with clear structure)
  2. AI's response
  3. Your evaluation: Did it provide actionable insights?

Sample Starter Prompt (Improve This!)

You are a data analyst at TeleConnect, a regional telecom company. We have a customer churn dataset with 50 customers and these columns: [CustomerID, Age, Gender, MonthlyCharges, TotalCharges, ContractLength, DataUsageGB, CustomerServiceCalls, PaymentMethod, AccountAge, InternationalPlan, DeviceProtection, StreamingService, Churn]. Churn rate is currently 20%, impacting profitability. Analyze this dataset structure and provide: 1. Business interpretation of each feature 2. Hypotheses about which features predict churn 3. Potential data quality issues to investigate 4. 3-5 visualizations that would reveal important patterns Format as a structured analysis plan.

Challenge: How can you improve this prompt using CRAFT principles?

Challenge 2: Causal Analysis Support

15 minutes

Scenario

Using concepts from Week 4 on Causal Machine Learning, you need to understand which factors actually CAUSE churn versus just correlate with it.

Your Task

Write a prompt to get the AI to:

  1. Explain the difference between correlation and causation in this context
  2. Identify potential confounders in the churn dataset
  3. Suggest how to test for causal relationships
  4. Design an intervention strategy based on causal factors

Requirements

Challenge 2: Deliverables

What to Submit

  1. Your prompt
  2. AI's response
  3. Identification of at least 2 potential confounders
  4. One testable causal hypothesis

Sample Starter Prompt (Improve This!)

Role: You are a causal inference expert analyzing customer churn. Context: TeleConnect has a dataset showing: - Customers with month-to-month contracts have higher churn - Customers with more customer service calls have higher churn - Customers with higher monthly charges have lower churn Task: Using causal inference principles: 1. Identify potential confounders that might affect these relationships 2. Explain the difference between "ContractLength is correlated with churn" vs "ContractLength causes churn" 3. Design a way to test if offering longer contracts would actually reduce churn (not just identify people who were going to stay anyway) 4. Recommend a business intervention based on causal factors Format: Use step-by-step reasoning. Explain concepts in business terms, then provide technical detail.

Challenge 3: Predictive Model Interpretation

15 minutes

Scenario

Your Random Forest model has identified the top churn predictors. You need to explain the results to non-technical stakeholders.

Given Model Output

Feature Importances: - CustomerServiceCalls: 0.28 - MonthlyCharges: 0.22 - ContractLength: 0.19 - AccountAge: 0.15 - PaymentMethod: 0.09 - DataUsageGB: 0.07

Your Task

Write a prompt to get the AI to:

  1. Translate these feature importances into business language
  2. Explain WHY each factor might influence churn
  3. Distinguish between controllable and uncontrollable factors
  4. Suggest specific retention strategies for the top 3 factors
  5. Create a risk scoring framework for identifying at-risk customers

Challenge 3: Requirements & Deliverables

Requirements

What to Submit

  1. Your prompt
  2. AI's response
  3. A mini "executive briefing" (1 page max) explaining the model
  4. 3 specific, implementable retention strategies

Critical Thinking Check

Don't just accept the AI's output. Evaluate:

  • Does the business interpretation make sense?
  • Are the recommendations actually actionable?
  • Would a non-technical person understand this?

Challenge 3: Sample Starter Prompt

Audience: You're presenting to TeleConnect's C-suite executives who have no data science background. Context: We built a Random Forest model to predict customer churn. The model achieved 85% accuracy. Feature importances are: [paste data from previous slide] Task: Create an executive briefing that includes: 1. "What These Numbers Mean" - Explain feature importance in plain English Example format: "CustomerServiceCalls (0.28) means..." 2. "Why This Matters" - Business interpretation of why each top factor drives churn 3. "What We Can Control" - Distinguish controllable vs. uncontrollable factors 4. "Recommended Actions" - 3 specific retention strategies targeting the top factors For each strategy: - What to do - Why it should work (based on the model) - How to measure success 5. "Risk Scoring Framework" - Simple rules for sales teams to flag at-risk customers Example: "High Risk if [conditions]" Tone: Confident but not overly technical. Use analogies where helpful. Length: 2 pages maximum, bullet points preferred. Include a "TL;DR" summary at the top.

Challenge 4: Code Generation with Quality Checks

10 minutes

Scenario

You need to generate Python code to implement the top retention strategy, but you want the AI to help you write high-quality, production-ready code.

Your Task

Write a prompt to get the AI to:

  1. Generate Python code for a specific churn intervention
  2. Include data validation and error handling
  3. Add comprehensive comments and documentation
  4. Suggest unit tests for the code
  5. Explain potential edge cases or limitations

Requirements

Challenge 4: Deliverables & Starter Prompt

What to Submit

  1. Your prompt
  2. Generated code
  3. Your testing notes: Did you find any issues? Would you use this in production?

Sample Starter Prompt (Improve This!)

Task: Generate production-ready Python code to identify at-risk customers and recommend personalized retention offers. Context: - Dataset: customer_churn.csv with 50 customers, 14 features - Goal: Score each customer's churn risk and suggest retention actions - Environment: Python 3.10, pandas, scikit-learn available - This code will be run weekly by the retention team Requirements: 1. Load and validate the data - Check for required columns - Handle missing values appropriately - Validate data types 2. Calculate risk score for each customer based on these rules: [Define rules based on model insights from Challenge 3] 3. Assign retention strategies: - High risk + high service calls → Proactive customer service - High risk + month-to-month contract → Contract upgrade offer - High risk + high monthly charges → Pricing review 4. Output: CSV with CustomerID, RiskScore, RecommendedAction, Priority Code Quality Requirements: - Include comprehensive docstrings - Add inline comments explaining business logic - Implement error handling for common issues - Use type hints - Follow PEP 8 style guidelines - Include logging for debugging Also provide: - Example unit tests for key functions - List of potential edge cases or limitations - Instructions for running the code Explain any design decisions you made and why.

Workshop Debrief

5 minutes

Group Discussion Questions

1. Prompt Evolution

  • How did your prompts improve through the challenges?
  • What techniques worked best?

2. Output Quality

  • How accurate and useful were the AI's responses?
  • What verification steps did you need to take?

3. Efficiency Gains

  • How much time did AI assistance save?
  • Where did it slow you down?

4. Learning Insights

  • What did you learn about the business problem?
  • Did AI enhance or hinder your understanding?

5. Professional Application

  • How would you use these techniques in Assessment 2?
  • What ethical considerations came up?

Workshop Wrap-Up & Takeaways

Key Lessons from Today's Workshop

  • Structured prompts produce better results - CRAFT framework works
  • Iteration is essential - First prompts are rarely optimal
  • Context is king - The more relevant information, the better
  • Verification is mandatory - AI can be confidently wrong
  • AI amplifies your skills - It's most powerful when you understand the domain

Applying to Assessment 2 (Due Next Week)

  1. Use AI to accelerate, not replace, your analysis
  2. Document your prompts to demonstrate your thinking
  3. Verify all outputs, especially statistics and code
  4. Focus on learning - understand what the AI produces
  5. Cite AI assistance appropriately in your submission

Resources for Continued Learning

Prompt Engineering Guides

  • OpenAI Prompt Engineering Guide
  • Anthropic Claude Prompt Library
  • Learn Prompting (free course)

Technical Documentation

  • EconML Documentation
  • SHAP Documentation
  • Python Data Science Handbook

Assessment 2 Reminder

Title: Generative AI Startup Project (35%)

Due: Week 9

Focus: Predictive & Prescriptive Analytics for Business Decision Making

AI Use Guidelines for Assessment 2

  • ✅ Use AI to help understand concepts and generate code
  • ✅ Document your prompts and AI interactions
  • ✅ Verify and understand all AI-generated content
  • ❌ Don't submit AI output without verification and understanding
  • ❌ Don't use AI to avoid learning the core concepts

Remember: Academic integrity is crucial. You must understand the work you submit and be able to explain your analysis decisions.