perceptronpredict

Predicts target values for the test data points using parameters computed by perceptronFit function

Syntax

predictions = perceptronpredict(parameters,X)

[predictions, probability] = perceptronpredict(parameters,X)

Inputs

parameters
Output of perceptronFit function.
Type: struct
X
Test data.
Type: double
Dimension: vector | matrix

Outputs

predictions
Predictions for the test data.
Type: double
Dimension: vector | matrix
probability
Probability of the test data being in a class.
Type: double
Dimension: matrix

Example

Usage of perceptronpredict

data 	= dlmread('banknote_authentication.txt', ',');
X = data(:, 1:2);
y = data(:, end);

parameters = perceptronfit(X, y);
predictions= perceptronpredict(parameters, X);
> mean(predictions == y')
ans = 0.847667638