Estimators make up the core of the Rubix ML library because they are responsible for computing predictions from a model (regarded as inference). An estimator can be a Classifier, Regressor, Clusterer, or Anomaly Detector and the interpretation of its output depends on this estimator type. For example, the output of a regressor is a single number whereas the predictions made by a classifier will be 1 of k discrete class labels. See the section on Inference for more detals about estimator types and their outputs.

Make Predictions#

Return the predictions from a dataset in an array:

public predict(Dataset $dataset) : array


$predictions = $estimator->predict($dataset);

array(3) {
  string(7) "married"
  string(8) "divorced"
  string(7) "married"

Note: The return value of predict() is an array containing the predictions in the same order that they were indexed in the dataset.

Estimator Type#

Return the integer encoded estimator type:

public type() : int


use Rubix\ML\Estimator;

$type = $estimator->type();

var_dump($type); // Output integer encoded type

var_dump(Estimator::TYPES[$type]); // Output human readable type

string(10) "classifier"

Data Type Compatibility#

Return the data types that this estimator is compatible with:

public compatibility() : array


$compatibility = $estimator->compatiility();