predict.network: Make predictions from a trained network

Description Usage Arguments Value

Description

Predictions are made by feeding new data through the network (see feedforward. For networks with latent variables (mistnet_networks), these variables are sampled randomly from their prior distribution and then each batch of samples is fed through the network

Usage

1
2
3
4
5
6
## S3 method for class 'network'
predict(object, newdata, full_state = FALSE, ...)

## S3 method for class 'mistnet_network'
predict(object, newdata, n_samples,
  full_state = FALSE, ...)

Arguments

object

an object of class network or mistnet_network

newdata

a matrix with the same columns as x

full_state

should the predictions include the full list of network_state produced by feedforward or just the final layer's outputs? By default, only the final layer's outputs are returned.

...

further arguments passed to or from other methods.

n_samples

(for mistnet_networks only). The number of Monte Carlo samples to use

Value

For generic networks, a matrix of output variables (one row per row in newdata, one column per node in the network's final layer). For mistnet networks, a three-dimensional array, with the first two indices matching the generic case and with the third dimension indexing the Monte Carlo samples.

Alternatively, if is TRUE, a network_state object is returned, as in feedforward. For mistnet networks, a list of such objects, a list of such objects (one for each Monte Carlo sample) is returned.


davharris/mistnet2 documentation built on May 14, 2019, 9:28 p.m.