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

update to the NRQL predictions and PREDICT syntax docs #20086

Merged
merged 9 commits into from
Mar 4, 2025

Conversation

maprahamianNR
Copy link
Contributor

This PR updates some of the information about the new NRQL Predictions functionality (i.e. the PREDICT clause along with the details about its usage). The 2 pages being updated are:

Many of the technical details about the new functionality were incorrect and not explained well for a new user to understand.

Additionally, the 2 images used as examples of the predictions functionality are very poor examples that don't do a good job at demonstrating what the feature does.

@CLAassistant
Copy link

CLAassistant commented Feb 26, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

Hi @maprahamianNR 👋

Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days.

We will automatically generate a preview of your request, and will comment with a link when the preview is ready (usually 10 to 20 minutes).

Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for docs-website-netlify ready!

Name Link
🔨 Latest commit bf34ff2
🔍 Latest deploy log https://app.netlify.com/sites/docs-website-netlify/deploys/67c68e48e64a2e000803cd86
😎 Deploy Preview https://deploy-preview-20086--docs-website-netlify.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@maprahamianNR maprahamianNR marked this pull request as ready for review February 26, 2025 20:52
@cbehera-newrelic cbehera-newrelic self-assigned this Feb 27, 2025
@cbehera-newrelic cbehera-newrelic added content requests related to docs site content from_internal Identifies issues/PRs from Relics (except writers) labels Feb 27, 2025
Comment on lines 235 to 237
Use the `USING` keyword to specify the amount of historical data you want to use to train the model. For example, `PREDICT USING 1 day` uses the query window along with the data from the preceding day to train the model. Make sure the time span is an `integer unit` of time.
amount of time.
</Collapser>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Use the `USING` keyword to specify the amount of historical data you want to use to train the model. For example, `PREDICT USING 1 day` uses the query window along with the data from the preceding day to train the model. Make sure the time span is an `integer unit` of time.
amount of time.
</Collapser>
Use the `USING` keyword to specify the amount of historical data you want to use to train the model. For example, `PREDICT USING 1 day` uses the query window along with the data from the preceding day to train the model. Make sure the time span is an `integer unit` of time.
</Collapser>

nit

Comment on lines +181 to +183
<td>`NONE`</td>
<td>
Disables the seasonality of the time series and generates a non-seasonal prediction.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a note/callout here that NONE is mutually exclusive with gamma.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reference, if you use seasonality: NONE and then include a value for gamma, the model just ignores whatever value you provide for gamma since it is never used. But I don't believe it will error or anything if you included it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can confirm we are seeing errors. I have not investigated yet, but currently we are seeing our generic wrapper for IllegalArgumentException from baselines being returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're correct, that is my mistake. If you set seasonality: NONE and try to set a value for gamma, it will error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

</Collapser>

<Collapser id="by" title={<>Add the <InlineCode>BY</InlineCode> keyword.</>}>
Use the `BY` keyword to set how far ahead in time you want the model to predict. For example, `PREDICT BY 3 hours` generates a prediction 3 hours into the future from the latest point in the time series. Make sure, the time span is an `integer unit` of time.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comma after "Make sure" not needed.

Comment on lines +222 to +223
* **Lower value**: More damping effect to the prediction curve that gradually levels out to a flat curve.
* **Higher value**: Lesser damping effect to the prediction curve.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: All the others have higher before lower. Can we use the same ordering for all for consistency? Since the lower value explanation in this section has more detail, I would be in favor of putting lower in first for all the hyperparams.

@@ -117,7 +117,7 @@ Currently, <DNT>**NRQL predictions**</DNT> only supports the <DNT>**Holt-Winters

## Default behavior [#defaults]
The `PREDICT` clause in a query comes with the following default behaviors:
* **Seasonality**: Automatically detects and identifies if the data exhibits any seasonality.
* **Seasonality**: Automatically detects and identifies any seasonality in the data, allowing you to configure forecasts to follow the identified pattern or remove it.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this would be better worded as: "Automatically detects if seasonality is present in the data and if seasonality is present, uses the detected season length to construct the predictive model. If no seasonality is detected, a non-seasonal model is used."


```sql
FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT holtwinters(beta: 0.5) BY 3 hours USING 1 day
#### Customization [#customization]
Copy link
Contributor

Choose a reason for hiding this comment

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

Something is not rendering properly?
image

Comment on lines 897 to 898
Use the `USING` keyword to specify the amount of historical data you want to use to train the model. For example, `PREDICT USING 1 day` uses the query window along with the data from the preceding day to train the model. Make sure the time span is an `integer unit` of time.
amount of time.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Use the `USING` keyword to specify the amount of historical data you want to use to train the model. For example, `PREDICT USING 1 day` uses the query window along with the data from the preceding day to train the model. Make sure the time span is an `integer unit` of time.
amount of time.
Use the `USING` keyword to specify the amount of historical data you want to use to train the model. For example, `PREDICT USING 1 day` uses the query window along with the data from the preceding day to train the model. Make sure the time span is an `integer unit` of time.

nit

Copy link
Contributor

@sujitnewrelic sujitnewrelic left a comment

Choose a reason for hiding this comment

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

LGTM

@sujitnewrelic sujitnewrelic merged commit a7ecd3f into newrelic:develop Mar 4, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content requests related to docs site content from_internal Identifies issues/PRs from Relics (except writers)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants