MDL-59067 analytics: Store indicator calculations
This was supposed to be split into multiple commits to make it easier to understand but I failed to do it properly. So this is the list of changes: - New analytics_indicator_calc db table to store indicators calculations - Reuse previous calculations during prediction/training; other models previous calculations should also be reused as long as they belong to the same sample (sampleid depends on sampleorigin), time range and indicator - Allow bulk inserting of these calculations as this can hurt database performance - Block the same analysable to be analysed for training and for prediction - Use a new instance of the target and use it for is_valid_* functions as using ::is_valid_sample can lead to problems if people uses it to cache stuff
This commit is contained in:
@@ -293,6 +293,12 @@ class model {
|
||||
throw new \moodle_exception('errornotimesplittings', 'analytics');
|
||||
}
|
||||
|
||||
if (!empty($options['evaluation'])) {
|
||||
foreach ($timesplittings as $timesplitting) {
|
||||
$timesplitting->set_evaluating(true);
|
||||
}
|
||||
}
|
||||
|
||||
$classname = $target->get_analyser_class();
|
||||
if (!class_exists($classname)) {
|
||||
throw new \coding_exception($classname . ' class does not exists');
|
||||
|
||||
Reference in New Issue
Block a user