2.1.1.1.1.9. emicroml.modelling.cbed.distortion.estimation.unnormalize_normalizable_elems_in_ml_data_dict
- unnormalize_normalizable_elems_in_ml_data_dict(ml_data_dict, normalization_weights=None, normalization_biases=None, check_ml_data_dict_first=True)[source]
Unnormalize in-place normalizable features of a dictionary representation of machine learning data instances.
See the documentation for the function
emicroml.modelling.cbed.distortion.estimation.normalize_normalizable_elems_in_ml_data_dict()
for a discussion on normalized features of machine learning (ML) data instances.The current function unnormalizes in-place the normalizable features of a dictionary representation
ml_data_dict
of complete or incomplete ML data instances. If complete, the ML data instances can be used to train and/or evaluate ML models represented by the classemicroml.modelling.cbed.distortion.estimation.MLModel
.Each dict key in
ml_data_dict
is the name of a feature of the ML data instances. A complete dictionary representation is identical in structure to a dictionary returned by the methodemicroml.modelling.cbed.distortion.estimation.MLDataset.get_ml_data_instances()
of the classemicroml.modelling.cbed.distortion.estimation.MLDataset
. See the documentation for said method for more details. An incomplete dictionary representation is identical in structure to a complete dictionary representation, except that at least one dict item is missing.The normalizable features are
"undistorted_disk_center_sets"
,"common_undistorted_disk_radii"
,"distortion_centers"
,"quadratic_radial_distortion_amplitudes"
,"spiral_distortion_amplitudes"
,"elliptical_distortion_vectors"`, and ``"parabolic_distortion_vectors"
.Let
normalized_values
be the normalized values of a normalizable feature of the ML data instances. The reverse normalization is performed byunnormalized_values = ((normalized_values-normalization_bias) / normalization_weight)
where
unnormalized_values
are the unnormalized values,normalization_weight
is a valid normalization weight, andnormalization_bias
is a valid noramlization bias. Valid normalization weights and biases are those with values that yield unnormalized features with elements that lie within valid ranges of values.- Parameters:
- ml_data_dictdict
The dictionary representation of the ML data instances, for which to perform in-place reverse normalization. Prior to reverse normalization, all normalizable features are assumed to be normalized.
- normalization_weightsdict, optional
The normalization weights. The dict keys must be the same as those as the instance attribute
emicroml.modelling.cbed.distortion.estimation.MLDataset.normalization_weights
of the classemicroml.modelling.cbed.distortion.estimation.MLDataset
. The value of each dict item is expected to be a valid real number.- normalization_biasesdict, optional
The normalization biases. The dict keys must be the same as those as the instance attribute
emicroml.modelling.cbed.distortion.estimation.MLDataset.normalization_biases
of the classemicroml.modelling.cbed.distortion.estimation.MLDataset
. The value of each dict item is expected to be a valid real number.- check_ml_data_dict_firstbool, optional
If
check_ml_data_dict_first
is set toTrue
, thenml_data_dict
is checked, raising an exception ifml_data_dict
is not a valid dictionary representation of ML data instances. Otherwise,ml_data_dict
is not checked.