-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor] Refactor Evaluator #822
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Issue #757 , if available:* *Description of changes:* This PR is the 1st one of a sequence PRs that create new `Evaluator` classes to replace the current `GSgnnInstanceEvaluator`, `GSgnnAccEvaluator`, `GSgnnRegressionEvaluator`, and `GSgnnLPEvaluator`. This PR create the base `GSgnnBaseEvaluator` to replace the current `GSgnnInstanceEvaluator` and `GSgnnLPEvaluator`, and the`GSgnnClassificationEvaluator`, which extends from the base and replace the current `GSgnnAccEvaluator`. This PR also replace all occurrence of `GSgnnAccEvaluator` in core code, examples, documents, and tests. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Ubuntu <[email protected]>
*Issue #757, if available:* *Description of changes:* This is the 2nd PR of the Evaluator refactor work, which adds `GSgnnRegressionEvaluator`, `GSgnnLPEvaluator`, and `GSgnnPerEtypeLPEvaluator`. In addition, this PR also change the name of `GSgnnLPEvalInterface` to `GSgnnMrrLPEvalInterface`, making the meaning of the interface more clear. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Ubuntu <[email protected]>
…819) *Issue #, if available:* *Description of changes:* This is the final PR for evaluator refactoring, which refines the doc string of evaluators. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Co-authored-by: Ubuntu <[email protected]>
Please add the API changes in to PR description if any. |
classicsong
approved these changes
Apr 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
thvasilo
pushed a commit
to thvasilo/graphstorm
that referenced
this pull request
May 17, 2024
*Issue awslabs#757, if available:* *Description of changes:* This PR includes code refactor of GraphStorm "**Evaluators**". And all codes, examples and documentations are refactored accordingly. The major changes include: 1. Unified `GSgnnInstanceEvaluator` and `GSgnnLPEvaluator` classes with `GSgnnBaseEvaluator` plus interface classes, i.e., `GSgnnPredictionEvalInterface` and `GSgnnLPRankingEvalInterface`. In such way, all sub evaluators share the same properties, and also can have different evaluation methods according to the interfaces they implemented. 2. Replaced `GSgnnAccEvaluator` with `GSgnnClassificationEvaluator`, which is implemented by extending `GSgnnBaseEvaluator` and `GSgnnPredictionEvalInterface`. Its behavior is nearly the same as the `GSgnnAccEvaluator`. 3. Modified `GSgnnRegressionEvaluator` in the new way by extending `GSgnnBaseEvaluator` and `GSgnnPredictionEvalInterface`, and unified its behavior as `GSgnnClassificationEvaluator`. 4. Modified `GSgnnMrrLPEvaluator` and `GSgnnPerEtypeMrrLPEvaluator` in the new way by extending `GSgnnBaseEvaluator` and `GSgnnRankingLPEvalInterface`. The detailed changes are: 1. `GSgnnBaseEvaluator` separates evaluator properties from abstract methods, i.e., `evaluate()` and `compute_score()`, which are defined in the interface classes. 2. `GSgnnPredictionEvalInterface` defines the `evaluate()` and `compute_score()` methods for classification and regression tasks, which ask for both predictions and labels as inputs. 3. `GSgnnRankingEvalInterface` defines the `evaluate()` and `compute_score()` methods for ranking-based LP tasks, which ask for ranking values as inputs. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Ubuntu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #757, if available:
Description of changes:
This PR includes code refactor of GraphStorm "Evaluators". And all codes, examples and documentations are refactored accordingly.
The major changes include:
GSgnnInstanceEvaluator
andGSgnnLPEvaluator
classes withGSgnnBaseEvaluator
plus interface classes, i.e.,GSgnnPredictionEvalInterface
andGSgnnLPRankingEvalInterface
. In such way, all sub evaluators share the same properties, and also can have different evaluation methods according to the interfaces they implemented.GSgnnAccEvaluator
withGSgnnClassificationEvaluator
, which is implemented by extendingGSgnnBaseEvaluator
andGSgnnPredictionEvalInterface
. Its behavior is nearly the same as theGSgnnAccEvaluator
.GSgnnRegressionEvaluator
in the new way by extendingGSgnnBaseEvaluator
andGSgnnPredictionEvalInterface
, and unified its behavior asGSgnnClassificationEvaluator
.GSgnnMrrLPEvaluator
andGSgnnPerEtypeMrrLPEvaluator
in the new way by extendingGSgnnBaseEvaluator
andGSgnnRankingLPEvalInterface
.The detailed changes are:
GSgnnBaseEvaluator
separates evaluator properties from abstract methods, i.e.,evaluate()
andcompute_score()
, which are defined in the interface classes.GSgnnPredictionEvalInterface
defines theevaluate()
andcompute_score()
methods for classification and regression tasks, which ask for both predictions and labels as inputs.GSgnnRankingEvalInterface
defines theevaluate()
andcompute_score()
methods for ranking-based LP tasks, which ask for ranking values as inputs.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.