R 신경망 분석

1 개요

R 신경망 분석
R 인공신경망분석

2 nnet

2.1 예시: iris 자료

df = iris
library(nnet)
model = nnet(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, df, size=2, rang=0.1, decay=0.0005, maxit=200)
summary(model)

options(echo=T)

# 시각화
library(NeuralNetTools)
png(width=800, height=350, pointsize=10)
plotnet(model)

# 자가 테스트
table(df$Species, predict(model, df, type="class"))

2.2 예시: ifert 자료

df = infert
library(nnet)
model = nnet(case ~ age + parity + induced + spontaneous, df, size=2, rang=0.1, decay=0.0005, maxit=200)
summary(model)

options(echo=T)

# 시각화
library(NeuralNetTools)
png(width=800, height=350, pointsize=10)
plotnet(model)

# 자가 테스트
table(df$case, predict(model, df))

3 neuralnet

3.1 예시: iris 자료

df = iris
library(neuralnet)
model = neuralnet(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, df, hidden=2)
summary(model)

# 시각화
plot(model)

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}