test
Browse files
process_home_value_forecasts.ipynb → processors/process_home_value_forecasts.ipynb
RENAMED
File without changes
|
zillow.py
CHANGED
@@ -48,7 +48,7 @@ _LICENSE = ""
|
|
48 |
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
49 |
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
50 |
# _URLS = {
|
51 |
-
# "
|
52 |
# # "second_domain": "https://huggingface.co/great-new-dataset-second_domain.zip",
|
53 |
# }
|
54 |
|
@@ -68,11 +68,11 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
68 |
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
69 |
|
70 |
# You will be able to load one or the other configurations in the following list with
|
71 |
-
# data = datasets.load_dataset('my_dataset', '
|
72 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
73 |
BUILDER_CONFIGS = [
|
74 |
datasets.BuilderConfig(
|
75 |
-
name="
|
76 |
version=VERSION,
|
77 |
description="This part of my dataset covers a first domain",
|
78 |
),
|
@@ -83,12 +83,12 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
83 |
# ),
|
84 |
]
|
85 |
|
86 |
-
DEFAULT_CONFIG_NAME = "
|
87 |
|
88 |
def _info(self):
|
89 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
90 |
if (
|
91 |
-
self.config.name == "
|
92 |
): # This is the name of the configuration selected in BUILDER_CONFIGS above
|
93 |
features = datasets.Features(
|
94 |
{
|
@@ -111,7 +111,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
111 |
# These are the features of your dataset like images, labels ...
|
112 |
}
|
113 |
)
|
114 |
-
# else: # This is an example to show how to have different features for "
|
115 |
# features = datasets.Features(
|
116 |
# {
|
117 |
# "sentence": datasets.Value("string"),
|
@@ -147,7 +147,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
147 |
# urls = _URLS[self.config.name]
|
148 |
# data_dir = dl_manager.download_and_extract(urls)
|
149 |
# file_train = dl_manager.download(os.path.join('./data/home_value_forecasts', "Metro_zhvf_growth_uc_sfrcondo_tier_0.33_0.67_month.csv"))
|
150 |
-
file_path = os.path.join('processed
|
151 |
# print('*********************')
|
152 |
# print(file_path)
|
153 |
|
@@ -188,7 +188,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
188 |
with open(filepath, encoding="utf-8") as f:
|
189 |
for key, row in enumerate(f):
|
190 |
data = json.loads(row)
|
191 |
-
if self.config.name == "
|
192 |
# Yields examples as (key, example) tuples
|
193 |
yield key, {
|
194 |
"RegionID": data["RegionID"],
|
|
|
48 |
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
49 |
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
50 |
# _URLS = {
|
51 |
+
# "home_value_forecasts": "https://files.zillowstatic.com/research/public_csvs/zhvf_growth/Metro_zhvf_growth_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv",
|
52 |
# # "second_domain": "https://huggingface.co/great-new-dataset-second_domain.zip",
|
53 |
# }
|
54 |
|
|
|
68 |
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
69 |
|
70 |
# You will be able to load one or the other configurations in the following list with
|
71 |
+
# data = datasets.load_dataset('my_dataset', 'home_value_forecasts')
|
72 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
73 |
BUILDER_CONFIGS = [
|
74 |
datasets.BuilderConfig(
|
75 |
+
name="home_value_forecasts",
|
76 |
version=VERSION,
|
77 |
description="This part of my dataset covers a first domain",
|
78 |
),
|
|
|
83 |
# ),
|
84 |
]
|
85 |
|
86 |
+
DEFAULT_CONFIG_NAME = "home_value_forecasts" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
87 |
|
88 |
def _info(self):
|
89 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
90 |
if (
|
91 |
+
self.config.name == "home_value_forecasts"
|
92 |
): # This is the name of the configuration selected in BUILDER_CONFIGS above
|
93 |
features = datasets.Features(
|
94 |
{
|
|
|
111 |
# These are the features of your dataset like images, labels ...
|
112 |
}
|
113 |
)
|
114 |
+
# else: # This is an example to show how to have different features for "home_value_forecasts" and "second_domain"
|
115 |
# features = datasets.Features(
|
116 |
# {
|
117 |
# "sentence": datasets.Value("string"),
|
|
|
147 |
# urls = _URLS[self.config.name]
|
148 |
# data_dir = dl_manager.download_and_extract(urls)
|
149 |
# file_train = dl_manager.download(os.path.join('./data/home_value_forecasts', "Metro_zhvf_growth_uc_sfrcondo_tier_0.33_0.67_month.csv"))
|
150 |
+
file_path = os.path.join('processed', self.config.name, "final.jsonl")
|
151 |
# print('*********************')
|
152 |
# print(file_path)
|
153 |
|
|
|
188 |
with open(filepath, encoding="utf-8") as f:
|
189 |
for key, row in enumerate(f):
|
190 |
data = json.loads(row)
|
191 |
+
if self.config.name == "home_value_forecasts":
|
192 |
# Yields examples as (key, example) tuples
|
193 |
yield key, {
|
194 |
"RegionID": data["RegionID"],
|