Schemas
DataFrame Schemas with Pandera.
- class gval.utils.schemas.AttributeTrackingDf(*args, **kwargs)
Defines the schema for output of _attribute_tracking_xarray() The attributes could be of any datatype. For instance, if your attributes are of float type, you can use Series[float] instead of Series[object].
- attribute_1_benchmark: Series[object] | None = 'attribute_1_benchmark'
- attribute_1_candidate: Series[object] | None = 'attribute_1_candidate'
- attribute_2_benchmark: Series[object] | None = 'attribute_2_benchmark'
- attribute_2_candidate: Series[object] | None = 'attribute_2_candidate'
- classmethod validate_column_suffixes(df: DataFrame, candidate_suffix: str, benchmark_suffix: str) Series[bool]
Checks that each column name in the dataframe ends with either ‘_candidate’ or ‘_benchmark’.
- class gval.utils.schemas.Conditions_df(*args, **kwargs)
Cateogrical conditions df
Inherits columns from Sample_identifiers
- fn: Series[float] | None = 'fn'
- fp: Series[float] | None = 'fp'
- tn: Series[float] | None = 'tn'
- tp: Series[float] | None = 'tp'
- class gval.utils.schemas.Crosstab_df(*args, **kwargs)
Crosstab DF schema
Inherits columns from Sample_identifiers
- agreement_values: Series[float] | None = 'agreement_values'
- benchmark_values: Series = 'benchmark_values'
- candidate_values: Series = 'candidate_values'
- counts: Series[float] = 'counts'
- class gval.utils.schemas.Metrics_df(*args, **kwargs)
Metrics DF schema
Inherits columns from Conditions_df
- class gval.utils.schemas.Pivoted_crosstab_df(*args, **kwargs)
Pivoted Crosstab DF schema
- col_idx: Series[str] = 'col_idx'
- classmethod column_index_name(df: DataFrame) Series[bool]
Checks that column index name is ‘benchmark_values’
- row_idx: Index[Int64] = <Schema Index(name=candidate_values, type=None)>
- class gval.utils.schemas.Prob_metrics_df(*args, **kwargs)
Probabilistic metrics DF schema
- metrics: Series[object] | None = 'metrics'
- class gval.utils.schemas.Sample_identifiers(*args, **kwargs)
Crosstab DF schema
- band: Series[str] = 'band'
- idx: Index[Int64] = 'idx'
- class gval.utils.schemas.Subsample_identifiers(*args, **kwargs)
Crosstab DF schema
- idx: Index[Int64] = 'idx'
- subsample: Series[str] | None = 'subsample'
- class gval.utils.schemas.SubsamplingDf(*args, **kwargs)
Defines the schema for subsampling DataFrame`
- geometry: Series[Geometry] = 'geometry'
- subsample_id: Series[int] = 'subsample_id'
- subsample_type: Series[str] = 'subsample_type'
- weights: int | float | None = 'weights'