机器学习课程-温州大学-Scikit-learntrain_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score 基本建模流程 9 2.Scikit-learn主要用法 ✓Scikit-learn支持以NumPy的arrays对象、Pandas对象、SciPy的稀 疏 矩阵及其他可转换为数值型arrays的数据结构作为其输入,前提是 StandardScaler 构建转换器实例 scaler = StandardScaler() 拟合及转换 scaler.fit_transform(X_train) 数据预处理 Z-Score标准化 ?∗ = ? − ? ? ?2 = 1 ? ?=1 ? (? ? −?)2 ? = 1 ? ?=1 ? ? ? 处理后的数据均值为0,方差为1 12 2 将数据映射到[0,1]区间 13 2.Scikit-learn主要用法 特征选择 from sklearn import feature_selection as fs fs.SelectKBest(score_func, k) 过滤式(Filter),保留得分排名前k的特征(top k方式) fs.RFECV(estimator, scoring=“r2”) 封装式(Wrap- per),结合交0 码力 | 31 页 | 1.18 MB | 1 年前3
华为云深度学习在文本分类中的实践-李明磊4000 6000 8000 10000 12000 人工标注 系统标注 样本数目 0.84 0.93 0.75 0.8 0.85 0.9 0.95 人工标注 系统标注 效果:F1 未标注集合 ???????????? ???????????? 种子语料 机器学习模型 人工标注 15 华为云主动学习平台 16 华为云主动学习平台 17 1 2 4 3 分类 100.00% Accuracy Precision Recall F1 score 和友商效果对比-汽车领域 华为1 华为2 友商1 友商2 友商3 友商4 0.00% 20.00% 40.00% 60.00% 80.00% 100.00% Accuracy Precision Recall F1 score 和友商效果对比-电商领域 华为1 华为2 友商1 友商2 友商3 友商3 友商4 0.00% 20.00% 40.00% 60.00% 80.00% 100.00% Accuracy Precision Recall F1 score 和友商效果对比-社交领域 华为1 华为2 友商1 友商2 友商3 友商4 内容: 买没几天就降价一点都不开心,闪存跑分就五百多点点 --- 外观漂亮音质不错,现在电子产品基本上都是华为的了 --- 0 码力 | 23 页 | 1.80 MB | 1 年前3
机器学习课程-温州大学-05机器学习-机器学习实践Accuracy = TP + TN TP + TN + FP + FN 精确率 Precision = TP TP + FP 召回率 Recall = TP TP + FN F1 score F1 = 2 × Precision × Recall Precision + Recall 11 评价指标 有100张照片,其中,猫的照片有60张,狗的照片是40张。 输入这100张 x2 Normalization 3.正则化、偏差和方差 17 归一化(最大 - 最小规范化) ?∗ = ? − ?min ?max − ?min 将数据映射到[0,1]区间 Z-Score标准化 ?∗ = ? − ? ? ?2 = 1 ? ?=1 ? (? ? −?)2 ? = 1 ? ?=1 ? ? ? 处理后的数据均值为0,方差为1 数据归一化的目的是使得各特征对0 码力 | 33 页 | 2.14 MB | 1 年前3
动手学深度学习 v2.0层l由变换fl定义,该变换的参数为权重W(l),其隐藏变 量是h(l)(令 h(0) = x)。我们的网络可以表示为: h(l) = fl(h(l−1)) 因此o = fL ◦ . . . ◦ f1(x). (4.8.1) 如果所有隐藏变量和输入都是向量,我们可以将o关于任何一组参数W(l)的梯度写为下式: ∂W(l)o = ∂h(L−1)h(L) � �� � M(L)def = · 1所示,对于非嵌套函数(non‐nested function)类,较复杂的函数类并不总是向“真”函数f ∗靠拢 (复杂度由F1向F6递增)。在 图7.6.1的左边,虽然F3比F1更接近f ∗,但F6却离的更远了。相反对于 图7.6.1右 侧的嵌套函数(nested function)类F1 ⊆ . . . ⊆ F6,我们可以避免上述问题。 图7.6.1: 对于非嵌套函数类,较复杂(由较大区域表示)的函数类不能保证更接近“真”函数(f 出是连接(用图中的[, ]表示)而不是 如ResNet的简单相加。因此,在应用越来越复杂的函数序列后,我们执行从x到其展开式的映射: x → [x, f1(x), f2([x, f1(x)]), f3([x, f1(x), f2([x, f1(x)])]), . . .] . (7.7.3) 96 https://discuss.d2l.ai/t/1877 7.7. 稠密连接网络(DenseNet)0 码力 | 797 页 | 29.45 MB | 1 年前3
Skew mitigation - CS 591 K1: Data Stream Processing and Analytics Spring 20202 3 3 3 3 1 2 0 1 1 3 5 input stream ε=0.2 w1 w4 w3 w2 1 2 2 3 5 w1 1 2 3 5 1 0 2 0 1 0 1 0 f1 ε1 f2 ε2 f3 ε3 f5 ε5 ??? Vasiliki Kalavri | Boston University 2020 Example 8 1 2 2 3 5 5 1 1 2 stream ε=0.2 w1 w4 w3 w2 1 2 2 3 5 w1 Delete items with fx + εx ≤ 1 1 2 3 5 1 0 2 0 1 0 1 0 f1 ε1 f2 ε2 f3 ε3 f5 ε5 ??? Vasiliki Kalavri | Boston University 2020 Example 8 1 2 2 3 5 5 1 1 2 stream ε=0.2 w1 w4 w3 w2 1 2 2 3 5 w1 Delete items with fx + εx ≤ 1 1 2 3 5 1 0 2 0 1 0 1 0 f1 ε1 f2 ε2 f3 ε3 f5 ε5 ??? Vasiliki Kalavri | Boston University 2020 Example 8 1 2 2 3 5 5 1 1 20 码力 | 31 页 | 1.47 MB | 1 年前3
Experiment 2: Logistic Regression and Newton's Methodcollege and 40 students who were not admitted. Each (x(i), y(i)) training example contains a student’s score on two standardized exams and a label of whether the student was admitted. Your task is to build a plot should look like the following: 1 10 20 30 40 50 60 70 Exam 1 score 40 45 50 55 60 65 70 75 80 85 90 Exam 2 score 4 Logistic Regression Recall that in logistic regression, the hypothesis 60 70 Exam 1 score 40 50 60 70 80 90 100 Exam 2 score Admitted Not admitted Decision Boundary 5. What is the probability that a student with a score of 20 on Exam 1 and a score of 80 on Exam0 码力 | 4 页 | 196.41 KB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 4 - Efficient Architecturesmeasure of the relationship between their elements together with their respective positions. The score value indicates the amount of attention a word at position p in the first sequence pays to a word scores between the respective english and spanish words for an example pair of sequences. A higher score indicates a greater affinity between the corresponding words and their positions. The cell with value recurrent cells with attention layers is the most significant one. The goal of attention is to produce a score matrix (figure 4-16) for a pair of sequences to supplement a target sequence with the knowledge of0 码力 | 53 页 | 3.92 MB | 1 年前3
keras tutorialin the previous chapter using test data. score = model.evaluate(x_test, y_test, verbose=0) print('Test loss:', score[0]) print('Test accuracy:', score[1]) Executing the above code will output the Let us evaluate the model using test data. score = model.evaluate(x_test, y_test, verbose=0) print('Test loss:', score[0]) print('Test accuracy:', score[1]) Executing the above code will output the us evaluate the model using test data. score = model.evaluate(x_test_scaled, y_test, verbose=0) print('Test loss:', score[0]) print('Test accuracy:', score[1]) Executing the above code will output0 码力 | 98 页 | 1.57 MB | 1 年前3
Appendix for SVMK12) +(f1 − y(1)α1K11 − y(2)α2K12 − b) −(f2 − y(1)α1K21 − y(2)α2K22 − b)] = y(2)[(f1 − y(1)) − (f2 − y(2)) + ζ(K11 − K12) −(ζ − y(2)α2)K11 − y(2)α2K12 +(ζ − y(2)α2)K12 − y(2)α2K22] = y(2)[(f1 − y(1)) y(1)α+ 1 K11 + y(2)α+ 2 K12 + m � i=3 αiy(i)K1i + b+ = y(1) 4 Recalling that f1 = �m i=1 αiy(i)K1i + b and E1 = f1 − y(1), y(1) = m � i=1 αiy(i)K1i + b − E1 Therefore, b+ = y(1) − α+ 1 K11 − y(2)α+0 码力 | 5 页 | 117.35 KB | 1 年前3
机器学习课程-温州大学-特征工程建模时,使用一个或多 个原特征构造新的特征 可能会比直接使用原有 特征更为有效。 9 归一化(最大 - 最小规范化) ?∗ = ? − ?min ?max − ?min 将数据映射到[0,1]区间 Z-Score标准化 ?∗ = ? − ? ? ?2 = 1 ? ?=1 ? (? ? −?)2 ? = 1 ? ?=1 ? ? ? 处理后的数据均值为0,方差为1 数据归一化的目的是使得各特征对目标变 70,80,90,100] score_cat = pd.cut(score_list, bins) print(pd.value_counts(score_cat)) (59, 70] 7 (0, 59] 6 (80, 90] 4 (90, 100] 2 (70, 80] 1 可以按照区间分箱: score_cat = pd.qcut(score_list,5) print(pd print(pd.value_counts(score_cat)) 也可以数量分箱: (31.999, 50.0] 4 (50.0, 63.6] 4 (63.6, 69.4] 4 (69.4, 84.0] 4 (84.0, 99.0] 4 13 2. 特征构建 • 聚合特征构造主要通过对多个特征的分组聚合实现,这些特征通常来 自同一张表或者多张表的联立。 • 聚合特征构造使用一对多的关联来对观测值分组,然后计算统计量。0 码力 | 38 页 | 1.28 MB | 1 年前3
共 171 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18













