0.1 다층 신경망 모델

diamonds(ggplot2) 데이터 활용해 다이아몬드 가격 예측

torch 설치 문제

Can you try installing the VC++ redistributable runtime from here: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads x64: vc_redist.x64.exe 설치


0.1.2 데이터 준비

##   carat       cut color clarity depth table price    x    y    z
## 1  0.23     Ideal     E     SI2  61.5    55   326 3.95 3.98 2.43
## 2  0.21   Premium     E     SI1  59.8    61   326 3.89 3.84 2.31
## 3  0.23      Good     E     VS1  56.9    65   327 4.05 4.07 2.31
## 4  0.29   Premium     I     VS2  62.4    58   334 4.20 4.23 2.63
## 5  0.31      Good     J     SI2  63.3    58   335 4.34 4.35 2.75
## 6  0.24 Very Good     J    VVS2  62.8    57   336 3.94 3.96 2.48
##     carat       cut     color   clarity     depth     table     price         x 
## "numeric" "ordered" "ordered" "ordered" "numeric" "numeric" "integer" "numeric" 
##         y         z 
## "numeric" "numeric"
##       carat         cut       color     clarity       depth       table 
##   "numeric" "character" "character" "character"   "numeric"   "numeric" 
##       price           x           y           z 
##   "integer"   "numeric"   "numeric"   "numeric"
##            carat     depth     table price         x          y          z
## [1,] 0.006237006 0.5138889 0.2307692     0 0.3677840 0.06757216 0.07641509
## [2,] 0.002079002 0.4666667 0.3461538     0 0.3621974 0.06519525 0.07264151
##      cut_Good cut_Ideal cut_Premium cut_Very Good color_E color_F color_G
## [1,]        0         1           0             0       1       0       0
## [2,]        0         0           1             0       1       0       0
##      color_H color_I color_J clarity_IF clarity_SI1 clarity_SI2 clarity_VS1
## [1,]       0       0       0          0           0           1           0
## [2,]       0       0       0          0           1           0           0
##      clarity_VS2 clarity_VVS1 clarity_VVS2
## [1,]           0            0            0
## [2,]           0            0            0
## [1]  TRUE FALSE FALSE  TRUE  TRUE  TRUE
##            carat     depth     table         x          y          z cut_Good
## [1,] 0.006237006 0.5138889 0.2307692 0.3677840 0.06757216 0.07641509        0
## [2,] 0.018711019 0.5388889 0.2884615 0.3910615 0.07181664 0.08270440        0
##      cut_Ideal cut_Premium cut_Very Good color_E color_F color_G color_H
## [1,]         1           0             0       1       0       0       0
## [2,]         0           1             0       0       0       0       0
##      color_I color_J clarity_IF clarity_SI1 clarity_SI2 clarity_VS1 clarity_VS2
## [1,]       0       0          0           0           1           0           0
## [2,]       1       0          0           0           0           0           1
##      clarity_VVS1 clarity_VVS2
## [1,]            0            0
## [2,]            0            0