grf_gp.model module¶
- class grf_gp.model.ExactGraphGP(x_train, y_train, likelihood, kernel: BaseGRFKernel | BaseExactKernel)¶
Bases:
GraphGPExact graph GP model using the full kernel matrix.
- predict(x_test, **kwargs)¶
Evaluate the exact predictive distribution.
- Parameters:
x_test – Test node indices.
kwargs – Unused prediction options.
- Returns:
Predictive distribution evaluated at
x_test.
- class grf_gp.model.GRFGP(x_train, y_train, likelihood, kernel: BaseGRFKernel | BaseExactKernel)¶
Bases:
GraphGPGraph GP model that predicts by pathwise posterior sampling.
- predict(x_test, batch_size=64)¶
Approximate the predictive distribution from posterior samples.
- Parameters:
x_test – Test node indices.
batch_size – Number of posterior samples used for the estimate.
- Returns:
Approximate predictive multivariate normal distribution.
- predict_sample(x_test, n_samples=64)¶
Draw posterior samples at test nodes.
- Parameters:
x_test – Test node indices.
n_samples – Number of posterior samples to draw.
- Returns:
Posterior samples with shape
(n_samples, len(x_test)).
- class grf_gp.model.GraphGP(x_train, y_train, likelihood, kernel: BaseGRFKernel | BaseExactKernel)¶
Bases:
ExactGP,ABCAbstract base class for graph Gaussian process models.
- forward(x)¶
Construct the GP prior at the requested inputs.
- Parameters:
x – Input node indices.
- Returns:
Multivariate normal prior distribution at
x.
- abstractmethod predict(x_test, **kwargs)¶
Predict at test inputs.
- Parameters:
x_test – Test node indices.
kwargs – Model-specific prediction options.
- Returns:
Predictive distribution or samples at
x_test.
- class grf_gp.model.LowRankGRFGP(x_train, y_train, likelihood, kernel: LowRankGRFKernel)¶
Bases:
GRFGPLow-rank graph GP model using Woodbury pathwise conditioning.
- predict_sample(x_test, n_samples=64)¶
Draw posterior samples using the low-rank feature representation.
- Parameters:
x_test – Test node indices.
n_samples – Number of posterior samples to draw.
- Returns:
Posterior samples with shape
(n_samples, len(x_test)).