Skip to content

Add prediction_actual_scatter_plot #610

Merged
merged 4 commits into from
Mar 22, 2022
Merged

Add prediction_actual_scatter_plot #610

merged 4 commits into from
Mar 22, 2022

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Mar 18, 2022

IMPORTANT: Please do not create a Pull Request without creating an issue first.

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Proposed Changes

Look #590.

Related Issue

#590.

Closing issues

Closes #590.

@Mr-Geekman Mr-Geekman added the enhancement New feature or request label Mar 18, 2022
@Mr-Geekman Mr-Geekman self-assigned this Mar 18, 2022
@Mr-Geekman
Copy link
Contributor Author

Example script:

import matplotlib.pyplot as plt
import pandas as pd

from etna.analysis import prediction_actual_scatter_plot
from etna.datasets import TSDataset
from etna.metrics import MAE
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")
    model = ProphetModel()
    pipeline = Pipeline(model=model, horizon=HORIZON)
    metrics = [MAE()]
    metrics_df, forecast_df, fold_info_df = pipeline.backtest(ts=ts, n_folds=3, metrics=metrics)

    prediction_actual_scatter_plot(forecast_df=forecast_df, ts=ts)
    plt.savefig("prediction_vs_actual_scatter_plot")


if __name__ == "__main__":
    main()

prediction_vs_actual_scatter_plot:
prediction_vs_actual_scatter_plot

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2022

Codecov Report

Merging #610 (a5c90a7) into master (7dd9448) will decrease coverage by 0.39%.
The diff coverage is 12.50%.

@@            Coverage Diff             @@
##           master     #610      +/-   ##
==========================================
- Coverage   85.14%   84.75%   -0.40%     
==========================================
  Files         118      118              
  Lines        5884     5916      +32     
==========================================
+ Hits         5010     5014       +4     
- Misses        874      902      +28     
Impacted Files Coverage Δ
etna/analysis/eda_utils.py 17.31% <9.67%> (-1.61%) ⬇️
etna/analysis/__init__.py 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@martins0n martins0n requested a review from iKintosh March 21, 2022 07:43
@iKintosh iKintosh enabled auto-merge (squash) March 22, 2022 08:13
@iKintosh iKintosh merged commit 067f6ad into master Mar 22, 2022
@iKintosh iKintosh deleted the issue-590 branch March 22, 2022 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create prediction_error_plot
3 participants