Analisis Big Data
Analisis Big Data
12030122140217
Data Mahasiswa
NOMOR 1
tabel1=read.delim("clipboard")
tabel1
tugas1=tabel1[,4]
tugas2=tabel1[,5]
praktikum=tabel1[,6]
quiz=tabel1[,7]
UTS=tabel1[,8]
UAS=tabel1[,9]
mean(tugas1)
mean(tugas2)
mean(praktikum)
mean(quiz)
mean(UTS)
mean(UAS)
summary(tabel1)
str(tabel1)
mode(tugas1)
mode(tugas2)
mode(praktikum)
mode(quiz)
mode(UTS)
mode(UAS)
range(tugas1)
range(tugas2)
range(praktikum)
range(quiz)
range(UTS)
range(UAS)
sd(tugas1)
sd(tugas2)
sd(praktikum)
sd(quiz)
sd(UTS)
sd(UAS)
par(mfrow=c(2,3))
boxplot(tugas1)
boxplot(tugas2)
boxplot(praktikum)
boxplot(quiz)
boxplot(UTS)
boxplot(UAS)
par(mfrow=c(2,3))
hist(tugas1)
hist(tugas2)
hist(praktikum)
hist(quiz)
hist(UTS)
hist(UAS)
plot(UTS,UAS)
plot(TUGAS1,TUGAS2)
Nomor 2
data<-read.delim("clipboard")
data
par(mfrow=c(1,1))
metode_c1<-hclust(dist(scale(data)),method = "complete")
plot(metode_c1)
rect.hclust(metode_c1,3)
anggota<-cutree(metode_c1,3)
anggotatabel=data.frame(anggota)
anggotatabel
#Metode Average Linkage
data
metode_a1<-hclust(dist(scale(data)),method = "ave")
plot(metode_a1)
anggota<-cutree(metode_a1, 2)
anggota
tabel=data.frame(anggota) tabel
#Metode Ward
data<-read.delim("clipboard")
data
metode_ward<-hclust(dist(scale(data)),method = "ward.D")
plot(metode_ward)
rect.hclust(metode_ward, 3)
anggota<-cutree(metode_ward, 3)
anggota
tabel=data.frame(anggota)
tabel
data<-read.delim("clipboard")
data
metode_centroid<-hclust(dist(scale(data)),method = "centroid")
plot(metode_centroid)
rect.hclust(metode_centroid, 3)
anggota<-cutree(metode_centroid, 3)
anggota
tabel=data.frame(anggota)
tabel
#Single linkage
data<-read.delim("clipboard")
data
metode_s1<-hclust(dist(scale(data)),method = "single")
plot(metode_s1)
rect.hclust(metode_s1,3)
anggota<-cutree(metode_s1, 3)
anggotatabel=data.frame(anggota)
anggotatabel
NOMOR 3
library(cluster)
library(factoextra)
library(tidyverse)
# mengimport data excel ke RStudio, buka file nilai.xlsx di excel (kopi seluruh file tersebut, kemudian
run di Rstudio file tabel1)
tabel1=read.delim("clipboard")
tabel1
# melihat data yang sudah lengkap
summary(tabel1)
mean(tabel1$Nilai1)
mean(tabel1$Nilai2)
mean(tabel1$Nilai3)
mean(tabel1$Nilai4)
tabel2=scale(tabel1[,4:9])
View(tabel2)
# menentukan jumlah cluster terbaik dengan metode elbow/within sum of square (wss)
fviz_nbclust(tabel2, kmeans)
fviz_nbclust(tabel2, kmeans)
fviz_nbclust(tabel2, kmeans)
# menentukan cluster dengan metode k-means,
tabelfinal = kmeans(tabel2,3)
print (tabelfinal)
fviz_cluster(tabelfinal,data=tabel2)
finalakhir=data.frame(tabel2,tabelfinal$cluster)
View(finalakhir)
tabel1[,4:9]%>%
mutate(cluster=tabelfinal$cluster)%>%
group_by(cluster)%>%
summarise_all("mean")
tabel3=scale(tabel1[,8:9])
View(tabel3)
# menentukan jumlah cluster terbaik dengan metode elbow/within sum of square (wss)
fviz_nbclust(tabel3, kmeans, method = "wss")
fviz_nbclust(tabel3, kmeans).
fviz_nbclust(tabel3, kmeans).
# transformasi dengan skala pada nilai UTS dan UAS (kolom 8 dan 9 pada tabel1)
tabel3=scale(tabel1[,7:9])
View(tabel3)
# menentukan jumlah cluster terbaik dengan metode elbow/within sum of square (wss)
fviz_nbclust(tabel3, kmeans)
tabelfinal = kmeans(tabel3,3)
print (tabelfinal)
fviz_cluster(tabelfinal,data=tabel3)
finalakhir=data.frame(tabel3,tabelfinal$cluster)
View(finalakhir)
tabel1[,7:9]%>%
mutate(cluster=tabelfinal$cluster)%>%
group_by(cluster)%>%summarise_all("mean")
View(tabel4)
# menentukan jumlah cluster terbaik dengan metode elbow/within sum of square (wss)
fviz_nbclust(tabel4, kmeans)
tabelfinal = kmeans(tabel4,3)
print (tabelfinal)
fviz_cluster(tabelfinal,data=tabel4)
View(finalakhir)
tabel1[,4:9]%>%
mutate(cluster=tabelfinal$cluster)%>%
group_by(cluster)%>%
summarise_all("mean")