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:
@@ -43,34 +43,67 @@ interface predictor {
|
||||
public function is_ready();
|
||||
|
||||
/**
|
||||
* Train the provided dataset.
|
||||
* Train this processor classification model using the provided supervised learning dataset.
|
||||
*
|
||||
* @param int $modelid
|
||||
* @param string $uniqueid
|
||||
* @param \stored_file $dataset
|
||||
* @param string $outputdir
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function train($modelid, \stored_file $dataset, $outputdir);
|
||||
public function train_classification($uniqueid, \stored_file $dataset, $outputdir);
|
||||
|
||||
/**
|
||||
* Predict the provided dataset samples.
|
||||
* Classifies the provided dataset samples.
|
||||
*
|
||||
* @param int $modelid
|
||||
* @param string $uniqueid
|
||||
* @param \stored_file $dataset
|
||||
* @param string $outputdir
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function predict($modelid, \stored_file $dataset, $outputdir);
|
||||
public function classify($uniqueid, \stored_file $dataset, $outputdir);
|
||||
|
||||
/**
|
||||
* evaluate
|
||||
* Evaluates this processor classification model using the provided supervised learning dataset.
|
||||
*
|
||||
* @param int $modelid
|
||||
* @param string $uniqueid
|
||||
* @param float $maxdeviation
|
||||
* @param int $niterations
|
||||
* @param \stored_file $dataset
|
||||
* @param string $outputdir
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function evaluate($modelid, $maxdeviation, $niterations, \stored_file $dataset, $outputdir);
|
||||
public function evaluate_classification($uniqueid, $maxdeviation, $niterations, \stored_file $dataset, $outputdir);
|
||||
|
||||
/**
|
||||
* Train this processor regression model using the provided supervised learning dataset.
|
||||
*
|
||||
* @param string $uniqueid
|
||||
* @param \stored_file $dataset
|
||||
* @param string $outputdir
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function train_regression($uniqueid, \stored_file $dataset, $outputdir);
|
||||
|
||||
/**
|
||||
* Estimates linear values for the provided dataset samples.
|
||||
*
|
||||
* @param string $uniqueid
|
||||
* @param \stored_file $dataset
|
||||
* @param mixed $outputdir
|
||||
* @return void
|
||||
*/
|
||||
public function estimate($uniqueid, \stored_file $dataset, $outputdir);
|
||||
|
||||
/**
|
||||
* Evaluates this processor regression model using the provided supervised learning dataset.
|
||||
*
|
||||
* @param string $uniqueid
|
||||
* @param float $maxdeviation
|
||||
* @param int $niterations
|
||||
* @param \stored_file $dataset
|
||||
* @param string $outputdir
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function evaluate_regression($uniqueid, $maxdeviation, $niterations, \stored_file $dataset, $outputdir);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user