def coalesce_group_model_scored_notes(scoredNotes: pd.DataFrame) -> pd.DataFrame:
  """Coalesce all group modeling columns across note scoring.

  Since each Scorer must have distinct output columns, we use coalescing to run
  multiple instances of MFGroupScorer objects and then condense the results into
  a single set of columns.  This approach works because each note will be scored
  by at most one MFGroupScorer instance.
  """
  for col in [
    c.groupNoteInterceptKey,
    c.groupNoteFactor1Key,
    c.groupRatingStatusKey,
    c.modelingGroupKey,
    c.groupInternalActiveRulesKey,
    c.groupNumFinalRoundRatingsKey,
    c.groupNoteInterceptNoHighVolKey,
  ]:
    scoredNotes = coalesce_columns(scoredNotes, col)

  return scoredNotes
Coalesce all group modeling columns across note scoring.

  Since each Scorer must have distinct output columns, we use coalescing to run
  multiple instances of MFGroupScorer objects and then condense the results into
  a single set of columns.  This approach works because each note will be scored
  by at most one MFGroupScorer instance.
  
sourcecode/scoring/mf_group_scorer.py