def predict(
    self,
    notes: pd.DataFrame,
    ratings: pd.DataFrame,
    noteStatusHistory: pd.DataFrame,
    prescoringRaterModelOutput: pd.DataFrame,
    maxBatchSize: int = 10000,
  ) -> pd.DataFrame:
    """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"
    # Build list of unique tweetIds
    tweetIds = notes[[c.tweetIdKey]].drop_duplicates()
    tweetIds = tweetIds[tweetIds[c.tweetIdKey] != "-1"]
    # Iterate through batches
    results = [pd.DataFrame({c.noteIdKey: [], LABEL: []})]
    start = 0
    while start < len(tweetIds):
      logger.info(f"processing prediction batch: {start}")
      # Note that all peer tweets must be included in the same batch for correct feature extraction
      tweetBatch = tweetIds.iloc[start : (start + maxBatchSize)]
      noteBatch = (
        notes[[c.noteIdKey, c.tweetIdKey]].merge(tweetBatch)[[c.noteIdKey]].drop_duplicates()
      )
      noteInfo = self._prepare_note_info(
        notes.merge(noteBatch),
        ratings.merge(noteBatch),
        noteStatusHistory.merge(noteBatch),
        prescoringRaterModelOutput,
        prepareForTraining=False,
        cutoff=None,
      )
      noteInfo = self._convert_col_types(noteInfo)
      noteInfo = self._transform_note_info(noteInfo)
      predictions = self._pipeline.decision_function(noteInfo)
      results.append(
        pd.DataFrame(
          {
            c.noteIdKey: noteInfo[c.noteIdKey],
            LABEL: [FLIP if p > self._predictionThreshold else CRH for p in predictions],
          }
        )
      )
      start += maxBatchSize
    return pd.concat(results)
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_plus_model.py