4. Task 4

4.3. Task 4.3: Neural networks

Documentation: nnet function - RDocumentation

Action:
ação ícone

Expected:
resultado ícone

> install.packages('nnet')
> library('nnet')

> # subtract 1 from y to ensure values are between 0 and 1
> test <- nnet(x=data[,2:5], y=data[,6]-1, size=1) 
> print(test)     # network detail (weights) isn't shown
> test$wts        # weights
> predict(test, data[,2:5])


 

The prediction have probabilities to be one of the categories.

Action: repeat with training and test sets