- 20150827 [學習筆記] R與資料探勘 (5)
- 整理自 R軟體與資料探勘之開發與應用 -- 期望最大值演算法、自組織映射圖
- [ GitHub ]
- (九)期望最大值演算法(Expectation-Maximization)
- [前置作業] 基本概念
- STAGE 1 : 輸入資料和運算階段
- STAGE 2 : 評估階段
- (十)自組織映射圖(Self Organizing Maps)
- [前置作業] 基本概念
- STAGE 1 : 輸入資料和運算階段
- STAGE 2 : 評估階段
Visible to members of this folder
整理自 R軟體與資料探勘之開發與應用 -- 期望最大值演算法、自組織映射圖
R 軟體安裝(略過)R Studio軟體安裝(略過)START : 訓練資料和測試資料(完成)(一)倒傳遞類神經網路(Back-Propagation Neural Network)(完成)(二)決策樹(Decision Tree)(三)支援向量機(Support Vector Machine)(完成)(四)貝式分類(Naïve Bayes)(五)k位最近鄰居法(k-Nearest Neighbor)(六)階層分群演算法(Hierarchical Clustering)(完成)(七)k平均演算法(k-Means)(完成)(八)模糊c平均演算法(Fuzzy c-Means)(完成)(九)期望最大值演算法(Expectation-Maximization)
install.packages("mclust")
library("mclust")
# input data
inputfile <- read.csv(file.choose())
inputdata <- subset(inputfile, select = -Species)
# computation
em.model <- Mclust(inputdata, 3)
print(em.model)
# evaluation
table(inputfile$Species, em.model$classification)
plot(em.model, what=c('classification'), mens=c(3,4))
(十)自組織映射圖(Self Organizing Maps)
install.packages("som")
library("som")
# input data
inputfile <- read.csv(file.choose())
inputdata <- subset(inputfile, select = -Species)
inputdata.n <- normalize(inputdata, byrow=F)
# computation
som.model <- som(inputdata.n, xdim=4, ydim=4, topol="rect", neigh="gaussian")
print(som.model)
# evaluation
plot(som.model)