Machine Learning (3) - Study Advice <error occurs how to solve? >

According to Andrew Ng notes at Stanford's "machine learning" video, does not go into details through knowledge Li Hang "statistical learning methods" to obtain the list only outline.

1 Study Advice

Error is too large, how to improve?

  • Use more training to address the high sample variance →
  • → choose fewer features to address the high variance
  • Further features selected to address the high deviation →
  • Wherein the polynomial → solution increases high deviation
  • Reduced \ (\ the lambda \) → deviation high solution
  • Increased \ (\ the lambda \) → address the high variance

Performance evaluation of machine learning algorithms

Data "shuffle", and then divided into training and test sets. Typically 70% of the data as a training set, with the remaining 30% of the data as a test set.

  1. Learn the training set to obtain parameters \ (\ theta \)

  2. Calculating a test error (without the addition of regularization): For linear regression, the cost function can be used before; for logistic regression method, in addition to the previous cost function, also called the misclassified 0/1
    \ [err (h_ \ theta (x), y) = \ left \ {\ begin {aligned} 1 && if \ h_ \ theta (x) \ ge 0.5, y = 0 \\ && or \ h_ \ theta (x) \ lt 0.5, y = 1 \\ 0 && otherwise \ end { aligned} \ right. \]

    \[ Test \ error = \frac{1}{m_{test}}\sum_{i=1}^{m_{test}}err(h_\theta(x_{test}^{(i)}),y_{test}^{(i)}) \]

Model selection

Using the test set selection power \ (D \) , it is necessary to verify → reference is set cross-validation

With 60% of the data as a training set, as 20% of the cross-validation data set, using 20% ​​as the test data set

  1. Learn the training set to obtain the parameter \ (\ ^ {Theta (I)} \) , i.e., a plurality of models
  2. Calculating a verification authentication error set (without the addition of regularization term), to give the parameter \ (D \) , i.e., the selected model
  3. Calculating test error (without the addition of regularization term), i.e., the model test

Machine Learning diagnostics (deviation or variance?)

\ (D \) large, high variance; \ (D \) is small, the high deviation

Deviation: training error and validation error are large

Variance: training error is small, but big validation error, that error is much greater than the verification error training

Regularization and deviation, variance

\ (\ lambda \) large, high deviation; \ (\ lambda \) is small, the high variance

Select a range of possible attempts \ (\ lambda \) value: 0,0.01,0.02,0.04, ..., 20

  1. He trained 12 \ (\ lambda \) value regularization models
  2. Calculating verification error, to give \ (\ the lambda \)
  3. Test error calculated

Draw learning curve

Learning algorithm is used to determine the issue of

High bias, as the number of the training set, verification errors do not significantly decrease substantially flattened, this time using more training samples useless

When the variance is high, with the increase in the number of training sets has been increased to verify the error, training error has been reduced, this time using more training data useful for

Guess you like

Origin www.cnblogs.com/angelica-duhurica/p/10948753.html