1. 公式(3.4)的推导. 可以直接对公式(3.3)中的$\beta_0$求导就得到$\hat{\beta}_0=\bar{y}-\beta_1\bar{x}$. 对公式(3.3)中的$\beta_0$求导会有: $(y_1-\hat{\beta_0}-\hat{\beta_1}x_1)x_1+(y_2-\hat{\beta_0}-\hat{\beta_1}x_2)x_2\ldots+(y_n-\hat{\beta_0}-\hat{\beta_1}x_n)x_n$ 将$\hat{\beta}_…
This post builds on a previous post, but can be read and understood independently. As part of my course on statistical learning, we created 3D graphics to foster a more intuitive understanding of the various methods that are used to relax the assumpt…
This semester I'm teaching from Hastie, Tibshirani, and Friedman's book, The Elements of Statistical Learning, 2nd Edition. The authors provide aMixture Simulation data set that has two continuous predictors and a binary outcome. This data is used to…
照例文章第一段跑题,先附上个段子(转载的哦~): I hate CS people. They don't know linear algebra but want to teach projective geometry. They don't know any probability but want to use graphical models. They don't understand stats at all but still do machine learning like c…
import os import email import email.policy 1. 读取邮件数据 SPAM_PATH = os.path.join( "E:\\3.Study\\机器学习\\Hand on Machine Learning\\第三章:分类\\spam_data") spam_path = os.path.join(SPAM_PATH, "spam") ham_path = os.path.join(SPAM_PATH, "easy_…
第二章 线性代数 2.1 名词 标量(scalar).向量(vector).矩阵(matrix).张量(tensor) 2.2 矩阵和向量相乘 1. 正常矩阵乘法: 2. 向量点积: 3. Hadamard乘积(元素对应乘积) 矩阵乘法服从分配律.结合律,两个向量的点积满足交换律,利用两个向量点积的结果是标量(scalar),标量转置是自身. 2.3 单位矩阵和逆矩阵 逆矩阵一般作为理论工具使用,计算机由于精度不足,一般不使用逆矩阵. 2.4 线性相关和生成子空间 线性方程组,解的个数:0.1.…
4.4 R1 In which of the following problems is Case/Control Sampling LEAST likely to make a positive impact? A. Predicting a shopper's gender based on the products they buy B. Finding predictors for a certain type of cancer C. Predicting if an email is…
把输入文件中的所有Fred换成Larry, 不区分大小写. 知识点 1. 文本文件读写 2. 简单的正则替换 3. unless 的用法 4. $_ 的用法…
http://faculty.marshall.usc.edu/gareth-james/ http://faculty.marshall.usc.edu/gareth-james/ISL/…
1. 获取数据 使用MNIST数据集练习分类任务 from sklearn.datasets import fetch_mldata from scipy.io import loadmat mnist = fetch_mldata('MNIST original', transpose_data=True, data_home='files') print(mnist) # *DESCR为description,即数据集的描述 # *CLO_NAMES为列名 # *target键,带有标记的数…