#for loop문 생성하기
for(i in 5:20) {
for(j in 1:3) { set.seed(1)
con_model <- neuralnet(formula=strength ~ +cement+slag+ash+water+ superplastic + coarseagg + fineagg + age ,
data=train_data, hidden=c(i,j))
result <- compute( con_model, test_data[ , 1:8] )
a <- cor( result$net.result, test_data[ , 9] )
print(paste('h1:',i,'h2:',j, a) )
}}
for(i in 20:40) {
for(j in 1:3) { set.seed(1)
con_model <- neuralnet(formula=strength ~ +cement+slag+ash+water+ superplastic + coarseagg + fineagg + age ,
data=train_data, hidden=c(i,j))
result <- compute( con_model, test_data[ , 1:8] )
a <- cor( result$net.result, test_data[ , 9] )
print(paste('h1:',i,'h2:',j, a) )
}}
# 필요한 패키지 로드
library(plotly)
# 데이터 생성
data <- data.frame(
Experiment = c('1번 실험', '2번 실험', '3번 실험', '4번 실험','5번 실험'),
Correlation_Coefficient = c(0.82, 0.94, 0.96, 0.95, 0.73)
)
# 막대 그래프 생성
plot_ly(
data,
x = ~Experiment,
y = ~Correlation_Coefficient,
type = 'bar',
marker = list(color = c("gold","lightpink","tomato","lightgreen","paleturquoise"))
) %>%
layout(
title = 'Correlation Coefficient by Experiment',
xaxis = list(title = 'Experiment'),
yaxis = list(title = 'Correlation Coefficient', range = c(0, 1)),
showlegend = FALSE
)
setwd("c:\\data")
source("yjy.R")