innovate.categorize_adopters
All current Python definitions
View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4
Signature
Section titled “Signature”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.
Parameters
Section titled “Parameters”data: Polars table with nonempty finite numerictimeand 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".
Returns
Section titled “Returns”Input columns in the original order with an added string category
column containing the native historical adopter labels.
Raises
Section titled “Raises”ValueError: If time/rates violate the native contract, required columns are absent, or acategorycolumn already exists.TypeError: If data is not a supported Polars frame.polars.exceptions.PolarsError: If lazy collection or IPC processing fails.