def predict(
    self,
    notes: pd.DataFrame,
    ratings: pd.DataFrame,
    noteStatusHistory: pd.DataFrame,
    prescoringRaterModelOutput: pd.DataFrame,
  ) -> Optional[Pipeline]:
    """Given input DataFrames, predict which notes will flip and lose CRH status.

    Args:
      notes: pd.DataFrame
      ratings: pd.DataFrame
      noteStatusHistory: pd.DataFrame
      prescoringRaterModelOutput: pd.DataFrame

    Returns:
      pd.DataFrame containing noteIds and predicted labels
    """
    assert self._pipeline is not None, "pipeline must be initialized prior to prediction"
    assert (
      self._predictionThreshold is not None
    ), "threshold must be initialized prior to prediction"
    noteInfo = self._prepare_note_info(
      notes, ratings, noteStatusHistory, prescoringRaterModelOutput, pruneNotes=False
    )
    predictions = self._pipeline.decision_function(noteInfo)
    return pd.DataFrame(
      {
        c.noteIdKey: noteInfo[c.noteIdKey],
        LABEL: [FLIP if p > self._predictionThreshold else CRH for p in predictions],
      }
    )
Given input DataFrames, predict which notes will flip and lose CRH status.

    Args:
      notes: pd.DataFrame
      ratings: pd.DataFrame
      noteStatusHistory: pd.DataFrame
      prescoringRaterModelOutput: pd.DataFrame

    Returns:
      pd.DataFrame containing noteIds and predicted labels
    
sourcecode/scoring/pflip_model.py