maxcembalest commited on
Commit
a84813c
1 Parent(s): f77880f

Update electricity.py

Browse files
Files changed (1) hide show
  1. electricity.py +2 -22
electricity.py CHANGED
@@ -16,15 +16,8 @@ _HOMEPAGE = "TBD"
16
 
17
  _LICENSE = "TBD"
18
 
19
- # _URL = "https://huggingface.co/datasets/maxcembalest/electricity/raw/main/"
20
-
21
  _URL = "https://raw.githubusercontent.com/arthuractivemodeling/sandbox-data/main/electricity/data/"
22
 
23
- # _URLS = {
24
- # "train": "https://github.com/arthuractivemodeling/sandbox-data/blob/main/electricity/data/electricity_train.csv",
25
- # "val": "https://github.com/arthuractivemodeling/sandbox-data/blob/main/electricity/data/electricity_val.csv"
26
- # }
27
-
28
  _URLS = {
29
  "train": _URL + "electricity_train.csv",
30
  "val": _URL + "electricity_val.csv"
@@ -36,10 +29,10 @@ class Electricity(datasets.GeneratorBasedBuilder):
36
  VERSION = datasets.Version("0.1.0")
37
 
38
  BUILDER_CONFIGS = [
39
- datasets.BuilderConfig(name="arthur_github", version=VERSION, description="TBD")
40
  ]
41
 
42
- DEFAULT_CONFIG_NAME = "arthur_github"
43
 
44
  # write out the features in the order they appear in the dataframe
45
  FEATURES = ["date", "day", "period", "nswprice", "nswdemand", "vicprice", "vicdemand", "transfer"]
@@ -68,11 +61,6 @@ class Electricity(datasets.GeneratorBasedBuilder):
68
  def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
69
  downloaded_files = dl_manager.download_and_extract(_URLS)
70
 
71
- # return [
72
- # datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
73
- # datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["val"]}),
74
- # ]
75
-
76
  return [
77
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": "electricity_train.csv"}),
78
  datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": "electricity_val.csv"}),
@@ -83,11 +71,3 @@ class Electricity(datasets.GeneratorBasedBuilder):
83
  for row_id, row in data.iterrows():
84
  yield row_id, dict(row)
85
 
86
- # data.columns = self.FEATURES + self.GROUND_TRUTH
87
- # data = self.preprocess(data, config=self.config.name)
88
- # with open(filepath) as f:
89
- # for key, row in enumerate(f):
90
- # if key > 0: assert 0 == 1
91
- # data = json.loads(row)
92
- # yield data["index"], {f: data[f] for f in self.FEATURES+self.GROUND_TRUTH}
93
-
 
16
 
17
  _LICENSE = "TBD"
18
 
 
 
19
  _URL = "https://raw.githubusercontent.com/arthuractivemodeling/sandbox-data/main/electricity/data/"
20
 
 
 
 
 
 
21
  _URLS = {
22
  "train": _URL + "electricity_train.csv",
23
  "val": _URL + "electricity_val.csv"
 
29
  VERSION = datasets.Version("0.1.0")
30
 
31
  BUILDER_CONFIGS = [
32
+ datasets.BuilderConfig(name="default", version=VERSION, description="TBD")
33
  ]
34
 
35
+ DEFAULT_CONFIG_NAME = "default"
36
 
37
  # write out the features in the order they appear in the dataframe
38
  FEATURES = ["date", "day", "period", "nswprice", "nswdemand", "vicprice", "vicdemand", "transfer"]
 
61
  def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
62
  downloaded_files = dl_manager.download_and_extract(_URLS)
63
 
 
 
 
 
 
64
  return [
65
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": "electricity_train.csv"}),
66
  datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": "electricity_val.csv"}),
 
71
  for row_id, row in data.iterrows():
72
  yield row_id, dict(row)
73