Skip to content
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

Adding weighted average documentation page #5

Open
wants to merge 4 commits into
base: integ/weighted_average
Choose a base branch
from

Conversation

MitchellGale
Copy link

Description

Adds documentation page for weighted average
image
image

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
@MitchellGale MitchellGale requested a review from GumpacG April 2, 2024 00:13
"hits": []
},
"aggregations": {
"Weighted_average_response": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess all goes lowercase

Suggested change
"Weighted_average_response": {
"weighted_average_response": {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't matter as it is the name of the result field specified by the query. But for consistency's sake, yes it should be lower case.

{
"size": 0,
"aggs": {
"Weighted_average_response": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Suggested change
"Weighted_average_response": {
"weighted_average_response": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test rendering formula on the dark theme.

The `weighted average` metric is a multi-value metric aggregations that returns the weighted average value. Weighted average can be used when calculating grades for students, where various assignments and exams make-up the final grade of 100%.


A weighted average has two fields, a value and a weight.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on example from https://opensearch.org/docs/latest/aggregations/metric/scripted-metric/#:~:text=A%20script%20has%20four%20stages%3A%20the%20initial%20stage%2C%20the%20map%20stage%2C%20the%20combine%20stage%2C%20and%20the%20reduce%20stage.

Suggested change
A weighted average has two fields, a value and a weight.
A weighted average has two fields: a value and a weight.


Every value field is applied with the respective value in the weight field.

![Weighted average formula]({{site.url}}{{site.baseurl}}/images/aggregations/metric/weighted-average.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried that this causes some inconsistency with size and font from existing formulas like https://github.com/opensearch-project/documentation-website/pull/6808/files

"hits": []
},
"aggregations": {
"Weighted_average_response": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't matter as it is the name of the result field specified by the query. But for consistency's sake, yes it should be lower case.

Signed-off-by: Guian Gumpac <guian.gumpac@improving.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants