Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We expect most classic machine learning algorithms to have a training logic and inference logic. The training logic of the algorithm reads training data (e.g. labeled data) and updates its variables. The inference logic of the algorithm uses the updated variables to make makes prediction (e.g. label) for the unseen data.

The inference logic of this algorithm could be represented as a subclass of Transformer (say TransformerA). The Transformer subclass has a transform() method, which reads data (as Table) and outputs the prediction result data (as Table).

The training logic of this algorithm could be represented as a subclass of Estimator (say EstimatorA). The Estimator subclass has a fit() method, which reads data (as Table) and outputs an instance of the TransformerA (defined above). The TransformerA instance contains the updated variables of this algorithm and can be used to make prediction for the unseen datacould be constructed using variables from the EstimatorA instance.

Then, in order to do training and prediction using this algorithm, a user could write the following code:

Code Block
languagejava
Estimator estimator = new EstimatorA(...)

Table prediction_result = estimator.fit(training_data).transform(inference_data)

...