MDL-59988 analytics: Files marked as used only if valid

- Basic unit test for minimum machine learning backends requirements
- Warning return messages now include not enough data
- Clear models when the predictions processor is changed
- Refined the name of a couple of constants / methods
This commit is contained in:
David Monllao
2017-10-13 12:24:17 +02:00
parent 9a316f3367
commit 325b3bdd8e
11 changed files with 165 additions and 34 deletions
+11 -3
View File
@@ -38,7 +38,7 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso
/**
* The required version of the python package that performs all calculations.
*/
const REQUIRED_PIP_PACKAGE_VERSION = '0.0.2';
const REQUIRED_PIP_PACKAGE_VERSION = '0.0.3';
/**
* The path to the Python bin.
@@ -150,7 +150,11 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso
}
if ($exitcode != 0) {
throw new \moodle_exception('errorpredictionsprocessor', 'analytics', '', implode(', ', $resultobj->errors));
$errors = $resultobj->errors;
if (is_array($errors)) {
$errors = implode(', ', $errors);
}
$resultobj->info = array(get_string('errorpredictionsprocessor', 'analytics', $errors));
}
return $resultobj;
@@ -191,7 +195,11 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso
}
if ($exitcode != 0) {
throw new \moodle_exception('errorpredictionsprocessor', 'analytics', '', implode(', ', $resultobj->errors));
$errors = $resultobj->errors;
if (is_array($errors)) {
$errors = implode(', ', $errors);
}
$resultobj->info = array(get_string('errorpredictionsprocessor', 'analytics', $errors));
}
return $resultobj;