Homework 1
Question 2.1
Describe a situation or problem from your job, everyday life, current events, etc., for
which a classification model would be appropriate. List some (up to 5) predictors that
you might use.
I run Seba AI, an agency that builds AI voice agents for small and mid-sized
businesses. Inbound leads come in through cold outreach replies, referrals, and our
website, but only a fraction of those leads ever convert into a paid pilot. A binary
classification model, will this lead convert to a paid pilot within 60 days, yes or no?,
would help me decide which leads to invest sales time in, and which to nurture
passively or disqualify early. Predictors I would use:
• Monthly inbound call volume (quantitative): a proxy for how acute the customer's
pain is. Businesses fielding 500+ calls a month feel the cost of missed calls and
long wait times directly, and tend to move faster.
• Industry vertical (categorical): voice agents perform better in some verticals than
others. Home services and healthcare scheduling convert at a much higher rate in
our pilot data than, say, professional services.
• Lead source (categorical: cold outreach / referral / inbound): referrals and inbound
leads have higher intent than cold-outreach replies, almost by definition.
• Contact's title / seniority (categorical or ordinal: owner-founder / VP / manager /
individual contributor): founder-owners of small businesses can make the buy
decision in a single call. The deeper the org chart sits between the contact and the
budget, the longer the sales cycle and the lower the close rate.
• Existing automation stack (binary: already using an AI / CRM / scheduling tool,
yes / no): leads who have already adopted some automation are more likely to add
another layer than leads who are fully manual and resistant.
Question 2.2
Part 1, Linear SVM (kernlab::ksvm, vanilladot)
Methodology
I loaded the 654-row credit-card dataset (10 predictors, binary response R1) and
converted the predictors to a numeric matrix and the response to a factor. I fit a linear
soft-margin SVM with kernlab::ksvm using type = "C-svc", kernel = "vanilladot", and scaled =
TRUE so that ksvm standardizes each predictor internally before fitting. I swept C across
ten orders of magnitude (1e-6, 1e-4, 1e-2, 0.1, 1, 10, 100, 1000, 1e4, 1e6), measured full-
data accuracy for each value, and tracked whether predictions collapsed to all-0 or all-1.
To recover the classifier equation I used a = colSums(model@xmatrix[[1]] *
model@coef[[1]]) and a0 = -model@b. These coefficients live in the standardized feature
, space that ksvm uses internally; I also computed the equivalent equation in the original
feature units by dividing each a_j by the column's standard deviation and adjusting the
intercept (a0_orig = a0 - sum(a * mu / sd)).
Results
C sweep on full-data accuracy:
Accurac
C y Predictions collapsed?
1e-6 0.5474 YES (all 0)
1e-4 0.5474 YES (all 0)
1e-2 0.8639 no
1e-1 0.8639 no
1 0.8639 no
10 0.8639 no
100 0.8639 no
1e3 0.8624 no
1e4 0.8624 no
1e6 0.6254 no
Accuracy is flat at 0.8639 across five orders of magnitude (C from 0.01 to 100), drops
slightly at C = 1000, 10000, and degrades sharply at C = 1e6 where the optimizer
effectively over-weights individual margin violations. I chose C = 1 because it sits in the
middle of the plateau, comfortably away from both the all-zero collapse region and the
high-C degradation region. Picking the edge of a plateau is riskier because small
numerical perturbations can flip the solution; the middle of the plateau is the stable
choice.
Question 2.1
Describe a situation or problem from your job, everyday life, current events, etc., for
which a classification model would be appropriate. List some (up to 5) predictors that
you might use.
I run Seba AI, an agency that builds AI voice agents for small and mid-sized
businesses. Inbound leads come in through cold outreach replies, referrals, and our
website, but only a fraction of those leads ever convert into a paid pilot. A binary
classification model, will this lead convert to a paid pilot within 60 days, yes or no?,
would help me decide which leads to invest sales time in, and which to nurture
passively or disqualify early. Predictors I would use:
• Monthly inbound call volume (quantitative): a proxy for how acute the customer's
pain is. Businesses fielding 500+ calls a month feel the cost of missed calls and
long wait times directly, and tend to move faster.
• Industry vertical (categorical): voice agents perform better in some verticals than
others. Home services and healthcare scheduling convert at a much higher rate in
our pilot data than, say, professional services.
• Lead source (categorical: cold outreach / referral / inbound): referrals and inbound
leads have higher intent than cold-outreach replies, almost by definition.
• Contact's title / seniority (categorical or ordinal: owner-founder / VP / manager /
individual contributor): founder-owners of small businesses can make the buy
decision in a single call. The deeper the org chart sits between the contact and the
budget, the longer the sales cycle and the lower the close rate.
• Existing automation stack (binary: already using an AI / CRM / scheduling tool,
yes / no): leads who have already adopted some automation are more likely to add
another layer than leads who are fully manual and resistant.
Question 2.2
Part 1, Linear SVM (kernlab::ksvm, vanilladot)
Methodology
I loaded the 654-row credit-card dataset (10 predictors, binary response R1) and
converted the predictors to a numeric matrix and the response to a factor. I fit a linear
soft-margin SVM with kernlab::ksvm using type = "C-svc", kernel = "vanilladot", and scaled =
TRUE so that ksvm standardizes each predictor internally before fitting. I swept C across
ten orders of magnitude (1e-6, 1e-4, 1e-2, 0.1, 1, 10, 100, 1000, 1e4, 1e6), measured full-
data accuracy for each value, and tracked whether predictions collapsed to all-0 or all-1.
To recover the classifier equation I used a = colSums(model@xmatrix[[1]] *
model@coef[[1]]) and a0 = -model@b. These coefficients live in the standardized feature
, space that ksvm uses internally; I also computed the equivalent equation in the original
feature units by dividing each a_j by the column's standard deviation and adjusting the
intercept (a0_orig = a0 - sum(a * mu / sd)).
Results
C sweep on full-data accuracy:
Accurac
C y Predictions collapsed?
1e-6 0.5474 YES (all 0)
1e-4 0.5474 YES (all 0)
1e-2 0.8639 no
1e-1 0.8639 no
1 0.8639 no
10 0.8639 no
100 0.8639 no
1e3 0.8624 no
1e4 0.8624 no
1e6 0.6254 no
Accuracy is flat at 0.8639 across five orders of magnitude (C from 0.01 to 100), drops
slightly at C = 1000, 10000, and degrades sharply at C = 1e6 where the optimizer
effectively over-weights individual margin violations. I chose C = 1 because it sits in the
middle of the plateau, comfortably away from both the all-zero collapse region and the
high-C degradation region. Picking the edge of a plateau is riskier because small
numerical perturbations can flip the solution; the middle of the plateau is the stable
choice.