Learn R Programming

validann (version 1.2.1)

observed: Return observed target values.

Description

Return observed target values used for fitting `ann' or `nnet' ANN models.

Usage

observed(object)

Arguments

object
an object of class `ann' as returned by ann or of class `nnet' as returned by nnet.

Value

a 1-column matrix of observed target values.

Details

This function can be invoked by calling observed(x) for an object x of class `ann' or `nnet'.

Examples

Run this code
# Get observed values of y used to train ann object `fit'.
# ---
data("ar9")
samp <- sample(1:1000, 200)
y <- ar9[samp, ncol(ar9)]
x <- ar9[samp, -ncol(ar9)]
x <- x[, c(1,4,9)]
fit <- ann(x, y, size = 1, act_hid = "tanh", act_out = "linear", rang = 0.1)
y_obs <- observed(fit)

Run the code above in your browser using DataLab