MachineLearningpart6--EvaluatingaHypothesis
 
EvaluatingaHypothesis
 
Oncewehavedonesometroubleshootingforerrorsinourpredictionsby:
一旦我们通过以下方式对预测中的错误做了一些故障排除
 
Gettingmoretrainingexamples
获得更多的训练实例
Tryingsmallersetsoffeatures
尝试较小的特征集
Tryingadditionalfeatures
尝试更多的特征
Tryingpolynomialfeatures
尝试多项式特征
Increasingordecreasingλ
增加或减少λ
Wecanmoveontoevaluateournewhypothesis.
我们可以继续评估我们的新假说。
 
Ahypothesismayhavealowerrorforthetrainingexamplesbutstillbeinaccurate(becauseofoverfitting).Thus,toevaluateahypothesis,givenadatasetoftrainingexamples,wecansplitupthedataintotwosets:atrainingsetandatestset.Typically,thetrainingsetconsistsof70%ofyourdataandthetestsetistheremaining30%.
一个假设可能对训练实例的误差很低,但仍然是不准确的(因为过度拟合)。因此,为了评估一个假设,给定一个训练例子的数据集,我们可以把数据分成两组:训练集和测试集。通常情况下,训练集由70%的数据组成,测试集是剩下的30%的数据。
 
Thenewprocedureusingthesetwosetsisthen:
那么,使用这两个集的新程序就是:
 
 
Thisgivesustheproportionofthetestdatathatwasmisclassified.
这给我们提供了测试数据中被错误分类的比例。
 
ModelSelectionandTrain/Validation/TestSets
 
Justbecausealearningalgorithmfitsatrainingsetwell,thatdoesnotmeanitisagoodhypothesis.Itcouldoverfitandasaresultyourpredictionsonthetestsetwouldbepoor.Theerrorofyourhypothesisasmeasuredonthedatasetwithwhichyoutrainedtheparameterswillbelowerthantheerroronanyotherdataset.