sam::DataStrategy¶
Module: Data Strategies
Abstract class for Data Strategies. More...
#include <DataStrategy.h>
Inherited by sam::GRMDataStrategy, sam::LatentDataStrategy, sam::LinearModelStrategy
Public Types¶
Name | |
---|---|
enum | DataModel |
Public Functions¶
Name | |
---|---|
std::unique_ptr< DataStrategy > | build(json & data_strategy_config) DataStrategy Factory Method. |
virtual | ~DataStrategy() =0 Pure destructors of the DataStrategy abstract class. |
virtual void | genData(Experiment * experiment) =0 Generates data based on the selected DataModel. |
virtual std::vector< arma::Row< float > > | genNewObservationsForAllGroups(Experiment * experiment, int n_new_obs) =0 Generates n_new_obs new observations for each group. |
Detailed Description¶
class sam::DataStrategy;
Abstract class for Data Strategies.
A DataGenStrategy should at least two methods, genData
and genNewObservationForAllGroups
. The former is mainly used to populate a new Experiment while the latter is being used by some hacking strategies, e.g. OptionalStopping, where new data — from the same population — is needed.
Public Types Documentation¶
enum DataModel¶
Enumerator | Value | Description |
---|---|---|
LinearModel | ||
LatentModel | ||
GradedResponseModel |
Public Functions Documentation¶
function build¶
static std::unique_ptr< DataStrategy > build(
json & data_strategy_config
)
DataStrategy Factory Method.
Parameters:
- data_strategy_config The data strategy configuration
Return: A unique_ptr to a new DataStrategy
function ~DataStrategy¶
virtual ~DataStrategy() =0
Pure destructors of the DataStrategy abstract class.
function genData¶
virtual void genData(
Experiment * experiment
) =0
Generates data based on the selected DataModel.
Parameters:
- experiment A pointer to an Experiment object
Reimplemented by: sam::LinearModelStrategy::genData, sam::LatentDataStrategy::genData, sam::GRMDataStrategy::genData
Populates the experiment->groups_->measurements
with data based on the parameters specified in setup
.
function genNewObservationsForAllGroups¶
virtual std::vector< arma::Row< float > > genNewObservationsForAllGroups(
Experiment * experiment,
int n_new_obs
) =0
Generates n_new_obs
new observations for each group.
Parameters:
- experiment The pointer to the current experiment
- n_new_obs The number of new observations to be generated
Return: An array of new observations
Reimplemented by: sam::LinearModelStrategy::genNewObservationsForAllGroups, sam::LatentDataStrategy::genNewObservationsForAllGroups, sam::GRMDataStrategy::genNewObservationsForAllGroups
Updated on 29 June 2021 at 16:13:47 CEST