Methods
RandomFeatures.Methods.RandomFeatureMethod
— Typestruct RandomFeatureMethod{S<:AbstractString, USorM<:Union{AbstractMatrix, LinearAlgebra.UniformScaling}}
Holds configuration for the random feature fit
random_feature::RandomFeature
: The random feature objectbatch_sizes::Dict{S, Int64} where S<:AbstractString
: A dictionary specifying the batch sizes. Must contain "train", "test", and "feature" keysregularization::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 covariancetullio_threading::Bool
: Use multithreading provided by Tullio
RandomFeatures.Methods.Fit
— Typestruct 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
: TheLinearAlgreba
matrix decomposition of(1 / m) * Feature^T * regularization^-1 * Feature + I
coeffs::AbstractVector
: Coefficients of the fit to dataregularization::Union{AbstractMatrix, LinearAlgebra.UniformScaling}
: output-dim x output_dim matrix 'regularization^{-1}' used during fit
RandomFeatures.Methods.get_random_feature
— Functionget_random_feature(
rfm::RandomFeatureMethod
) -> RandomFeature
gets the random_feature
field
RandomFeatures.Methods.get_batch_sizes
— Functionget_batch_sizes(
rfm::RandomFeatureMethod
) -> Dict{S, Int64} where S<:AbstractString
gets the batch_sizes
field
RandomFeatures.Methods.get_batch_size
— Functionget_batch_size(
rfm::RandomFeatureMethod,
key::AbstractString
) -> Int64
get the specified batch size from batch_sizes
field
RandomFeatures.Methods.get_regularization
— Functionget_regularization(
rfm::RandomFeatureMethod
) -> Union{AbstractMatrix, LinearAlgebra.UniformScaling}
gets the regularization
field, this is the inverse of the provided matrix if keyword regularization_inverted = false
get_regularization(
f::Fit
) -> Union{AbstractMatrix, LinearAlgebra.UniformScaling}
gets the regularization
field (note this is the outputdim regularization)
StatsBase.sample
— Methodsample(rfm::RandomFeatureMethod) -> Any
samples the random_feature field
RandomFeatures.Methods.get_feature_factors
— Functionget_feature_factors(f::Fit) -> Decomposition
gets the feature_factors
field
RandomFeatures.Methods.get_coeffs
— Functionget_coeffs(f::Fit) -> AbstractVector
gets the coeffs
field
StatsAPI.fit
— Functionfit(
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.
StatsAPI.predict
— Functionpredict(
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
StatsAPI.predict!
— Functionpredict!(
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:`outputdim
x
n_samples` - covstore:`outputdim
x
outputdimx
nsamples` - buffer:
n_samples
xoutput_dim
xn_features
RandomFeatures.Methods.predictive_mean
— Functionpredictive_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.
RandomFeatures.Methods.predictive_mean!
— Functionpredictive_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
.
RandomFeatures.Methods.predictive_cov
— Functionpredictive_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
RandomFeatures.Methods.predictive_cov!
— Functionpredictive_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.
RandomFeatures.Methods.predict_prior
— Functionpredict_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
RandomFeatures.Methods.predict_prior_mean
— Functionpredict_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
RandomFeatures.Methods.predict_prior_cov
— Functionpredict_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