supereeg.
Model
(data=None, locs=None, template=None, numerator=None, denominator=None, n_subs=None, meta=None, date_created=None, rbf_width=20, save=None)[source]¶Model data object for the supereeg package
This class holds your supereeg model. To create an instance, pass a list of brain objects and the model will be generated from those brain objects. You can also add your own model by passing a numpy array as your matrix and the corresponding locations. Alternatively, you can bypass creating a new model by passing numerator, denominator, locations, and n_subs (see parameters for details). Additionally, you can include a meta dictionary with any other information that you want to save with the model.
Parameters: |
|
---|---|
Returns: |
|
Attributes: |
|
Methods
get_locs () |
Returns the locations in the model |
get_model ([z_transform]) |
Returns a copy of the model in the form of a correlation matrix |
get_slice (loc_inds[, inplace]) |
Indexes brain object data |
info () |
Print info about the model object Prints the number of electrodes, number of subjects, date created, and any optional meta data. |
plot_data ([savefile, show]) |
Plot the supereeg model as a correlation matrix This function wraps seaborn’s heatmap and accepts any inputs that seaborn supports for models less than 2000x2000. |
plot_locs ([pdfpath]) |
Plots electrode locations from brain object |
predict (bo[, nearest_neighbor, ...]) |
Takes a brain object and a ‘full’ covariance model, fills in all |
save (fname[, compression]) |
Save method for the model object The data will be saved as a ‘mo’ file, which is a dictionary containing the elements of a model object saved in the hd5 format using deepdish. |
set_locs (new_locs[, force_include_bo_locs]) |
update self.locs to a new set of locations (and blur the correlation matrix accordingly). if |
update (data[, inplace]) |
Update a model with new data. |
get_model
(z_transform=False)[source]¶Returns a copy of the model in the form of a correlation matrix
get_slice
(loc_inds, inplace=False)[source]¶Indexes brain object data
Parameters: |
|
---|
info
()[source]¶Print info about the model object Prints the number of electrodes, number of subjects, date created, and any optional meta data.
plot_data
(savefile=None, show=True, **kwargs)[source]¶Plot the supereeg model as a correlation matrix This function wraps seaborn’s heatmap and accepts any inputs that seaborn supports for models less than 2000x2000. If the model is larger, the plot cannot be generated without specifying a savefile.
Parameters: |
|
---|---|
Returns: |
|
plot_locs
(pdfpath=None)[source]¶Plots electrode locations from brain object
Parameters: |
|
---|
predict
(bo, nearest_neighbor=False, match_threshold='auto', force_update=False, force_include_bo_locs=True, preprocess='zscore', recon_loc_inds=None)[source]¶Takes a brain object and a ‘full’ covariance model, fills in all electrode timeseries for all missing locations and returns the new brain object
Parameters: |
|
---|---|
Returns: |
|
save
(fname, compression='blosc')[source]¶Save method for the model object The data will be saved as a ‘mo’ file, which is a dictionary containing the elements of a model object saved in the hd5 format using deepdish.
Parameters: |
|
---|
set_locs
(new_locs, force_include_bo_locs=False)[source]¶update self.locs to a new set of locations (and blur the correlation matrix accordingly). if force_include_bo_locs is True (default: False), the final set of locations will also include the old locations.
update
(data, inplace=True)[source]¶Update a model with new data.
Parameters: |
|
---|---|
Returns: |
|