FitValidator#

class scarlet2.infer.FitValidator(scene: Scene, observation)[source]#

Bases: object

A class containing all of the validation checks for a Scene objects after calling .fit().

Note that the metaclass is defined as MethodCollector, which collects all validation methods in this class into a single class attribute list called validation_checks. This allows for easy iteration over all checks.

Initialize the FitValidator.

Parameters:
  • scene (Scene) – The scene object to validate.

  • observation (Observation) – The observation object containing the data to validate against.

check_chi_square_in_box_and_border() → list[ValidationResult][source]#

Evaluate the weighted mean (weighted by the inverse variance weights) of the squared residuals for each source. Chi square is also computed for the perimeter outside the box of with border_width.

Returns:

A list of ValidationResult subclasses for each source. For each source there will be two results. One for inside the bounding box and one for the border. The ValidationResults will each be one of the following: - If the chi-square is above the critical threshold, a ValidationError. - If the chi-square is below the tolerable threshold, a ValidationInfo. - If the chi-square is between the two thresholds, a ValidationWarning.

Return type:

list[ValidationResult]

check_goodness_of_fit() → ValidationResult[source]#

Evaluate the goodness of the model fit to the data by calling the Observation class’s goodness_of_fit method. Please see the docstring for that method for details.

Returns:

A subclass of ValidationResult indicating the result of the check.

Return type:

ValidationResult