Showing posts with label How to solve ANN. Show all posts
Showing posts with label How to solve ANN. Show all posts

Friday, March 1, 2019

How to solve ANN

 How to solve ANN(kohonen)

> install.packages("kohonen")
deep learning,machine learning,what is deep learning,deep learning tutorial,learning,deep learning ai,deep learning python,deep learning training,introduction to deep learning,deep learning tutorial for beginners,mit deep learning,deep learning nlp,udemy deep learning,mario deep learning,caffe deep learning,learn deep learning,python deep learning,o que é deep learning,deep learning matlab

deep learning,machine learning,what is deep learning,deep learning tutorial,learning,deep learning ai,deep learning python,deep learning training,introduction to deep learning,deep learning tutorial for beginners,mit deep learning,deep learning nlp,udemy deep learning,mario deep learning,caffe deep learning,learn deep learning,python deep learning,o que é deep learning,deep learning matlab

Installing package into ‘C:/Users/ADMIN/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/kohonen_3.0.8.zip'
Content type 'application/zip' length 2588576 bytes (2.5 MB)
downloaded 2.5 MB

package ‘kohonen’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\ADMIN\AppData\Local\Temp\Rtmp0qgAjz\downloaded_packages
> library(kohonen)
Warning message:
package ‘kohonen’ was built under R version 3.5.2
> library(kohonen)
> data("wines")
> str(wines)
 num [1:177, 1:13] 13.2 13.2 14.4 13.2 14.2 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:13] "alcohol" "malic acid" "ash" "ash alkalinity" ...
> head(wines)
     alcohol malic acid  ash ash alkalinity magnesium
[1,]   13.20       1.78 2.14           11.2       100
[2,]   13.16       2.36 2.67           18.6       101
[3,]   14.37       1.95 2.50           16.8       113
[4,]   13.24       2.59 2.87           21.0       118
[5,]   14.20       1.76 2.45           15.2       112
[6,]   14.39       1.87 2.45           14.6        96
     tot. phenols flavonoids non-flav. phenols proanth
[1,]         2.65       2.76              0.26    1.28
[2,]         2.80       3.24              0.30    2.81
[3,]         3.85       3.49              0.24    2.18
[4,]         2.80       2.69              0.39    1.82
[5,]         3.27       3.39              0.34    1.97
[6,]         2.50       2.52              0.30    1.98
     col. int. col. hue OD ratio proline
[1,]      4.38     1.05     3.40    1050
[2,]      5.68     1.03     3.17    1185
[3,]      7.80     0.86     3.45    1480
[4,]      4.32     1.04     2.93     735
[5,]      6.75     1.05     2.85    1450
[6,]      5.25     1.02     3.58    1290
>
> view (wines)
Error in view(wines) : could not find function "view"
> view(wines)
Error in view(wines) : could not find function "view"
> head(wines)
     alcohol malic acid  ash ash alkalinity magnesium
[1,]   13.20       1.78 2.14           11.2       100
[2,]   13.16       2.36 2.67           18.6       101
[3,]   14.37       1.95 2.50           16.8       113
[4,]   13.24       2.59 2.87           21.0       118
[5,]   14.20       1.76 2.45           15.2       112
[6,]   14.39       1.87 2.45           14.6        96
     tot. phenols flavonoids non-flav. phenols proanth
[1,]         2.65       2.76              0.26    1.28
[2,]         2.80       3.24              0.30    2.81
[3,]         3.85       3.49              0.24    2.18
[4,]         2.80       2.69              0.39    1.82
[5,]         3.27       3.39              0.34    1.97
[6,]         2.50       2.52              0.30    1.98
     col. int. col. hue OD ratio proline
[1,]      4.38     1.05     3.40    1050
[2,]      5.68     1.03     3.17    1185
[3,]      7.80     0.86     3.45    1480
[4,]      4.32     1.04     2.93     735
[5,]      6.75     1.05     2.85    1450
[6,]      5.25     1.02     3.58    1290
> view (wines)
Error in view(wines) : could not find function "view"
> set.seed(1)
>
> som.wines = som(scale(wines), grid = somgrid(5, 5, "hexagonal"))
>
> dim(getCodes(som.wines))
[1] 25 13
> plot(som.wines, main = "Wine data Kohonen SOM")
> graphics.off()
> par(mfrow = c(1, 1))
>
> plot(som.wines, type = "changes", main = "Wine data: SOM")
> plot(som.wines, main = "Wine data Kohonen SOM")

Black-Scholes formula-R

 Black-Scholes formula-R > BlackScholes <- function(TypeFlag = c("c", "p"), S, X, Time, r, b, sigma) { TypeFla...