GSgnnRconstructFeatRegScoreEvaluator
- class graphstorm.eval.GSgnnRconstructFeatRegScoreEvaluator(eval_frequency, eval_metric_list=None, use_early_stop=False, early_stop_burnin_rounds=0, early_stop_rounds=3, early_stop_strategy='average_increase')
Bases:
GSgnnRegressionEvaluatorEvaluator for feature reconstruction tasks using regression scores.
A built-in evaluator for feature reconstruction tasks. It uses
mseorrmseas evaluation metrics.This evaluator requires the prediction results to be a 2D float tensor and the label also to be a 2D float tensor, which stores the original features.
Parameters
- eval_frequency: int
The frequency (number of iterations) of doing evaluation.
- eval_metric_list: list of string
Evaluation metrics used during evaluation. Default: [“mse”].
- use_early_stop: bool
Set true to use early stop. Default: False.
- early_stop_burnin_rounds: int
Burn-in rounds (number of evaluations) before starting to check for the early stop condition. Default: 0.
- early_stop_rounds: int
The number of rounds (number of evaluations) for validation scores used to decide early stop. Default: 3.
- early_stop_strategy: str
The early stop strategy. GraphStorm supports two strategies: 1)
consecutive_increase, and 2)average_increase. Default:average_increase.
- compute_score(pred, labels, train=True)
Compute feature reconstruction evaluation scores.
Parameters
- pred: 2D tensor
The 2D tensor stores the prediction results.
- labels: 2D tensor
The 2D tensor stores the labels that are the original node features as this is a feature reconstruction task.
- train: bool
If in model training.
Returns
- scores: dict
Evaluation scores of different feature reconstruction metrics in the format of {metric: score}. If either pred or labels are None, the score will be “N/A”.