\(~\)

Directions:

Question #1 (Weighted Averages and Python Skills)

Consider the weighted average: \[ \bar{x}_w = \frac{\sum_{i=1}^{n} w_i x_i}{\sum_{i=1}^{n}w_i}\]

where \(w_i = e^{\theta x_i}\)

\(~\)

Question #2 (Data preparation and Python skills)

In this question you will use data from an experiment where subjects received various combinations of alcohol (coded P for placebo or M for active alcohol) and cannabis (coded X for placebo, Y for low THC, and Z for high THC) before performing a simulated drive in an advanced simulator. You will need to work with two data sources:

  1. The lane departures key, a CSV file found at the URL : https://remiller1450.github.io/data/lane_departures_key.csv that records each instance of a lane departure (any part of the subject’s vehicle going outside the boundaries of their lane).
  2. The time-series data for each subject, which is stored in this zipped folder.

\(~\)

Question #3 (KNN concepts and practice)

The table below provides a training data set consisting of 6 observations, 3 predictors, and a categorical outcome:

Observation X1 X2 X3 Y
1 0 3 0 Red
2 2 0 0 Red
3 0 1 3 Red
4 0 1 2 Green
5 -1 0 1 Green
6 1 1 1 Red

Suppose we’re interested in using \(k\)-nearest neighbors to predict the outcome of a test data-point at \(\{X_1=0, X_2=0, X_3=0\}\).

You should answer the following questions using a calculator or basic Python functions. You should not use any functions in sklearn. Additionally, you do not need to perform any standardization/scaling.

\(~\)

Question #4 (Application using sklearn)

For this question you should use the dataset available here:

https://remiller1450.github.io/data/Ozone.csv

These data document daily Ozone concentrations in New York City in 1973. Ozone is a pollutant that is has been linked to numerous health problems. The goal of this application is develop methods for accurately predicting the Ozone concentration on future dates using that date’s expected solar radiation, wind speed, and temperature.