Scenario A: Policy non-renewal
Business requirement:
Predict whether an active policy will fail to renew.
Dataset:
| CustomerAge | Premium | Claims | Complaints | DidNotRenew |
|---|---|---|---|---|
| 32 | 12,500 | 0 | 0 | No |
| 51 | 22,000 | 3 | 4 | Yes |
| 44 | 16,500 | 1 | 1 | No |
Decision:
Known historical label? Yes
Label type? Yes/No
Correct task? Supervised binary classification
Possible ML.NET structure:
public sealed class PolicyRenewalInput
{
public float CustomerAge { get; set; }
public float PremiumAmount { get; set; }
public float ClaimCount { get; set; }
public float ComplaintCount { get; set; }
public bool DidNotRenew { get; set; }
}
Scenario B: Support-ticket routing
Requirement:
Predict which department should handle a new ticket.
Possible labels:
Billing
Technical
Sales
General
Decision:
Known historical label? Yes
Label type? One of four categories
Correct task? Supervised multiclass classification
C# representation:
public sealed class SupportTicketInput
{
public string TicketText { get; set; } = string.Empty;
public string Department { get; set; } = string.Empty;
}
Scenario C: Predict resolution time
Requirement:
Estimate how many minutes a support ticket will require.
Historical label:
ResolutionMinutes = 47
Decision:
Known historical label? Yes
Label type? Numeric quantity
Correct task? Supervised regression
C# representation:
public sealed class TicketResolutionInput
{
public float PreviousCustomerTickets { get; set; }
public float AssignedEngineerExperience { get; set; }
public float TicketComplexityScore { get; set; }
public float ResolutionMinutes { get; set; }
}
Scenario D: Discover insurance customer groups
Requirement:
We do not have customer categories. Discover customers with similar behaviour.
Available data-
Premium amount
Claim count
Complaint count
Renewal history
Payment-delay count
Policy count
Known label? No
Required goal? Discover similar groups
Correct task? Unsupervised clustering
public sealed class CustomerBehaviour
{
public float PremiumAmount { get; set; }
public float ClaimCount { get; set; }
public float ComplaintCount { get; set; }
public float RenewalCount { get; set; }
public float PaymentDelayCount { get; set; }
}
A clustering pipeline may later look like:
using Microsoft.ML;
var mlContext = new MLContext(seed: 42);
var pipeline = mlContext.Transforms
.Concatenate(
"Features",
nameof(CustomerBehaviour.PremiumAmount),
nameof(CustomerBehaviour.ClaimCount),
nameof(CustomerBehaviour.ComplaintCount),
nameof(CustomerBehaviour.RenewalCount),
nameof(CustomerBehaviour.PaymentDelayCount))
.Append(
mlContext.Clustering.Trainers.KMeans(
featureColumnName: "Features",
numberOfClusters: 3));
New term:
K-Means is a clustering algorithm that attempts to organize records around a chosen number of group centres.
Here:
numberOfClusters: 3
means we ask it to find three groups. It does not prove that three is the perfect business answer.
We will train and evaluate clustering models in a later practical module.
Scenario E: Adaptive Assessment OS
Requirement:
Select the next exam-practice question based on the candidate’s changing skill level.
Possible RL design:
| RL element | Assessment example |
|---|---|
| Agent | Adaptive-question engine |
| Environment | Candidate and assessment session |
| State | Topic mastery, recent answers, time spent |
| Action | Select the next question |
| Reward | Measured learning improvement |
| Policy | Learned question-selection strategy |
But this has substantial risks:
- An experimental policy could disadvantage candidates.
- Exam marks are not necessarily a valid learning reward.
- Different candidates may receive unfair experiences.
- Production exploration may be unacceptable.
- Regulatory assessment rules may require deterministic delivery.
Therefore, for formal examinations:
Approved deterministic exam rules
+
Supervised risk or performance models
+
Human oversight
may be safer than unrestricted reinforcement learning.
RL could first be explored in a non-certification practice simulator.
Build a reusable C# task selector
This code documents the reasoning before algorithm selection:
public enum LearningApproach
{
DeterministicSoftware,
SupervisedClassification,
SupervisedRegression,
UnsupervisedClustering,
ReinforcementLearning
}
public sealed record ProblemProfile(
bool HasHistoricalLabel,
bool LabelIsCategory,
bool LabelIsNumericQuantity,
bool NeedsHiddenGroups,
bool HasSequentialActionsAndRewards);
public static class LearningApproachSelector
{
public static LearningApproach Select(ProblemProfile problem)
{
if (problem.HasSequentialActionsAndRewards)
return LearningApproach.ReinforcementLearning;
if (problem.HasHistoricalLabel && problem.LabelIsCategory)
return LearningApproach.SupervisedClassification;
if (problem.HasHistoricalLabel &&
problem.LabelIsNumericQuantity)
return LearningApproach.SupervisedRegression;
if (!problem.HasHistoricalLabel && problem.NeedsHiddenGroups)
return LearningApproach.UnsupervisedClustering;
return LearningApproach.DeterministicSoftware;
}
}
Usage:
var renewalProblem = new ProblemProfile(
HasHistoricalLabel: true,
LabelIsCategory: true,
LabelIsNumericQuantity: false,
NeedsHiddenGroups: false,
HasSequentialActionsAndRewards: false);
var result = LearningApproachSelector.Select(renewalProblem);
Console.WriteLine(result);
Expected output:
SupervisedClassification
This selector is a learning aid, not a universal production decision engine. Real selection also depends on data quality, risk, cost and business action.