Learn R Programming

simpleNeural (version 0.1.3)

sN.MLPpredict: Runs a multilayer perceptron

Description

Runs a multilayer perceptron

Usage

sN.MLPpredict(nnModel, X, raw = FALSE)

Arguments

nnModel

A list containing the coefficients for the MLP (as produced with sN.MLPtrain())

X

Matrix of predictors

raw

If true, returns score of each output option. If false, returns the output option with highest value.

Value

The predicted values obtained by the MLP

Examples

Run this code
# NOT RUN {
data(UCI.transfusion);
X=as.matrix(sN.normalizeDF(as.data.frame(UCI.transfusion[,1:4])));
y=as.matrix(UCI.transfusion[,5]);
myMLP=sN.MLPtrain(X=X,y=y,hidden_layer_size=4,it=50,lambda=0.5,alpha=0.5);
myPrediction=sN.MLPpredict(nnModel=myMLP,X=X,raw=TRUE);
#library('verification');
#roc.area(y,myPrediction[,2]);
# }

Run the code above in your browser using DataLab