|
class Estimator(Stage): |
|
""" |
|
Base class for an estimator in a Surround pipeline. Responsible for performing estimation |
|
or training using the input data. |
|
|
|
This stage is executed by :meth:`surround.assembler.Assembler.run`. |
|
|
|
Example:: |
|
|
|
class Predict(Estimator): |
|
def initialise(self, config): |
|
self.model = load_model(os.path.join(config["models_path"], "model.pb")) |
|
|
|
def estimate(self, state, config): |
|
state.output_data = run_model(self.model) |
|
|
|
def fit(self, state, config): |
|
state.output_data = train_model(self.model) |
|
""" |
|
|
|
@abstractmethod |
|
def estimate(self, state, config): |
|
""" |
|
Process input data and store estimated values. |
|
|
|
.. note:: This method is ONLY called by :meth:`surround.assembler.Assembler.run` when |
|
running in predict/batch-predict mode. |
This is a very small suggestion—it'd be less confusing for someone like me who is new to ML and the Surround project, if in the above snippet used a single term everywhere, i.e. Predict instead of Estimate and Predict, assuming they don't hold different meanings in the ML land/this context. 🙂
surround/surround/stage.py
Lines 43 to 69 in a7638b0
This is a very small suggestion—it'd be less confusing for someone like me who is new to ML and the Surround project, if in the above snippet used a single term everywhere, i.e.
Predictinstead ofEstimateandPredict, assuming they don't hold different meanings in the ML land/this context. 🙂