CFA2级+:010. 大数据
admin
2023-09-10 19:01:33
0

复习提示

这一部分基本不变。延续2022年版的内容,回顾这里的重点题型即可:

特别推荐回顾:

  • Q5-1

此外有新的例题:

Q010-1. An internal credit scoring model, named ALPHA, was created by a former employee using 25 defined features and make recommendations on model performance improvements. The ALPHA model compared expected and actual defaults over the past 12 months.

  • Model Prediction: Default/No Default
  • Actual Result: Default/No Default
  • Prediction Result: 1/0 (1 is a correct prediction; 0 is an incorrect prediction)

(1) The best description of the ALPHA model is that it is an example of a(n):

  • A. logistic regression model.
  • B. unsupervised machine learning model.
  • C. classification and regression tree (CART) model.

解析:选A。因为输出结果为1/0型,属于Logit模型。存在输入,因此为有监督模型,排除B项。CART模型适用于树结构,而题干中是单层结构,排除C项。

(2) For Records modeled with correct predictions and errors:

  • Actual Result: 7,018
  • Prediction Result: 5,851
  • Type 1 Error: 273
  • Type 2 Error: 894

The model was able to correctly predict a default in 5,290 instances of the model prediction dataset after the completed data wrangling. The precision of the model is closest to:

  • A. 75.4%.
  • B. 85.5%.
  • C. 95.1%.

解析:选C。P = TP/(TP + FP) = 5,290/(5,290 + 273)。

(3) A colleague mentions that there are concerns in how long it takes the ALPHA model to complete its recommendations, and they discuss several potential methods to reduce computation time for the ALPHA model. The most appropriate method to resolve the computation problem is:

  • A. Use principal components analysis to reduce the number of dimensions.
  • B. Decrease the learning rate in the algorithm to reduce overall computational requirements in the model.
  • C. Apply winsorization to the existing data to remove extreme values and outliers and replace with predetermined values for minimum and maximum of known outliers.

解析:选A。主成分分析可以减少解释数据变化所需的变量数量、减少完成该模型所需的计算时间,而不是对每个记录使用每个参数。B项,降低学习率实际上会增加计算需求,因为它将增加模型需要运行的迭代次数,以便能够学习指定的目标。C项,缩尾用于管理离群值场景,方法是用最小或最大的非离群值数据点替换单个离群值,有效地增加分布曲线的端点。但数据点依旧存在,因此缩尾不会对模型的计算需求产生影响。

Q010-2. A database from a large national weather provider that contains detailed weather data (temperature, humidity, rainfall, atmospheric pressure, etc.) at a very localized geographic level recorded by GPS coordinates for the past 36 months: The database contains a reference note that some geographic areas had their sensors upgraded to capture additional metrics that include a field to identify when that upgrade occurred.

(1) The type of error least likely to be generated by the weather dataset reference note is:

  • A. invalidity.
  • B. incompleteness.
  • C. non-uniformity error.

解析:选A。无效错误是指数据超出了有意义的范围,从而导致数据无效。在本例中,传感器被升级为收集额外的信息,而不是纠正之前的记录。但是不完整性错误(因为更新前部分字段无数据)和不统一错误(因为数据粒度变化)是存在的。

(2) There are many data fields included that would likely be highly irrelevant to their analysis and begins the process of selecting a subset of data fields that he believes are applicable. The selection of a subset of data from the weather dataset is best described as:

  • A. trimming.
  • B. feature selection.
  • C. feature engineering.

解析:选B。识别和删除数据集中不需要、不相关或冗余的特征的过程称为特征选择,符合题意。A项,修剪是一个处理数据集中异常值的过程,通过简单地删除极值,也称为截断。C项,特征工程是对当前天气数据集中不存在的新特征进行组合、巩固或创建的过程。

知识回顾

