Skip to content

curvefit.core.data.Data

Manages all data to be used for curve fitting

The data class contains all information about the complete dataset, list of groups, column names. Creates observation standard error based on obs_se_func. All sorting will happen immediately in the Data class init and we won’t have to sort again.

NOTE: will prioritize obs_se_func over col_obs_se.

Syntax

d = Data(df, col_t, col_obs, obs_space, col_covs, col_group)

Arguments

  • df (pandas.DataFrame): all data
  • col_t (str): column with time
  • col_obs (str): column with observation values
  • obs_space (callable): function from functions module that specifies what space the col_obs column represents (e.g. ln_gaussian_cdf)
  • col_covs (List[str]): covariate columns
  • col_group (str): group column
  • col_obs_se (optional, str): column with observation standard error specified.
  • obs_se_func (optional, callable): observation standard error function to create from time

Attributes

  • self.groups (List[str]): list of groups, sorted in order
  • self.num_obs (int): dictionary of numbers of observations per group (key)
  • self.times (Dict[str: np.array])): dictionary of times per group (key)

Methods

_get_df

Returns a copy of the data frame or a pointer to the data frame, and optionally data specs. If you plan on modifying the data frame, use copy=True. If a group is passed, then a group-specific data frame will be passed.

  • group (optional, str): optional group name
  • copy (bool): return a copy or not

_get_translated_observations

Returns the observations for a group in a particular space from curvefit.core.functions

  • group (str): which group to return observations for
  • space (callable): which space to translate observations to