Methods

RandomFeatures.Methods.RandomFeatureMethodType
struct RandomFeatureMethod{S<:AbstractString, USorM<:Union{AbstractMatrix, LinearAlgebra.UniformScaling}}

Holds configuration for the random feature fit

  • random_feature::RandomFeature: The random feature object

  • batch_sizes::Dict{S, Int64} where S<:AbstractString: A dictionary specifying the batch sizes. Must contain "train", "test", and "feature" keys

  • regularization::Union{AbstractMatrix, LinearAlgebra.UniformScaling}: A positive definite matrix used during the fit method to regularize the linear solve, interpreted as the inverse of the observational noise covariance

  • tullio_threading::Bool: Use multithreading provided by Tullio

source
RandomFeatures.Methods.FitType
struct Fit{V<:(AbstractVector), USorM<:Union{AbstractMatrix, LinearAlgebra.UniformScaling}}

Holds the coefficients and matrix decomposition that describe a set of fitted random features.

  • feature_factors::Decomposition: The LinearAlgreba matrix decomposition of (1 / m) * Feature^T * regularization^-1 * Feature + I

  • coeffs::AbstractVector: Coefficients of the fit to data

  • regularization::Union{AbstractMatrix, LinearAlgebra.UniformScaling}: output-dim regularization used during fit

source
RandomFeatures.Methods.get_regularizationFunction
get_regularization(
    rfm::RandomFeatureMethod
) -> Union{AbstractMatrix, LinearAlgebra.UniformScaling}

gets the regularization field, this is the inverse of the provided matrix if keyword regularization_inverted = false

source
get_regularization(
    f::Fit
) -> Union{AbstractMatrix, LinearAlgebra.UniformScaling}

gets the regularization field (note this is the outputdim regularization)

source
StatsAPI.fitFunction
fit(
    rfm::RandomFeatureMethod,
    input_output_pairs::EnsembleKalmanProcesses.DataContainers.PairedDataContainer;
    decomposition_type
) -> Fit

Fits a RandomFeatureMethod to input-output data, optionally provide a preferred LinearAlgebra matrix decomposition. Returns a Fit object.

source
StatsAPI.predictFunction
predict(
    rfm::RandomFeatureMethod,
    fit::Fit,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer;
    kwargs...
) -> Tuple{Any, Any}
Makes a prediction of mean and (co)variance of fitted features on new input data
source
StatsAPI.predict!Function
predict!(
    rfm::RandomFeatureMethod,
    fit::Fit,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer,
    mean_store::AbstractMatrix{<:AbstractFloat},
    cov_store::AbstractArray{<:AbstractFloat, 3},
    buffer::AbstractArray{<:AbstractFloat, 3};
    kwargs...
)

Makes a prediction of mean and (co)variance of fitted features on new input data, overwriting the provided stores.

  • meanstore:`outputdimxn_samples`
  • covstore:`outputdimxoutputdimxnsamples`
  • buffer:n_samples x output_dim x n_features
source
RandomFeatures.Methods.predictive_meanFunction
predictive_mean(
    rfm::RandomFeatureMethod,
    fit::Fit,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer;
    kwargs...
) -> Tuple{Any, Any}

Makes a prediction of mean of fitted features on new input data. Returns a output_dim x n_samples array.

source
RandomFeatures.Methods.predictive_mean!Function
predictive_mean!(
    rfm::RandomFeatureMethod,
    fit::Fit,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer,
    mean_store::Matrix{<:AbstractFloat};
    kwargs...
) -> Any

Makes a prediction of mean of fitted features on new input data. Writes into a provided output_dim x n_samples array: mean_store.

source
RandomFeatures.Methods.predictive_covFunction
predictive_cov(
    rfm::RandomFeatureMethod,
    fit::Fit,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer,
    prebuilt_features::AbstractArray{<:AbstractFloat, 3};
    kwargs...
) -> Any
Makes a prediction of (co)variance of fitted features on new input data.

Returns a output_dim x output_dim x n_samples array

source
RandomFeatures.Methods.predictive_cov!Function
predictive_cov!(
    rfm::RandomFeatureMethod,
    fit::Fit,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer,
    cov_store::AbstractArray{<:AbstractFloat, 3},
    buffer::AbstractArray{<:AbstractFloat, 3},
    prebuilt_features::AbstractArray{<:AbstractFloat, 3};
    tullio_threading,
    kwargs...
)
Makes a prediction of (co)variance of fitted features on new input data.

Writes into a provided output_dim x output_dim x n_samples array: cov_store, and uses provided n_samples x output_dim x n_features buffer.

source
RandomFeatures.Methods.predict_priorFunction
predict_prior(
    rfm::RandomFeatureMethod,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer;
    kwargs...
) -> Tuple{Any, Any}

Makes a prediction of mean and (co)variance with unfitted features on new input data

source
RandomFeatures.Methods.predict_prior_meanFunction
predict_prior_mean(
    rfm::RandomFeatureMethod,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer;
    kwargs...
) -> Tuple{Any, Any}

Makes a prediction of mean with unfitted features on new input data

source
RandomFeatures.Methods.predict_prior_covFunction
predict_prior_cov(
    rfm::RandomFeatureMethod,
    new_inputs::EnsembleKalmanProcesses.DataContainers.DataContainer;
    kwargs...
) -> Tuple{Any, Any}

Makes a prediction of (co)variance with unfitted features on new input data

source