chap_core.predictor package¶
Submodules¶
chap_core.predictor.feature_spec module¶
- class chap_core.predictor.feature_spec.Feature(*, id: str, name: str, description: str, optional: bool = False)[source]¶
Bases:
BaseModel- description: str¶
- id: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
- optional: bool¶
chap_core.predictor.model_registry module¶
chap_core.predictor.naive_estimator module¶
chap_core.predictor.naive_predictor module¶
- class chap_core.predictor.naive_predictor.MultiRegionNaivePredictor(*args, **kwargs)[source]¶
Bases:
objectTODO: This should be a linear regression of prev cases and season for each location.
- class chap_core.predictor.naive_predictor.MultiRegionPoissonModel(*args, **kwargs)[source]¶
Bases:
object
chap_core.predictor.poisson module¶
- class chap_core.predictor.poisson.Poisson(alpha=1, fit_intercept=True)[source]¶
Bases:
object- train(x, y)[source]¶
- Train the model on a dataframe that has the column Disease, plus other features. The feature order is
expected to be the same between training and prediction without explicit feature names.
- sample_data = pd.DataFrame({
“Disease”: [1, 2, 3, 4, 5], “Disease1”: [1, 2, 3, 4, 5], “Disease2”: [1, 2, 3, 4, 5], “Rain”: [1, 2, 3, 4, 5], “Temperature”: [1, 2, 3, 4, 5],
})
chap_core.predictor.protocol module¶
- class chap_core.predictor.protocol.IsMultiRegionForecastSampler(*args, **kwargs)[source]¶
Bases:
ProtocolModel that can sample forward for multiple locations in time given a set of weather data.
chap_core.predictor.published_models module¶
- class chap_core.predictor.published_models.ExternalModelSpec(*, name: str, parameters: dict, features: list[Feature], period: PeriodType = PeriodType.any, description: str = 'No Description yet', author: str = 'Unknown Author', targets: str = 'disease_cases', github_link: str)[source]¶
Bases:
ModelSpec- github_link: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].