Generate
Generate some fake data for various purposes.
sample_from_lda(components_prior, components_time_slots_prior, n_samples, random_state=None)
Sample from LDA model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
components_prior
|
ndarray | TensorVariable
|
prior probability of each component (n_components, ) |
required |
components_time_slots_prior
|
ndarray | TensorVariable
|
prior for time slots (n_components, n_time_slots) |
required |
n_samples
|
ndarray
|
number of samples for each user (n_user, ) |
required |
random_state
|
int | None
|
random state for sampling |
None
|
Returns:
Type | Description |
---|---|
tuple[DataFrame, DataFrame]
|
probability DataFrame (n_user, n_components) and event count DataFrame with (n_user, n_time_slots) with each row summing up to |
Source code in latent_calendar/generate.py
wide_format_dataframe(n_rows, rate=1.0, random_state=None)
Generate some data from Poisson distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_rows
|
int
|
number of rows to generate |
required |
rate
|
float
|
rate parameter for Poisson distribution |
1.0
|
random_state
|
int | None
|
random state for reproducibility |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame with columns from FULL_VOCAB and n_rows rows |