Skip to content

innovate.FitResult

All current Python definitions

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

@dataclass(frozen=True)
class FitResult:
model: str
envelope: dict[str, Any]

Keep the native fit envelope and expose parameters and reusable state.

Instances prevent attribute reassignment, but the supplied envelope remains a mutable nested dictionary. Parameter and diagnostic accessors return shallow copies. Constructor options in the envelope are reused by predict. Point estimates and convergence diagnostics do not establish calibrated uncertainty, identifiability or suitability for a scientific application.

  • model: Native model key used to generate predictions from this fit.
  • envelope: Complete successful native fitting response, including the result’s parameters, diagnostics and stored constructor state.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def categorize_adopters(self, data: pl.DataFrame | pl.LazyFrame) -> pl.DataFrame: ...

Predict a scalar rate series and assign historical adopter categories.

  • data: Polars time grid satisfying this fit’s prediction contract. The model must produce one finite, nonnegative rate series.

Input columns, predicted rate and a category string column. Categories depend on the supplied grid’s sample-weighted rate mass, not individual-level adoption histories.

  • ValueError: If scalar rates are unavailable, negative or have zero total mass, or input/output columns violate the native contract.
  • KeyError: If the fit envelope lacks required prediction state.
  • TypeError: If data or stored options cannot cross the native boundary.
  • polars.exceptions.PolarsError: If table processing or IPC fails.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

@property
def diagnostics(self) -> dict[str, Any]: ...

Read the diagnostic fields supplied by the native fitting operation.

Shallow copy of diagnostics such as objective or convergence evidence; available fields depend on the model and fitting operation.

  • KeyError: If the envelope lacks a result or diagnostics mapping.
  • TypeError: If the diagnostics cannot be converted to a dictionary.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

@property
def event_profile(self) -> dict[str, Any] | None: ...

Read candidate scores and convergence for a profiled event fit.

Shallow copy of event_profile, or None when the native result contains no such profile. Scores are not calibrated confidence bounds.

  • KeyError: If the envelope lacks its result mapping.
  • TypeError: If a present profile cannot be converted to a dictionary.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

@property
def joint_time_profile(self) -> dict[str, Any] | None: ...

Read native candidate scores for a joint launch-and-event fit.

Shallow copy of joint_time_profile or None when the fit did not return one. The accessor does not recompute the candidate search.

  • KeyError: If the envelope lacks its result mapping.
  • TypeError: If a present profile cannot be converted to a dictionary.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

@property
def launch_profile(self) -> dict[str, Any] | None: ...

Read candidate scores for a profiled generation-launch fit.

Shallow copy of launch_profile or None when it is absent. The profile retains the native candidate evaluation structure.

  • KeyError: If the envelope lacks its result mapping.
  • TypeError: If a present profile cannot be converted to a dictionary.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

@property
def parameters(self) -> dict[str, float]: ...

Read fitted parameter estimates without exposing the original mapping.

Shallow copy of the native result’s parameter-name/value mapping.

  • KeyError: If a manually constructed or mutated envelope lacks the result or parameters mapping.
  • TypeError: If that mapping cannot be converted to a dictionary.

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def predict(
self,
data: pl.DataFrame | pl.LazyFrame,
*,
quantity: str = 'level',
covariate_rate_columns: dict[str, str] | None = None,
) -> pl.DataFrame: ...

Predict with fitted parameters and the stored constructor options.

  • data: Polars frame with a nonempty, finite, strictly increasing numeric time column and all covariates required by this fit. Lazy input is collected and transported through copying IPC.
  • quantity: "level" by default, or "rate" when supported by the model. Signed rates should not be interpreted as gross incidence.
  • covariate_rate_columns: Optional map from declared Logistic controls to derivative columns, used only for covariate-aware rate output.

Input columns and native prediction columns in the original row order, using the naming and shape contract of the module-level predict.

  • KeyError: If the stored envelope lacks parameters or constructor state.
  • ValueError: If the native prediction, grid, options or output names violate the prediction contract.
  • TypeError: If data or serializable options have unsupported types.
  • polars.exceptions.PolarsError: If collection or IPC conversion fails.