mcmodels.models.VoxelModel¶
-
class
mcmodels.models.
VoxelModel
(source_voxels, kernel='linear', degree=3, coef0=1, gamma=None, kernel_params=None)[source]¶ Voxel-scale interpolation model for mesoscale connectivity.
Parameters: - source_voxels : array-like, shape=(n_voxels, 3)
List of voxel coordinates at which to interpolate.
See also
NadarayaWatson
References
- Knox et al. ‘High resolution data-driven model of the mouse connectome’.
- bioRxiv 293019; doi: https://doi.org/10.1101/293019
Examples
>>> from mcmodels.core import VoxelModelCache >>> from mcmodels.models import VoxelModel >>> cache = VoxelModelCache >>> # get cortical experiment data >>> cortex_data = cache.get_experiment_data(injection_structure_ids=[315]) >>> source_voxels = cortex_data.source_mask.coordinates >>> reg = VoxelModel(source_voxels) >>> reg.fit((cortex_data.centroids, cortex_data.injections)) VoxelModel(source_voxels=array([[ ... ]]))
Attributes: Methods
fit
(self, X, y[, sample_weight])Fit Voxel Model. get_params
(self[, deep])Get parameters for this estimator. get_weights
(self)Overwrite of NadarayaWatson.get_weights. predict
(self, X)Predict projection volumes given injection volumes. score
(self, X, y[, sample_weight])Returns the coefficient of determination R^2 of the prediction. set_params
(self, \*\*params)Set the parameters of this estimator. -
__init__
(self, source_voxels, kernel='linear', degree=3, coef0=1, gamma=None, kernel_params=None)[source]¶
Methods
__init__
(self, source_voxels[, kernel, …])fit
(self, X, y[, sample_weight])Fit Voxel Model. get_params
(self[, deep])Get parameters for this estimator. get_weights
(self)Overwrite of NadarayaWatson.get_weights. predict
(self, X)Predict projection volumes given injection volumes. score
(self, X, y[, sample_weight])Returns the coefficient of determination R^2 of the prediction. set_params
(self, \*\*params)Set the parameters of this estimator. -
fit
(self, X, y, sample_weight=None)[source]¶ Fit Voxel Model.
- NOTE : X is a concatenation (column wise) of the injection centroid
- coordinates and the injection volumes. This choice was made to be consistent with the sklearn.core.BaseEstimator fit and predict schema
Parameters: - X : {array-like, sparse matrix}, shape=(n_exps, 3+n_source_voxels)
Centroid coordinates concatenated with the injection density for each training experiment.
- y : {array-like, sparse matrix}, shape=(n_exps, n_target_voxels)
Normalized projection density for each training experiment
Returns: - self : returns an instance of self.
-
nodes
¶ Return model nodes (data).
-
predict
(self, X)[source]¶ Predict projection volumes given injection volumes.
- NOTE : X is a concatenation (column wise) of the injection centroid
- coordinates and the injection volumes. This choice was made to be consistent with the sklearn.core.BaseEstimator fit and predict schema
Parameters: - X : {array-like, sparse matrix}, shape=(n_exps, 3+n_source_voxels)
Centroid coordinates concatenated with the injection density for each test experiment.
Returns: - C : array, shape=(X.shape[0], y.shape[1])
Predicted normalized projection densities.
-
weights
¶ Return model weights.