You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/workflows/predictors.rst
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -838,3 +838,51 @@ Because training data are shared by all predictors in the graph, a data source d
838
838
If all data sources required to train a predictor are specified elsewhere in the graph, the ``training_data`` parameter may be omitted.
839
839
If the graph contains a predictor that requires formulations data, e.g. a :class:`~citrine.informatics.predictors.simple_mixture_predictor.SimpleMixturePredictor` or :class:`~citrine.informatics.predictors.mean_property_predictor.MeanPropertyPredictor`, any GEM Tables specified by the graph predictor that contain formulation data must provide a formulation descriptor,
840
840
and this descriptor must match the input formulation descriptor of the sub-predictors that require these data.
841
+
842
+
Single Predictions
843
+
---------------------------------
844
+
845
+
Once a :class:`~citrine.informatics.predictors.predictor.Predictor` has been trained, a one-off prediction may be made against it by using the :func:`~citrine.informatics.predictors.predictor.Predictor.predict` method.
846
+
847
+
This method accepts a :class:`~citrine.informatics.predictors.single_predict_request.SinglePredictRequest`, which is akin to a :ref:`DesignCandidate <design_candidate_anchor>` that you can define and modify and is not persisted in the Citrine Platform. When building a :class:`~citrine.informatics.predictors.single_predict_request.SinglePredictRequest` note that only the material properties required to make a prediction (the "input" properties") are required. Indeed, when making a prediction on a predictor using the :func:`~citrine.informatics.predictors.predictor.Predictor.predict` method, the system will automatically filter out any provided material properties that are not inputs to the predictor. The output of a call to ``predict()`` is a :class:`~~citrine.informatics.predictors.single_prediction.SinglePrediction`, which is essentially the :class:`~citrine.informatics.predictors.single_predict_request.SinglePredictRequest` with all of the predicted properties of the material filled in with the predicted values.
848
+
849
+
Note that a ``random_seed`` may be provided to the :class:`~citrine.informatics.predictors.single_predict_request.SinglePredictRequest`. Providing a consistent ``random_seed`` across requests with the same inputs guantees consistent predictions.
850
+
851
+
The following is a simple example of several predictions based on a function that builds a list of prediction requests. This example retrieves 3 candidates from a prior design execution, updates them slightly, and makes new predictions with the updated inputs. Note that while this example uses existing an :ref:`DesignCandidate <design_candidate_anchor>` as a convenience to build the update prediction requests, there is no requirement that a prediction request be related to an existing :ref:`DesignCandidate <design_candidate_anchor>` -- rather any arbitrary request can be made as long as the inputs satisfy the requirements of the predictor.
852
+
853
+
.. code:: python
854
+
855
+
import os
856
+
from citrine import Citrine
857
+
from citrine.informatics.predictors.single_predict_request import SinglePredictRequest
858
+
from citrine.informatics.predictors.single_prediction import SinglePrediction
859
+
860
+
# arbitrary example of building a list of requests
0 commit comments