Homework 08
Before you begin
Homework 08 contains three questions on margins and peer review of an AI skill. The former kernel-tuning question has moved to Homework 09. Homework 08 is evaluated as Complete or Incomplete. For Questions 1 and 2, use either R or Python. You are not expected to use both languages.
For Questions 1 and 2, attempt each question before asking an AI tool for help. You may use AI tools, but you are responsible for checking the work and being able to explain your calculations and plots. For Question 3, use AI to run the assigned skill, but write the peer review yourself.
Download the materials
The former kernel-tuning question has moved to Homework 09.
Solutions for Questions 1 and 2 are included in the combined ZIP. No solution will be provided for Question 3.
For Questions 1 and 2, use either R or Python.
Question 1: Boundary and margin
Use margin-geometry-20.csv from the combined ZIP, which contains 20 observations with predictors and class labels . Consider the score
Since , the lines are each a distance 1 from the decision boundary .
Calculate the distance from every observation to the decision boundary and its functional margin . In a table, report these values and whether each observation is inside, on, or beyond the margin for its class. Compare with 1 to make this distinction.
Plot the observations, the boundary , and the margin lines . Distinguish the two classes and identify the observations inside the margin in your plot.
Report how many observations are inside, on, and beyond the margin. Which observations are misclassified by this decision rule?
Use the observation numbers supplied in the data. Set the axis to , set the axis to , and use an equal aspect ratio. Do not fit a new classifier for this question.
Question 2: Margin in four dimensions
Use margin-geometry-4d.csv from the combined ZIP, which contains 50 observations with four predictors and class labels . Consider the linear score
Project the observations onto the direction of and plot their positions on one axis. Distinguish the two classes and mark the decision boundary. Use the plot to calculate the geometric margin , the distance from the boundary to the closest observation.
Express the same decision boundary using the SVM normalization in which the smallest functional margin is set to 1. What are the corresponding values of and ?
Question 3: Peer review of a Homework 7 skill
The instructor’s GitHub account, rqzhu-aide, will open a GitHub Issue in the repository containing your Homework 7 submission. It will link to one assigned student’s repository.
Use the skill. Find the complete skill definition in the assigned student’s Homework 7 report. Copy it without changes into a local
SKILL.mdfile in your own folder. You do not need to install it. Give your agent the path to the file and explicitly ask it to follow that skill while analyzing theSAheartdata, using the response and predictor coding from Homework 7. Provide the necessary data information, but no additional preferences about methods, figures, model selection, or report style. Let the skill direct the analysis.Monitor the time, your token use, and your weekly quota while the agent works. If the run is taking too long or using your allowance too quickly, you may send a steer message asking the agent to finish immediately, or stop the run and summarize what you observed. A steer message redirects an agent while it is working; learn how to send one in your AI tool before starting.
Write a peer review. Read the student’s submitted report and what the skill produced in your run. Give a brief overall assessment, followed by three major items the author could improve. You may comment on any aspect of the skill or report. For each item, explain what you observed, why it matters, and what you recommend changing. If you stopped the run early, explain where and why. Write the review yourself, without AI assistance.
Share your review. Open a GitHub Issue in the assigned student’s Homework 7 repository containing your review. Copy the same review into your Homework 8 submission report and include a link to the GitHub Issue.