def _fill_nans(features: pd.Series) -> pd.Series:
  """Fill NaNs in raw feature values with a constant prior to discretization.

  Args:
    features: pd.Series potentially containing NaN values to be replaced.

  Returns:
    feature array with NaN values replaced by a default, out-of-distribution value.
  """
  MAX_FLOAT = 4
  assert 0 == ((1.5 * features.dropna().abs().values) > MAX_FLOAT).sum()
  return features.fillna(-1 * MAX_FLOAT)
Fill NaNs in raw feature values with a constant prior to discretization.

  Args:
    features: pd.Series potentially containing NaN values to be replaced.

  Returns:
    feature array with NaN values replaced by a default, out-of-distribution value.
  
sourcecode/scoring/pflip_model.py