Verified Commit 7e225fe1 authored by Nat Okpe's avatar Nat Okpe
Browse files

Fixed issues preventing ML model inference

parent 078643ed
Pipeline #648437178 failed with stages
in 50 minutes and 31 seconds
......@@ -601,6 +601,7 @@ class Services_ML_Controller
}
}
}
Feedback::success("Success");
} catch (Exception $e) {
Feedback::error($e->getMessage());
$forward = [
......
......@@ -212,16 +212,14 @@ class MachineLearningLib extends TikiDb_Bridge
{
$sample = [];
foreach ($processedFields as $field) {
$value = TikiLib::lib('trk')->field_render_value([
'field' => $field,
]);
$sample[] = $value;
$sample[] = $field['type'] === "n" ? floatval($field['value']) : $field['value'];
}
$estimator = $this->getTrainedModel($model);
$result = $estimator->predict(Rubix\ML\Datasets\Unlabeled::build([$sample]));
$result = $estimator->predictSample($sample);
return $result;
return $result[0] ?? "";
}
public function isRegressor($model)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment