mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-57791 analytics: Changes after review
- Split model::predict in parts - JS promises updated according to eslint-plugin-promise - New API methods replacing direct DB queries - Reduce insights nav link display cost - Increase time limit as well as memory for big processes - Move prediction action event to core - Dataset write locking and others - Refine last time range end time - Removed dodgy splitting method id to int - Replace admin_setting_predictor output_html overwrite for write_setting overwrite - New APIs for access control - Discard invalid samples also during prediction
This commit is contained in:
parent
584ffa4ffc
commit
1611308b58
40 changed files with 513 additions and 289 deletions
|
@ -36,13 +36,16 @@ class test_target_shortname extends \core_analytics\local\target\binary {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function is_valid_sample($sampleid, \core_analytics\analysable $analysable) {
|
||||
public function is_valid_sample($sampleid, \core_analytics\analysable $analysable, $fortraining = true) {
|
||||
// We skip not-visible courses during training as a way to emulate the training data / prediction data difference.
|
||||
// In normal circumstances is_valid_sample will return false when they receive a sample that can not be
|
||||
// processed.
|
||||
if (!$fortraining) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$sample = $this->retrieve('course', $sampleid);
|
||||
if ($sample->visible == 0) {
|
||||
// We skip not-visible courses as a way to emulate the training data / prediction data difference.
|
||||
// In normal circumstances is_valid_sample will return false when they receive a sample that can not be
|
||||
// processed.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -40,6 +40,8 @@ class analytics_model_testcase extends advanced_testcase {
|
|||
|
||||
public function setUp() {
|
||||
|
||||
$this->setAdminUser();
|
||||
|
||||
$target = \core_analytics\manager::get_target('test_target_shortname');
|
||||
$indicators = array('test_indicator_max', 'test_indicator_min', 'test_indicator_fullname');
|
||||
foreach ($indicators as $key => $indicator) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue