physbo.blm.core.model module¶
-
class
physbo.blm.core.model.
model
(lik, prior, options={})[ソース]¶ ベースクラス:
object
Baysean Linear Model
-
prior
¶ prior distribution of weights
- Type
physbo.blm.prior.gauss
-
lik
¶ kernel
- Type
physbo.blm.lik.gauss
-
nbasis
¶ number of features in random feature map
- Type
int
-
stats
¶ auxially parameters for sampling
- Type
Tuple
-
method
¶ sampling method
- Type
str
-
get_post_fcov
(X, Psi=None, diag=True)[ソース]¶ calculates posterior covariance of model
- パラメータ
X (numpy.ndarray) -- inputs
Psi (numpy.ndarray) -- feature maps (default: blm.lik.linear.basis.get_basis(X))
diag (bool) -- if True, returns only variances as a diagonal matrix (default: True)
- 戻り値
- 戻り値の型
numpy.ndarray
-
get_post_fmean
(X, Psi=None, w=None)[ソース]¶ calculates posterior mean of model (function)
- パラメータ
X (numpy.ndarray) -- inputs
Psi (numpy.ndarray) -- feature maps
w (numpy.ndarray) -- weight
-
post_sampling
(Xtest, Psi=None, N=1, alpha=1.0)[ソース]¶ draws samples of mean value of model
- パラメータ
Xtest (numpy.ndarray) -- inputs
Psi (numpy.ndarray) -- feature maps (default:
blm.lik.get_basis(Xtest)
)N (int) -- number of samples (default: 1)
alpha (float) -- noise for sampling source
- 戻り値
- 戻り値の型
numpy.ndarray
-
predict_sampling
(Xtest, Psi=None, N=1)[ソース]¶ draws samples from model
- パラメータ
Xtest (numpy.ndarray) -- inputs
Psi (numpy.ndarray) -- feature map (default:
blm.lik.get_basis(Xtest)
)N (int) -- number of samples (default: 1)
- 戻り値
- 戻り値の型
numpy.ndarray
-
prepare
(X, t, Psi=None)[ソース]¶ initializes model by using the first training dataset
- パラメータ
X (numpy.ndarray) -- inputs
t (numpy.ndarray) -- target (label)
Psi (numpy.ndarray) -- feature maps
-