## Random Forests 隨機森林 | randomForest, ranger, h2o | R語言 (zhuantie)

https://www.jamleecute.com/random-forests-%E9%9A%A8%E6%A9%9F%E6%A3%AE%E6%9E%97/ Bagging法綜合多個樹模型結果，可以降低單一樹模型的高變異性並提升預測正確率。但Bagging法中樹與樹之間的相關性會降低模型整體的表現。隨機森林 Random forests 是Bagging修改後的版本，它是由「去相關性」的樹模型所組成的集成演算法，有很不錯的預測正確率且是一個受歡迎、開箱即用的演算法。

[…]

## Heatmap in R: Static and Interactive Visualization

https://www.datanovia.com/en/lessons/heatmap-in-r-static-and-interactive-visualization/

## R Packages/functions for drawing heatmaps

There are a multiple numbers of R packages and functions for drawing interactive and static heatmaps, including:

• heatmap() [R base function, stats package]: Draws[……]

[…]

## heatmap R

> library(gplots) Attaching package: ‘gplots’ The following object is masked from ‘package:stats’: lowess > > setwd(“/home/zyshen/work/QM_nanjing”) > data2<-read.csv(“combined_example.level_5.csv”, header=T, sep=”,”) > data2plot<-data.matrix(data2[2:3])[……]

[…]

## Correlation tests, correlation matrix, and corresponding visualization methods in R (forward)

https://rstudio-pubs-static.s3.amazonaws.com/240657_5157ff98e8204c358b2118fa69162e18.html

[…]

## R drawing png with high resolution

``the_plot <- function() { x <- seq(0, 1, length.out = 100) y <- pbeta(x, 1, 10) plot( x, y, xlab = "False Positive Rate", ylab = "Average true positive rate", type = "l" ) }``

``png( "test.png", width = 3.25, height = 3.25,[......]``

[…]

## fasta2nexus by R script

`Workspace loaded from ~/.RData] > setwd("/home/shenzy/work/beast/51samples") > library(seqinr) > data=read.fasta("51strain_core_gene_alignment.aln") > library(ape)  Attaching package: ‘ape’ The following objects are masked from ‘package:seqinr’: as.alignment, consensus[......]`

[…]

# Remove grid and background from plot (ggplot2)

#### Generate data

``library(ggplot2) a <- seq(1, 20) b <- a^0.25 df <- as.data.frame(cbind(a, b)) ``

#### basic plot

``myplot = ggplot(df, aes(x = a, y[......]``

[…]

# Size Matters: Metabolic Rate and Longevity

John Tukey once said, “The best thing about being a statistician is that you get to play in everyone’s backyard.” I enthusiastically agree! I frequently enjoy reading and watching science-related material. This invariably raises questions, involving oth[……]

[…]

# 1. 确定自变量与Y是否相关

For any given value of n（观测数据的数目） and p（自变量X的数目）, any statistical software  package can be used to compute the p-value associated with the F-statistic using this distribution. Based on this p-value, we can determine whether or not to reject H0. （用[……]