Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

label_events.py 965 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  1. """The purpose of this script is to add a binning to define "buckets" of curtailment events at different cutoffs.
  2. Each of these will be used in a logistic regression to test different sensitivities.
  3. To start, curtailment events will be defined as cutoff values in daily curtailment events.
  4. """
  5. import pandas as pd
  6. from loguru import logger
  7. from src.conf import settings
  8. OUTPUT_DIR = settings.DATA_DIR / "processed/training/"
  9. if __name__ == "__main__":
  10. data = pd.read_parquet(OUTPUT_DIR / "0_labeled_data_daily.parquet")
  11. cutoffs = [
  12. 0.01,
  13. 0.03,
  14. 0.05,
  15. 0.1,
  16. ]
  17. for cutoff in cutoffs:
  18. logger.debug("Labeling curtailment events with {cutoff} pct curtailed of total production.", cutoff=cutoff)
  19. data[f"curtailment_event_{cutoff:.2f}"] = (
  20. data["solar_curtailment"] / data["solar"] > cutoff
  21. )
  22. data.to_parquet(OUTPUT_DIR / "1_labeled_curtailment_events.parquet", index=False)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...