commonpower.data_forecasting.nn_forecasting.eval_metrics.RootMeanSquaredError
- class RootMeanSquaredError(*, name: str = 'rmse')[source]
Bases:
EvalMetricRoot Mean Squared Error (RMSE) evaluation metric.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Methods
constructcopyReturns a copy of the model.
dictfrom_ormjsonmodel_constructCreates a new instance of the Model class with validated data.
model_copyUsage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#model_copy
model_dumpUsage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump
model_dump_jsonUsage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump_json
model_json_schemaGenerates a JSON schema for a model class.
model_parametrized_nameCompute the class name for parametrizations of generic classes.
model_post_initOverride this method to perform additional initialization after __init__ and model_construct.
model_rebuildTry to rebuild the pydantic-core schema for the model.
model_validateValidate a pydantic model instance.
model_validate_jsonUsage docs: https://docs.pydantic.dev/2.10/concepts/json/#json-parsing
model_validate_stringsValidate the given object with string data against the Pydantic model.
parse_fileparse_objparse_rawschemaschema_jsonupdate_forward_refsvalidateAttributes
model_computed_fieldsConfiguration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_extraGet extra fields set during validation.
model_fieldsmodel_fields_setReturns the set of fields that have been explicitly set on this model instance.
name- __call__(y_true: Tensor, y_pred: Tensor) float[source]
Calculate the Root Mean Squared Error (RMSE).
- Parameters:
y_true (Tensor) – The ground truth values.
y_pred (Tensor) – The predicted values.
- Returns:
float – The RMSE value.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].