Planner¶
Observes the situation for possible new predictions and based on them chooses whether the drift is actually valid. If it’s a real drift, it should be sent to the Executor. A custom Predictor can be done for that too, like a voting one or a more time-consuming algorithm from Scikit-Learn, TensorFlow, PyTorch, or others.
Planner Predictor¶
-
class
driftage.planner.predictor.PlannerPredictor(connection: driftage.db.connection.Connection)¶ Predictor base class for Concept Drift detection.
- Parameters
connection (Connection) – Knowledge Based connection
-
abstract async
predict() → List[driftage.planner.predictor.PredictResult]¶ Using data stored on KB predicts if this data is a Concept Drift of not, to then send or not to the Executor.
- Raises
NotImplementedError – Needs to be implemented when overridden
- Returns
Results predicted that should or shouldn’t be sent to the Executor
- Return type
List[PredictResult]
-
abstract property
predict_period¶ Predict time period (in seconds). This property defines how long PlannerPredictor will wait until next predict call.
- Raises
NotImplementedError – Needs to be implemented when overridden
- Returns
Time it takes to wait for predict in seconds
- Return type
Union[float, int]
-
class
driftage.planner.predictor.PredictResult(identifier: str, predicted: Union[bool, str, int, float], should_send: bool)¶ Dataclass to store each prediction, result and if this prediction should be sent to Executor.
- Parameters
identifier (str) – Data identifier that comes from Monitor or any identifier you want.
predicted (Union[bool, str, int, float]) – Value predicted from Drift detection algorithm. This can even inform type of drift to Executor.
should_send (bool) – If this prediction should be sent to Executor. Sometimes your Planner can decide to not send it because of time or other business rules.
-
identifier: str = None¶
-
predicted: Union[bool, str, int, float] = None¶
-
should_send: bool = None¶