sklearn.gaussian_process.Kernel?
class sklearn.gaussian_process.kernels.Kernel
所有內核的基類。
新版本0.18。
屬性 | 說明 |
---|---|
bounds |
方法
方法 | 說明 |
---|---|
__call__ (self, X[, Y, eval_gradient]) |
評估內核。 |
clone_with_theta (self, theta) |
返回具有給定超參數theta的self的克隆。 |
diag (self, X) |
返回內核k(X,X)的對角線。 |
get_params (self[, deep]) |
獲取這個內核的參數。 |
is_stationary (self) |
返回內核是否固定。 |
set_params (self, **params) |
設置此內核的參數。 |
__init__(self, /, *args, **kwargs)
初始化self. See 請參閱help(type(self))以獲得準確的說明 。
abstract __call__(self, X, Y=None, eval_gradient=False)
評估內核。
property bounds
返回的對數變換界限。
返回值 | 說明 |
---|---|
bounds | ndarray of shape (n_dims, 2) 核函數超參數的對數變換界限 |
clone_with_theta(self, theta)
返回帶有給定超參數theta的self的克隆。
返回值 | 說明 |
---|---|
theta | ndarray of shape (n_dims,) 的hyperparameters |
abstract diag(self, X)
返回核函數k(X, X)的對角線。
該方法的結果與np.diag(self(X))相同;但是,由于只計算對角,因此可以更有效地計算它。
參數 | 說明 |
---|---|
X | array-like of shape (n_samples,) 返回核函數k(X, Y)的左參數 |
返回值 | 說明 |
---|---|
K_diag | ndarray of shape (n_samples_X,) 核k(X, X)的對角線 |
get_params(self, deep=True)
獲取這個內核的參數。
參數 | 說明 |
---|---|
deep | bool, default=True 如果為真,將返回此估計器的參數以及包含的作為估計器的子對象。 |
返回值 | 說明 |
---|---|
params | dict 參數名稱映射到它們的值。 |
property hyperparameters
返回所有超參數的列表。
abstract is_stationary(self)
返回內核是否靜止。
property n_dims
返回內核的非固定超參數的數量。
property requires_vector_input
返回內核是在固定長度的特征向量上定義的還是在通用對象上定義的。向后兼容性的默認值為True。
set_params(self, **params)
設置這個內核的參數。
該方法適用于簡單內核和嵌套內核。后者具有形式為
返回值 | 說明 |
---|---|
self | 無 |
property theta
返回(扁平的、對數轉換的)非固定超參數。
注意,theta通常是內核超參數的對數變換值,因為這種搜索空間的表示更適合超參數搜索,因為像長度尺度這樣的超參數自然存在于對數尺度上。
返回值 | 說明 |
---|---|
theta | ndarray of shape (n_dims,) 核函數的非固定、對數變換超參數 |