MDL-59265 analytics: Rename machine learning backend method

- Method names renamed to avoid interface changes once
  we support regression and unsupervised learning
- Adding regressor interface even if not implemente
- predictor interface comments expanded
- Differentiate model's required accuracy from predictions quality
- Add missing get_callback_boundary call
- Updated datasets' metadata to allow 3rd parties to code
  regressors themselves
- Add missing option to exception message
- Include target data into the dataset regardless of being a prediction
  dataset or a training dataset
- Explicit in_array and array_search non-strict calls
- Overwrite discrete should_be_displayed implementation with the binary one
- Overwrite no_teacher get_display_value as it would otherwise look
  wrong
- Other minor fixes
This commit is contained in:
David Monllao 2017-08-14 10:59:03 +02:00
parent b8fe16cd7c
commit 5c5cb3ee15
15 changed files with 265 additions and 51 deletions

View file

@ -64,6 +64,23 @@ class no_teacher extends \core_analytics\local\indicator\binary {
return array('context', 'course');
}
/**
* Reversed because the indicator is in 'negative' and the max returned value means teacher present.
*
* @param float $value
* @param string $subtype
* @return string
*/
public function get_display_value($value, $subtype = false) {
// No subtypes for binary values by default.
if ($value == -1) {
return get_string('yes');
} else if ($value == 1) {
return get_string('no');
}
}
/**
* calculate_sample
*