@@ -537,55 +537,6 @@ def extend_reservations(self, queue_type):
537537 res = self .client .execute (query_str , {id_param : self .uid })
538538 return res ["extendReservations" ]
539539
540- def create_prediction (self , label , data_row , prediction_model = None ):
541- """ Creates a Prediction within a Legacy Editor Project. Not supported
542- in the new Editor.
543-
544- Args:
545- label (str): The `label` field of the new Prediction.
546- data_row (DataRow): The DataRow for which the Prediction is created.
547- prediction_model (PredictionModel or None): The PredictionModel
548- within which the new Prediction is created. If None then this
549- Project's active_prediction_model is used.
550- Return:
551- A newly created Prediction.
552- Raises:
553- labelbox.excepions.InvalidQueryError: if given `prediction_model`
554- is None and this Project's active_prediction_model is also
555- None.
556- """
557- logger .warning (
558- "`create_prediction` is deprecated and is not compatible with the new editor."
559- )
560-
561- if prediction_model is None :
562- prediction_model = self .active_prediction_model ()
563- if prediction_model is None :
564- raise InvalidQueryError (
565- "Project '%s' has no active prediction model" % self .name )
566-
567- label_param = "label"
568- model_param = "prediction_model_id"
569- project_param = "project_id"
570- data_row_param = "data_row_id"
571-
572- Prediction = Entity .Prediction
573- query_str = """mutation CreatePredictionPyApi(
574- $%s: String!, $%s: ID!, $%s: ID!, $%s: ID!) {createPrediction(
575- data: {label: $%s, predictionModelId: $%s, projectId: $%s,
576- dataRowId: $%s})
577- {%s}}""" % (label_param , model_param , project_param , data_row_param ,
578- label_param , model_param , project_param , data_row_param ,
579- query .results_query_part (Prediction ))
580- params = {
581- label_param : label ,
582- model_param : prediction_model .uid ,
583- data_row_param : data_row .uid ,
584- project_param : self .uid
585- }
586- res = self .client .execute (query_str , params )
587- return Prediction (self .client , res ["createPrediction" ])
588-
589540 def enable_model_assisted_labeling (self , toggle : bool = True ) -> bool :
590541 """ Turns model assisted labeling either on or off based on input
591542
0 commit comments