有一些小知识点需要再次记忆:

  • 大数据4V包括大量、多样、快速、准确。准确(Veracity)与数据源的可信度和可靠性有关
  • 结构型ML和文本型ML的流程很类似,有一些细微差异:
    • 结构型:① 概念化;② 数据收集;③ 数据准备和整理;④ 数据探索;⑤ 模型训练
    • 文本型:① 公式化;② 数据(文本)管理;③ 文本准备和整理;④ 数据探索;⑤ 模型训练
      • 其中,数据(文本)管理步骤是用爬虫收集数据(不要把④里面的内容错误分到②)
  • 区分六类错误。例如:
    • 不统一错误(Non-uniformity error)表示数据的显示格式不统一
    • 不一致错误(Inconsistency error)表示数据与其他数据或现实矛盾,如以0填充但不应该是0
  • 区分五种转换。例如,用各种计算方式得到新变量的转换叫做提取(Extraction)
  • 区分正态化和标准化。正态化是指(X-min)/(max-min),标准化是指(X-μ)/σ
  • 文本准备和整理
    • 四删包括删html、标点、数字、空白。注意需要将特定标点进行字符替换,如/percentSign/
    • 令牌化(Tokenization)是将给定文本分割为单独令牌的过程,将数据拆分为单词集合。
    • 归一化过程包括小写化、停止词、词干分析(Stemming)、词形还原(Lemmatization)
      • 最后得到的令牌会简洁且带有下划线,如sale_decreas
    • 归一化完成后创建词袋(BOW)。词袋是样本数据集中所有文本的一组不同的令牌的集合
  • 词频
    • 某词词频 = 某词词数 / 收集的总词数
    • 词云可以根据词频值显示数据集中信息量最大的词
    • 词频非常高和非常低的属于噪声特征。太高的是停止词,太低的是稀疏词,都需要排除
  • 特征选择缓解过拟合,特征工程缓解欠拟合
  • 混淆矩阵:
    • P = TP/(TP + FP)(关心第1类错误)
    • R = TP/(TP + FN)(关心第2类错误)
    • A = (TP + TN)/(TP + FP + TN + FN)
    • F1 = 2/(1/P + 1/R)(调和平均)
      • 若要对FP和FN给予等权,则应采用F1衡量
    • 若给出阈值p表,低于阈值p的视为真值(1的真为TP,0的真为TN),反之为假值
  • 如果出现类失衡,则对多数类进行欠采样,对少数类进行过采样
  • 交叉验证集
    • 使用K折交叉验证将提高基础模型在预测实际事件时的整体准确性
    • 交叉验证集的AUC越高,说明模型的泛化能力越强
    • 交叉验证集预测误差远大于训练集预测误差,说明模型过拟合,正则化程度不够
    • 通过LASSO增加惩罚项,可以缓解过拟合问题
  • TF-IDF(这里补充更深入了)
    • TF,文档频率,为包含给定单词的文档(即句子)的数量除以句子的总数
      • 公式:TF = 给定单词出现在句子中的数量 / 句子的总数量
    • IDF,逆文档频率,给定单词在整个语料库中的独特程度的相对度量,与语料库的大小没有直接关系
      • 公式:IDF = log(1/DF)
    • TF-IDF,将句子级别的TF乘以单词的IDF。较高的TF-IDF值表示在较少的文档中出现频率更高的单词。这意味着相对来说更独特的重要词。相反,低TF-IDF值表示在许多文档中出现的词。TF-IDF值在度量跨文档编译的关键词时很有用,并且可以作为训练ML模型的单词特征值。
      • 公式:TF-IDF = TF×IDF
      • TF-IDF值随文档的数量而变化,当应用于只有少量文档的数据集时,模型性能可能会有所不同
  • 如果数据集没有地面真值(ground truth),说明这是无监督模型,不需要训练集
  • 模型拟合误差(偏差误差和方差误差)用于调试(tuning)
  • 性能评估一般采用误差分析(混淆矩阵)、ROC/AUC、RMSE
  • 独热编码(one hot encoding):将具有多个值的特征按类型分解为单个特征,以1/0记录

其他知识点可以查看:

(完)


相关内容