Coursera Answers

Stanford University Statistical Learning Quiz Answer | Support Vector Machines

Stanford University Statistical Learning Quiz Answer  Support Vector Machines


Stanford University Statistical Learning Quiz Answer | Support Vector Machines


In this article i am gone to share Stanford University Statistical Learning Quiz Answer | Support Vector Machines with you..


Optimal Separating Hyperplanes Quiz

9.1.R1

If beta is not a unit vector but instead has length 2, then sum_{j=1}^p beta_j X_j is
  • twice the signed Euclidean distance from the separating hyperplane sum_{j=1}^p beta_j X_j = 0
  • half the signed Euclidean distance from X to the separating hyperplane*
  • exactly the signed Euclidean distance from the separating hyperplane


Support Vector Classifier Quiz

9.2.R1

If we increase C (the error budget) in an SVM, do you expect the standard error of beta to increase or decrease?
  • Increase
  • Decrease

Feature Expansion and the SVM Quiz

9.3.R1

True or False: If no linear boundary can perfectly classify all the training data, this means we need to use a feature expansion.
  • True
  • False

9.3.R2

True or False: The computational effort required to solve a kernel support vector machine becomes greater and greater as the dimension of the basis increases.
  • True
  • False


Example and Comparison with Logistic Regression Quiz

9.4.R1

Recall that we obtain the ROC curve by classifying test points based on whether hat f(x) > t, and varying t.

How large is the AUC (area under the ROC curve) for a classifier based on a completely random function hat f(x) (that is, one for which the orderings of the hat f(x_i) are completely random)?
  • 0.5


SVM in R Quiz
in this problem, you will use simulation to evaluate (by Monte Carlo) the expected misclassification error rate given a particular generating model. Let y_i be equally divided between classes 0 and 1, and let x_i in mathbb{R}^{10} be normally distributed.

Given y_i, x_i sim N_{10}(0, I_{10}). Given y_i = 1,x_i sim N_{10}( mu, I_{10}) with mu = (1,1,1,1,1,0,0,0,0,0).

The notation just means its a ten-dimensional Gaussian distribution; you can use the mvrnorm function in the MASS package to help generate the data. Now, we would like to know the expected test error rate if we fit an SVM to a sample of 50 random training points from class 1 and 50 more from class 0. We can calculate this to high precision by 1) generating a random training sample to train on, 2) evaluating the number of mistakes we make on a large test set, and then 3) repeating (1-2) many times and averaging the error rate for each trial.

Aside: in real life don’t know the generating distribution, so we have to use resampling methods instead of the procedure described above.

For all of the following, please enter your error rate as a number between zero and 1 (e.g., 0.21 instead of 21 if the error rate is 21%).

9.R.1

Use svm in the e1071 package with the default settings (the default kernel is a radial kernel). What is the expected test error rate of this method (to within 10%)?
  • 0.16350


9.R.2

Now fit an svm with a linear kernel (kernel = “linear”). What is the expected test error rate to within 10%?
  • 0.15791


9.R.3

What is the expected test error for logistic regression? (to within 10%)

(Don’t worry if you get errors saying the logistic regression did not converge.)
  • 0.15750


Chapter 9 Quiz

9.Q.1

Suppose that after our computer works for an hour to fit an SVM on a large data set, we notice that x_4, the feature vector for the fourth example, was recorded incorrectly (say, one of the decimal points is obviously in the wrong place).

However, your co-worker notices that the pair (x_4,y_4) did not turn out to be a support point in the original fit. He says there is no need to re-fit the SVM on the corrected data set, because changing the value of a non-support point can’t possibly change the fit.

Is your co-worker correct?
  • Yes
  • No