共 9 篇文章 |
|
train_x <- array(train_x, dim = c(dim(train_x)[1], prod(dim(train_x)[-1]))) / 255.test_x <- array(test_x, dim = c(dim(test_x)[1], prod(dim(test_x)[-1]))) / 255.#defining the model with 1 input layer[784 neurons], 1 hidden layer[784 neurons] with dropout rate 0.4 and 1 output layer[10 neurons]y_test=np.array(y_te... 阅733 转3 评0 公众公开 18-03-13 20:09 |
gather(widedata, variable, value, -person)可以看到, 除了person以外, 其余变量变成两列变量, 分别命名为variable和value. 这正是gather()函数比reshape2包中melt()函数的优势所在: 它可以只gather若干列而其他列保持不变.long <- gather(widedata1, variable, value, grade:age)比如要把widedata中的person,grade, score三个变量合成一个... 阅806 转3 评0 公众公开 17-03-11 12:56 |
devtools包的install_github()函数用于从Github上安装R包。install.packages()只需包名即可,而install_github()需要提供Github的仓库名。githubinstall 或者 gb_install_packages()gh_suggest()gh-suggest_username()gh-list_packages()gh_search_packages()gh_show_source()gh_update_package_list()githubinstall()是gh_install_packages()... 阅689 转1 评0 公众公开 17-01-16 17:54 |
spending=fromJSON("https://data.medicare.gov/api/views/nrth-mfg3/rows.json?accessType=DOWNLOAD")names(spending)"meta" "data" meta=spending$metahospital_spending=data.frame(spending$data)colnames(hospital_spending)=make.names(meta$view$columns$name)hospital_spending=select(hospital_spendin... 阅451 转1 评0 公众公开 17-01-15 22:54 |
数据处理方式没有对错之分,只要你能理解数据并采取正确的方法处理数据。它包括5个主要的数据处理指令:过滤——集于某一条件过滤数据选择——选出数据集中感兴趣的列排列——升序或降序排列数据集中的某一个值域变换——从已有变量生成新的变量概括(通过group_by)——提供常用的操作分析,如最小值、最大值、均值等。所以你可以考虑利用writ... 阅333 转3 评0 公众公开 17-01-13 10:43 |
[code]mydata = as.data.frame(state.x77[,c(''Murder'',''Population'',''Illiteracy'',''Income'',''Frost'')])# 检查变量之间的相关性cor(mydata)# 变量相关关系的散点图矩阵library(car)scatterplotMatrix(mydata,spread=F,lty.smooth=2,main=''... 阅1458 转11 评0 公众公开 17-01-07 16:47 |
快速生成R语言报告(markdown+Rstudio) | PPV课。##### 五级标题 ### 无序列表 运动: - 篮球 - 足球 ### 有序列表排名: 1. 第一名 2. 第二名 3. 第三名 ### 链接 <http://rpubs.com/loness/167347> [点击查看](http://rpubs.com/loness/167347) ### 插入R代码```{r}x<-seq( 0,2*pi,0.2 )y<-sin( x )plot( x,y )``` ### 其他1. ... 阅132 转0 评0 公众公开 16-10-16 21:50 |