Skip to content

innovate.categorize_adopters

All current Python definitions

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def categorize_adopters(
data: pl.DataFrame | pl.LazyFrame,
*,
rate_column: str = 'adoption_rate',
) -> pl.DataFrame: ...

Classify observation times using sample-weighted nonnegative adoption rates.

This historical categorization weights sampled times by their rate values; it does not integrate unequal time intervals or classify individual people.

  • data: Polars table with nonempty finite numeric time and rate columns, no nulls, strictly increasing times, nonnegative rates and positive total rate mass. Lazy input is collected and IPC copies buffers.
  • rate_column: Name of the rate column; defaults to "adoption_rate".

Input columns in the original order with an added string category column containing the native historical adopter labels.

  • ValueError: If time/rates violate the native contract, required columns are absent, or a category column already exists.
  • TypeError: If data is not a supported Polars frame.
  • polars.exceptions.PolarsError: If lazy collection or IPC processing fails.