-
Notifications
You must be signed in to change notification settings - Fork 80
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
Script for plotting: import matplotlib.pyplot as plt
import pandas as pd
from etna.analysis import qq_plot
from etna.analysis.plotters import get_residuals
from etna.datasets import TSDataset
from etna.models import ProphetModel
from etna.pipeline import Pipeline
HORIZON = 14
def main():
df = pd.read_csv("examples/data/example_dataset.csv", parse_dates=["timestamp"])
ts = TSDataset(df=TSDataset.to_dataset(df), freq="D")
ts_train, ts_test = ts.train_test_split(test_size=HORIZON)
model = ProphetModel()
pipeline = Pipeline(model=model, horizon=HORIZON)
pipeline.fit(ts_train)
forecast_ts = pipeline.forecast()
residuals_ts = get_residuals(forecast_df=forecast_ts.to_pandas(), ts=ts)
qq_plot(residuals_ts=residuals_ts)
plt.savefig("qq_plot")
qq_plot(residuals_ts=residuals_ts, qq_plot_params=dict(fit=True))
plt.savefig("qq_plot_with_fit")
qq_plot(residuals_ts=residuals_ts, qq_plot_params=dict(fit=True, line="45"))
plt.savefig("qq_plot_with_fit_and_line")
if __name__ == "__main__":
main() |
Codecov Report
@@ Coverage Diff @@
## master #604 +/- ##
==========================================
- Coverage 85.25% 85.13% -0.12%
==========================================
Files 117 118 +1
Lines 5860 5881 +21
==========================================
+ Hits 4996 5007 +11
- Misses 864 874 +10
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
etna/analysis/eda_utils.py
Outdated
columns_num: int = 2, | ||
figsize: Tuple[int, int] = (10, 5), | ||
): | ||
"""Plot STL decomposition for segments. |
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.
🤔
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.
Copy-paste development)
julia-shenshina
approved these changes
Mar 16, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
IMPORTANT: Please do not create a Pull Request without creating an issue first.
Before submitting (must do checklist)
Type of Change
Proposed Changes
Look #591.
Related Issue
#591.
Closing issues
Closes #591.