本文将介绍如何使用party包,rpart包及randomForest包来建立预测模型。
首先,我们将使用party包来建立决策树,并用决策树用于分类。其次,利用randomForest包来训练随机森林模型。
最后学习使用rpart包来建立决策树。
所使用的数据集为R中自带的iris数据集
使
RNA_seq pipline
]]>]]>]]>]]>
RNA_seq pipline
PeRl
2018年3月7日
首先说明
目录
基于 Keras 用 LSTM 网络做时间序列预测问题描述
长短记忆网络
LSTM 网络回归
LSTM 网络回归结合窗口法
基于时间步的 LSTM 网络回归
在批量训练之间保持 LSTM 的记忆
在批量训练中堆叠 LSTM 网络
总结
扩展阅读
本文主要参考了 Jason Brownlee
转载自https://www.jetbrains.com/help/idea/using-intellij-idea-as-the-vim-editor.html
This feature is only supported in the Ultimate edition.
The followi
目录
基于 Keras 用深度学习预测时间序列问题描述
多层感知机回归
多层感知机回归结合“窗口法”
改进方向
扩展阅读
本文主要参考了 Jason Brownlee 的博文 Time Series Prediction With Deep Learning in Keras
原文使用 pyth
豆瓣排名前25电影及评价爬取
url <-'http://movie.douban.com/top250?format=text'
# 获取网页原代码,以行的形式存放在web 变量中
web <- readLines(url,encoding="UTF-8")
# 找到包含电影名称的行
字符串处理中基本函数的使用
R自带函数与stringr包函数对比
> states <- row.names(USArrests)
> # 提取字符串子集
> substr(x = states, start = 1, stop = 4)
[1] "Alab" "Alas"
元字符有自己的特殊含义
[ ]内的任意字符将被匹配
grep(pattern = "[wW]", x = states, value = T)
grep(pattern = "w", ignore.case = T, x = states, value = T)
对元字符进行转义
strsplit(
R中预定义的字符组
代码
含义说明
[:digit:]或\d
数字; [0-9]
[^[:digit:]]或\D
非数字; 等价于[^0-9]
[:lower:]
小写字母; [a-z]
[:upper:]
大写字母; [A-Z]
[:alpha:]
字母; [a-z]及[A-Z]
[:alnum:
seq_along与seq_len函数的使用
在for循环中有用
> seq_along(c(2,3,5))
[1] 1 2 3
> seq_len(3)
[1] 1 2 3
melt函数可以将宽数据转化为长数据
dcast函数可以将长数据转化为宽数据
> DT = fread("melt_default.csv")
> DT
family_id age_mother dob_child1 dob_child2 dob_child3
1:
使用ggplot2包绘制ROC曲线
rocplot<- function(pred, truth, ...){
predob<- prediction(pred, truth)
#打印AUc
perf.auc<- performance(predob, me
使用wordcloud2绘制词云图
library(wordcloud2)
findwords<-function(tf){
txt<-scan(tf,"")
wl<-list()
for(i in 1:length(txt)){
使用pROC包绘制ROC曲线
#####***绘制ROC曲线***#####
library("pROC")
N <- dim(data2)[1]
使用ggplot2绘制箱线图
######*****绘制箱线图代码*****#######
data1$学区房 <- factor(data1$school, levels = 0:1, labels = c("否", "是"))
#设置学区房数据为因子类型
dat
使用ggplot2包绘制直方图
######*****绘制直方图代码*****#######
data1 <- data0[(data0[, 2] <= 500) & (data0[, 4] <= 150000), ]
#提取面积500以下且单价十五万以
前期处理
perl脚本统计RC(RC(read counts))
读入control baseline 和 sigma(最后baseline 预测的mad值)
将gc < 0.28或gc > 0.68,sigma乘上1.5,后来又乘以6,对于小于0.01或者大于0.99分位数,sigma
R语言真是博大精深
方法一
Acf(gold[,2], type = "correlation",lag.max = 100)
Acf(gold[,2], type = "partial")
方法二
library(ggfortify)
autoplot(acf(gold[,2], plot = F
使用fmsb包绘制雷达图
library("fmsb")
radarfig <- rbind(rep(90, 4), rep(60, 4), c(86.17, 73.96, 82.70, 69.55)) #求平均值
radarfig <- as.data.frame(radarf
如果要使用新版本的R,除了直接安装,也可以直接拷贝R的文件夹。这样既可以保留原始的R版本和R包,也可以使用新版本的R和R包,R包存放在R目录下的library文件夹。
文件放路径
R: /usr/lib64/R
llibrary: 系统R library目录:/usr/lib64/R/libra