mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-65175_master-fixup' of git://github.com/dmonllao/moodle
This commit is contained in:
commit
a8ec611f57
@ -204,13 +204,14 @@ class models_list implements \renderable, \templatable {
|
||||
|
||||
$actionid = 'evaluate-' . $model->get_id();
|
||||
|
||||
$modeltimesplittingmethods = $timesplittingmethods;
|
||||
// Include the current time-splitting method as the default selection method the model already have one.
|
||||
if ($model->get_model_obj()->timesplitting) {
|
||||
$currenttimesplitting = ['id' => 'current', 'text' => get_string('currenttimesplitting', 'tool_analytics')];
|
||||
array_unshift($timesplittingmethods, $currenttimesplitting);
|
||||
array_unshift($modeltimesplittingmethods, $currenttimesplitting);
|
||||
}
|
||||
|
||||
$evaluateparams = [$actionid, $trainedonlyexternally, $timesplittingmethods];
|
||||
$evaluateparams = [$actionid, $trainedonlyexternally, $modeltimesplittingmethods];
|
||||
$PAGE->requires->js_call_amd('tool_analytics/model', 'selectEvaluationOptions', $evaluateparams);
|
||||
$urlparams['action'] = 'evaluate';
|
||||
$url = new \moodle_url('model.php', $urlparams);
|
||||
|
@ -291,11 +291,15 @@ class processor implements \core_analytics\classifier, \core_analytics\regressor
|
||||
|
||||
// We need at least 2 samples belonging to each target.
|
||||
$counts = array_count_values($targets);
|
||||
$ntargets = count(explode(',', $metadata['targetclasses']));
|
||||
foreach ($counts as $count) {
|
||||
if ($count < 2) {
|
||||
$notenoughdata = true;
|
||||
}
|
||||
}
|
||||
if ($ntargets > count($counts)) {
|
||||
$notenoughdata = true;
|
||||
}
|
||||
if (!empty($notenoughdata)) {
|
||||
$resultobj = new \stdClass();
|
||||
$resultobj->status = \core_analytics\model::NOT_ENOUGH_DATA;
|
||||
|
Loading…
x
Reference in New Issue
Block a user