机器学习笔记1machine learning

    This note is written in both Chinese and in English. 本笔记根据个人习惯使用中英双语写作。大部分说明会尽量使用英语写,一部分复制的资料会使用原语言。使用中文写的时候会尽量将名词的英文标注出来。

    交叉验证(cross validation):在训练算法(train the algorithm)时,将完整的数据集分出一大部分用来训练,一小部分是用来作为验证的测试集(testing set)。通过交叉验证的方法,我们不需要操心数据集如何划分。例如,将数据集分为四份(four-fold cross validation 四分交叉验证),三份用来训练,一份用来验证。交叉验证就是分别将数据进行训练和验证,最后进行汇总。

    在极端情况下,可以将每一个样本数据作为一份(a block),这种情况被称为"leave one out cross validation",每个样本都被单独测试。但是最常见的是将数据分为十份“Ten-Fold Cross Validation”。

    调参(Tuning Parameter):调参指调整参数以获得更好的效果,其目的在于得到更好的模型:修复出现的错误、提高神经网络训练精确度。模型的最优参数依赖于许多场景,在模型评估和选择中,除了  算法 的选择,还需要对其参数进行设定,调参便是完成参数设定的过程。目前普遍做法是,对参数选择一个范围和变化步长,如在 [0 , 0.2] 之间以 0.05 为步长,这样可以得到的待选参数值有 5 个,理想值便会从这 5 个候选值中获得,虽然这样获得参数值非最佳值,但可在计算开销和性能估计之间折中。

    If the regression model has tuning parameters (e.g. ridge regression, neural networks, boosting), good values for the tuning parameters are usually found running by the model several times with different values for the tuning parameters. The performance of each model is assessed on the test data set and the best model (according to some criterion) is chosen.

Schonlau M. Boosted Regression (Boosting): An introductory tutorial and a Stata
plugin. The Stata Journal, 5(3), 330-354.

    混淆矩阵(Confusion Matrix)

    Rad blocks represent false results that the rows (Predicted data) are not correspond with the columns (Actual data) and green blocks represent true results that the two are consistent with each other. The red blocks in the top row are false positives, and the red blocks in the bottom row are false negatives.
    We could use the Confusion Matrix to compare which algorithm is better. 

To be continue...

评论