上一页 1 ··· 7 8 9 10 11 12 13 14 下一页
摘要: 建议先看PCA这一节。在遇到下面的数据类型时(数据有标签,为有监督),PCA不能很好的找到一个投影方向使得变换后的数据方差最大。 于是引入LDA。 定义原始数据集为$x = (x_{1},x_{2},,x_{n},y_{i})$,m个 样本,n个特征,i类标签(为公式简练,i=2) 设y1的数据均值 阅读全文
posted @ 2019-07-14 16:07 be·freedom 阅读(287) 评论(0) 推荐(0)
摘要: 导入参考文献: 在word中,将光标点到 想要插入参考文献的地方,在endnote的reference中选择目标文献,点击工具栏的insert citation(ALT+2),即可 导出后,word显示如下 但是一般安装的盗版 endnote没有国标(Chinese standard)格式,必须从官 阅读全文
posted @ 2019-06-23 11:46 be·freedom 阅读(25295) 评论(0) 推荐(0)
摘要: 上概率论大家都知道这个大名鼎鼎的贝叶斯公式 $P\left ( A\mid B \right )=\frac{P\left ( B\mid A \right )P\left ( A \right )}{P\left ( B \right )}$ 它是由 $P\left ( A\bigcap B \r 阅读全文
posted @ 2019-06-19 17:11 be·freedom 阅读(192) 评论(0) 推荐(0)
摘要: R语言为脚本语言,运算速度较慢,使用for循环等控制流会导致整个运算更慢 为此,R官方推出了apply家族,意在提供快速强大的循环操作。 apply经常配合R函数或自定义函数使用 #apply(matrix/array,1/2/3,fun) #第一个参数需为矩阵或数组 #第二个参数1表示按行,2表示 阅读全文
posted @ 2019-06-19 09:58 be·freedom 阅读(527) 评论(0) 推荐(0)
摘要: A=outer(1:4, 1:30, function(x, y) 10*x + y);A i <- 1:4; j <- 1:30; # i and j ni<- length(i); nj <- length(j) # lengths of i and j y <- matrix(NA, nj, ni) # create a matrix with nj rows and ni colum... 阅读全文
posted @ 2019-06-18 21:58 be·freedom 阅读(529) 评论(0) 推荐(0)
摘要: #求电费,<50,85折,50--120,50元/度,>120,1.15倍 myfunction 120) energyprice = deg*price*1.15 else if(deg 100) energyprice = deg*price*1.15 else if (poor == TRUE) energyprice = energyprice*0.... 阅读全文
posted @ 2019-06-18 21:31 be·freedom 阅读(1101) 评论(0) 推荐(0)
摘要: rm(list = ls()) options(digits = 2) Student <- c("John Davis","Angela Williams","Bullwinkle Moose", "David Jones","Janice MaRkhammer","Cheryl Cushing" 阅读全文
posted @ 2019-06-18 17:59 be·freedom 阅读(952) 评论(0) 推荐(0)
摘要: #chapter5 #### rm(list = ls()) round(333333.141592653,digits = -5) # x<-rnorm(1:9) x round(x,digits = 2) abs(-0.2) sqrt(c(64,81)) #开平方 ceiling(pi) #上限(天花板) pi floor(pi) #对应ceiling trunc(5.... 阅读全文
posted @ 2019-06-18 17:48 be·freedom 阅读(531) 评论(0) 推荐(0)
摘要: #chapter 3#### attach(mtcars) plot(wt,mpg) abline(lm(mpg~wt)) #adds a line of best fit title("regression of mpg on weight") detach(mtcars) pdf("mygraph.pdf") attach(mtcars) plot(wt,mpg) abline(lm... 阅读全文
posted @ 2019-06-18 08:48 be·freedom 阅读(152) 评论(0) 推荐(0)
摘要: #1.1#### rm(list=ls()) age 75]=55]75]=55&age3]30,];newdata #or attach(leadership) newdata30,] detach(leadership) leadership$date=startdate&leadership$date30&gender=="M", select = c(q... 阅读全文
posted @ 2019-06-17 18:26 be·freedom 阅读(331) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 下一页