class PoissonGLM(design_matrix, spk_times, spk_clu, binwidth=0.02, metric='dsq', model='default', alpha=0, train=0.8, blocktrain=False, mintrials=100, subset=False)[source]

Bases: brainbox.modeling.neural_model.NeuralModel

score(metric='dsq', **kwargs)[source]

Utility function for computing D^2 (pseudo R^2) on a given set of weights and intercepts. Is be used in both model subsetting and the mother score() function of the GLM.

  • weights (pd.Series) – Series in which entries are numpy arrays containing the weights for a given cell. Indices should be cluster ids.

  • intercepts (pd.Series) – Series in which elements are the intercept fit to each cell. Indicies should match weights.

  • dm (numpy.ndarray) – Design matrix. Should not contain the bias column. dm.shape[1] should be the same as the length of an element in weights.

  • binned (numpy.ndarray) – nT x nCells array, in which each column is the binned spike train for a single unit. Should be the same number of rows as dm.

  • the squared deviance of the model (Compute) –

  • how much variance beyond the null model (i.e.) –

  • poisson process with the same mean ((a) –

  • by the intercept (defined) –

  • every time step) the (at) –

  • which was fit explains. (model) –

  • a detailed explanation see https (For) –


A series in which the index are cluster IDs and each entry is the D^2 for the model fit to that cluster

Return type