fix: update days on market data
Browse files- processed/days_on_market/final.jsonl +2 -2
- processors/days_on_market.ipynb +48 -48
- tester.ipynb +15 -20
processed/days_on_market/final.jsonl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1cf82e9ce68b4ebf991214a7de3fbc8f25de319da470741761d44d11d5cc89f3
|
3 |
+
size 230154547
|
processors/days_on_market.ipynb
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "code",
|
15 |
-
"execution_count":
|
16 |
"metadata": {},
|
17 |
"outputs": [],
|
18 |
"source": [
|
@@ -25,7 +25,7 @@
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
-
"execution_count":
|
29 |
"metadata": {},
|
30 |
"outputs": [
|
31 |
{
|
@@ -322,7 +322,7 @@
|
|
322 |
"[586714 rows x 13 columns]"
|
323 |
]
|
324 |
},
|
325 |
-
"execution_count":
|
326 |
"metadata": {},
|
327 |
"output_type": "execute_result"
|
328 |
}
|
@@ -365,6 +365,34 @@
|
|
365 |
" return df\n",
|
366 |
"\n",
|
367 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
"for filename in os.listdir(FULL_DATA_DIR_PATH):\n",
|
369 |
" if filename.endswith(\".csv\"):\n",
|
370 |
" # print(\"processing \" + filename)\n",
|
@@ -403,37 +431,8 @@
|
|
403 |
" break\n",
|
404 |
"\n",
|
405 |
"\n",
|
406 |
-
"def get_combined_df(data_frames):\n",
|
407 |
-
" combined_df = None\n",
|
408 |
-
" if len(data_frames) > 1:\n",
|
409 |
-
" # iterate over dataframes and merge or concat\n",
|
410 |
-
" combined_df = data_frames[0]\n",
|
411 |
-
" for i in range(1, len(data_frames)):\n",
|
412 |
-
" cur_df = data_frames[i]\n",
|
413 |
-
" combined_df = pd.merge(\n",
|
414 |
-
" combined_df,\n",
|
415 |
-
" cur_df,\n",
|
416 |
-
" on=[\n",
|
417 |
-
" \"RegionID\",\n",
|
418 |
-
" \"SizeRank\",\n",
|
419 |
-
" \"RegionName\",\n",
|
420 |
-
" \"RegionType\",\n",
|
421 |
-
" \"StateName\",\n",
|
422 |
-
" \"Home Type\",\n",
|
423 |
-
" \"Date\",\n",
|
424 |
-
" ],\n",
|
425 |
-
" how=\"outer\",\n",
|
426 |
-
" suffixes=(\"\", \"_\" + str(i)),\n",
|
427 |
-
" )\n",
|
428 |
-
" elif len(data_frames) == 1:\n",
|
429 |
-
" combined_df = data_frames[0]\n",
|
430 |
-
"\n",
|
431 |
-
" return combined_df\n",
|
432 |
-
"\n",
|
433 |
-
"\n",
|
434 |
"combined_df = get_combined_df(data_frames)\n",
|
435 |
"\n",
|
436 |
-
"# iterate over rows of combined df and coalesce column values across columns that start with \"Median Sale Price\"\n",
|
437 |
"columns_to_coalesce = slug_column_mappings.values()\n",
|
438 |
"print(columns_to_coalesce)\n",
|
439 |
"\n",
|
@@ -452,7 +451,7 @@
|
|
452 |
},
|
453 |
{
|
454 |
"cell_type": "code",
|
455 |
-
"execution_count":
|
456 |
"metadata": {},
|
457 |
"outputs": [
|
458 |
{
|
@@ -480,7 +479,7 @@
|
|
480 |
" <th>Size Rank</th>\n",
|
481 |
" <th>Region</th>\n",
|
482 |
" <th>Region Type</th>\n",
|
483 |
-
" <th>
|
484 |
" <th>Home Type</th>\n",
|
485 |
" <th>Date</th>\n",
|
486 |
" <th>Mean Listings Price Cut Amount (Smoothed)</th>\n",
|
@@ -674,18 +673,18 @@
|
|
674 |
"</div>"
|
675 |
],
|
676 |
"text/plain": [
|
677 |
-
" Region ID Size Rank Region Region Type
|
678 |
-
"0 102001 0 United States country
|
679 |
-
"1 102001 0 United States country
|
680 |
-
"2 102001 0 United States country
|
681 |
-
"3 102001 0 United States country
|
682 |
-
"4 102001 0 United States country
|
683 |
-
"... ... ... ... ...
|
684 |
-
"586709 845172 769 Winfield, KS msa
|
685 |
-
"586710 845172 769 Winfield, KS msa
|
686 |
-
"586711 845172 769 Winfield, KS msa
|
687 |
-
"586712 845172 769 Winfield, KS msa
|
688 |
-
"586713 845172 769 Winfield, KS msa
|
689 |
"\n",
|
690 |
" Home Type Date \\\n",
|
691 |
"0 SFR 2018-01-06 \n",
|
@@ -742,7 +741,7 @@
|
|
742 |
"[586714 rows x 13 columns]"
|
743 |
]
|
744 |
},
|
745 |
-
"execution_count":
|
746 |
"metadata": {},
|
747 |
"output_type": "execute_result"
|
748 |
}
|
@@ -755,6 +754,7 @@
|
|
755 |
" \"SizeRank\": \"Size Rank\",\n",
|
756 |
" \"RegionName\": \"Region\",\n",
|
757 |
" \"RegionType\": \"Region Type\",\n",
|
|
|
758 |
" }\n",
|
759 |
")\n",
|
760 |
"\n",
|
@@ -763,7 +763,7 @@
|
|
763 |
},
|
764 |
{
|
765 |
"cell_type": "code",
|
766 |
-
"execution_count":
|
767 |
"metadata": {},
|
768 |
"outputs": [],
|
769 |
"source": [
|
|
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "code",
|
15 |
+
"execution_count": 5,
|
16 |
"metadata": {},
|
17 |
"outputs": [],
|
18 |
"source": [
|
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
+
"execution_count": 6,
|
29 |
"metadata": {},
|
30 |
"outputs": [
|
31 |
{
|
|
|
322 |
"[586714 rows x 13 columns]"
|
323 |
]
|
324 |
},
|
325 |
+
"execution_count": 6,
|
326 |
"metadata": {},
|
327 |
"output_type": "execute_result"
|
328 |
}
|
|
|
365 |
" return df\n",
|
366 |
"\n",
|
367 |
"\n",
|
368 |
+
"def get_combined_df(data_frames):\n",
|
369 |
+
" combined_df = None\n",
|
370 |
+
" if len(data_frames) > 1:\n",
|
371 |
+
" # iterate over dataframes and merge or concat\n",
|
372 |
+
" combined_df = data_frames[0]\n",
|
373 |
+
" for i in range(1, len(data_frames)):\n",
|
374 |
+
" cur_df = data_frames[i]\n",
|
375 |
+
" combined_df = pd.merge(\n",
|
376 |
+
" combined_df,\n",
|
377 |
+
" cur_df,\n",
|
378 |
+
" on=[\n",
|
379 |
+
" \"RegionID\",\n",
|
380 |
+
" \"SizeRank\",\n",
|
381 |
+
" \"RegionName\",\n",
|
382 |
+
" \"RegionType\",\n",
|
383 |
+
" \"StateName\",\n",
|
384 |
+
" \"Home Type\",\n",
|
385 |
+
" \"Date\",\n",
|
386 |
+
" ],\n",
|
387 |
+
" how=\"outer\",\n",
|
388 |
+
" suffixes=(\"\", \"_\" + str(i)),\n",
|
389 |
+
" )\n",
|
390 |
+
" elif len(data_frames) == 1:\n",
|
391 |
+
" combined_df = data_frames[0]\n",
|
392 |
+
"\n",
|
393 |
+
" return combined_df\n",
|
394 |
+
"\n",
|
395 |
+
"\n",
|
396 |
"for filename in os.listdir(FULL_DATA_DIR_PATH):\n",
|
397 |
" if filename.endswith(\".csv\"):\n",
|
398 |
" # print(\"processing \" + filename)\n",
|
|
|
431 |
" break\n",
|
432 |
"\n",
|
433 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
"combined_df = get_combined_df(data_frames)\n",
|
435 |
"\n",
|
|
|
436 |
"columns_to_coalesce = slug_column_mappings.values()\n",
|
437 |
"print(columns_to_coalesce)\n",
|
438 |
"\n",
|
|
|
451 |
},
|
452 |
{
|
453 |
"cell_type": "code",
|
454 |
+
"execution_count": 7,
|
455 |
"metadata": {},
|
456 |
"outputs": [
|
457 |
{
|
|
|
479 |
" <th>Size Rank</th>\n",
|
480 |
" <th>Region</th>\n",
|
481 |
" <th>Region Type</th>\n",
|
482 |
+
" <th>State</th>\n",
|
483 |
" <th>Home Type</th>\n",
|
484 |
" <th>Date</th>\n",
|
485 |
" <th>Mean Listings Price Cut Amount (Smoothed)</th>\n",
|
|
|
673 |
"</div>"
|
674 |
],
|
675 |
"text/plain": [
|
676 |
+
" Region ID Size Rank Region Region Type State \\\n",
|
677 |
+
"0 102001 0 United States country NaN \n",
|
678 |
+
"1 102001 0 United States country NaN \n",
|
679 |
+
"2 102001 0 United States country NaN \n",
|
680 |
+
"3 102001 0 United States country NaN \n",
|
681 |
+
"4 102001 0 United States country NaN \n",
|
682 |
+
"... ... ... ... ... ... \n",
|
683 |
+
"586709 845172 769 Winfield, KS msa KS \n",
|
684 |
+
"586710 845172 769 Winfield, KS msa KS \n",
|
685 |
+
"586711 845172 769 Winfield, KS msa KS \n",
|
686 |
+
"586712 845172 769 Winfield, KS msa KS \n",
|
687 |
+
"586713 845172 769 Winfield, KS msa KS \n",
|
688 |
"\n",
|
689 |
" Home Type Date \\\n",
|
690 |
"0 SFR 2018-01-06 \n",
|
|
|
741 |
"[586714 rows x 13 columns]"
|
742 |
]
|
743 |
},
|
744 |
+
"execution_count": 7,
|
745 |
"metadata": {},
|
746 |
"output_type": "execute_result"
|
747 |
}
|
|
|
754 |
" \"SizeRank\": \"Size Rank\",\n",
|
755 |
" \"RegionName\": \"Region\",\n",
|
756 |
" \"RegionType\": \"Region Type\",\n",
|
757 |
+
" \"StateName\": \"State\",\n",
|
758 |
" }\n",
|
759 |
")\n",
|
760 |
"\n",
|
|
|
763 |
},
|
764 |
{
|
765 |
"cell_type": "code",
|
766 |
+
"execution_count": 8,
|
767 |
"metadata": {},
|
768 |
"outputs": [],
|
769 |
"source": [
|
tester.ipynb
CHANGED
@@ -13,45 +13,40 @@
|
|
13 |
},
|
14 |
{
|
15 |
"cell_type": "code",
|
16 |
-
"execution_count":
|
17 |
"metadata": {},
|
18 |
"outputs": [
|
19 |
{
|
20 |
"name": "stdout",
|
21 |
"output_type": "stream",
|
22 |
"text": [
|
23 |
-
"
|
24 |
-
"new_constructions\n",
|
25 |
-
"for_sale_listings\n",
|
26 |
-
"rentals\n",
|
27 |
-
"sales\n",
|
28 |
-
"home_values\n"
|
29 |
]
|
30 |
},
|
31 |
{
|
32 |
-
"ename": "
|
33 |
-
"evalue": "
|
34 |
"output_type": "error",
|
35 |
"traceback": [
|
36 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
37 |
-
"\u001b[0;
|
38 |
-
"Cell \u001b[0;32mIn[
|
39 |
"File \u001b[0;32m~/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/datasets/load.py:2548\u001b[0m, in \u001b[0;36mload_dataset\u001b[0;34m(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, trust_remote_code, **config_kwargs)\u001b[0m\n\u001b[1;32m 2543\u001b[0m verification_mode \u001b[38;5;241m=\u001b[39m VerificationMode(\n\u001b[1;32m 2544\u001b[0m (verification_mode \u001b[38;5;129;01mor\u001b[39;00m VerificationMode\u001b[38;5;241m.\u001b[39mBASIC_CHECKS) \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m save_infos \u001b[38;5;28;01melse\u001b[39;00m VerificationMode\u001b[38;5;241m.\u001b[39mALL_CHECKS\n\u001b[1;32m 2545\u001b[0m )\n\u001b[1;32m 2547\u001b[0m \u001b[38;5;66;03m# Create a dataset builder\u001b[39;00m\n\u001b[0;32m-> 2548\u001b[0m builder_instance \u001b[38;5;241m=\u001b[39m \u001b[43mload_dataset_builder\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2549\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2550\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2551\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2552\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_files\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_files\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2553\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2554\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeatures\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeatures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2555\u001b[0m \u001b[43m \u001b[49m\u001b[43mdownload_config\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdownload_config\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2556\u001b[0m \u001b[43m \u001b[49m\u001b[43mdownload_mode\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdownload_mode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2557\u001b[0m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2558\u001b[0m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2559\u001b[0m \u001b[43m \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstorage_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2560\u001b[0m \u001b[43m \u001b[49m\u001b[43mtrust_remote_code\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtrust_remote_code\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2561\u001b[0m \u001b[43m \u001b[49m\u001b[43m_require_default_config_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 2562\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mconfig_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2563\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2565\u001b[0m \u001b[38;5;66;03m# Return iterable dataset in case of streaming\u001b[39;00m\n\u001b[1;32m 2566\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m streaming:\n",
|
40 |
"File \u001b[0;32m~/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/datasets/load.py:2257\u001b[0m, in \u001b[0;36mload_dataset_builder\u001b[0;34m(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, trust_remote_code, _require_default_config_name, **config_kwargs)\u001b[0m\n\u001b[1;32m 2255\u001b[0m builder_cls \u001b[38;5;241m=\u001b[39m get_dataset_builder_class(dataset_module, dataset_name\u001b[38;5;241m=\u001b[39mdataset_name)\n\u001b[1;32m 2256\u001b[0m \u001b[38;5;66;03m# Instantiate the dataset builder\u001b[39;00m\n\u001b[0;32m-> 2257\u001b[0m builder_instance: DatasetBuilder \u001b[38;5;241m=\u001b[39m \u001b[43mbuilder_cls\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2258\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2259\u001b[0m \u001b[43m \u001b[49m\u001b[43mdataset_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdataset_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2260\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconfig_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2261\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2262\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_files\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_files\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2263\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mhash\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdataset_module\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mhash\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2264\u001b[0m \u001b[43m \u001b[49m\u001b[43minfo\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minfo\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2265\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeatures\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeatures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2266\u001b[0m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2267\u001b[0m \u001b[43m \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstorage_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2268\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mbuilder_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2269\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mconfig_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2270\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2271\u001b[0m builder_instance\u001b[38;5;241m.\u001b[39m_use_legacy_cache_dir_if_possible(dataset_module)\n\u001b[1;32m 2273\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m builder_instance\n",
|
41 |
-
"File \u001b[0;32m~/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/datasets/builder.py:
|
42 |
-
"File \u001b[0;32m
|
43 |
-
"\u001b[0;
|
44 |
]
|
45 |
}
|
46 |
],
|
47 |
"source": [
|
48 |
"configs = [\n",
|
49 |
-
" \"home_value_forecasts\",\n",
|
50 |
-
" \"new_constructions\",\n",
|
51 |
-
" \"for_sale_listings\",\n",
|
52 |
-
" \"rentals\",\n",
|
53 |
-
" \"sales\",\n",
|
54 |
-
" \"home_values\",\n",
|
55 |
" \"days_on_market\",\n",
|
56 |
"]\n",
|
57 |
"for config in configs:\n",
|
|
|
13 |
},
|
14 |
{
|
15 |
"cell_type": "code",
|
16 |
+
"execution_count": 14,
|
17 |
"metadata": {},
|
18 |
"outputs": [
|
19 |
{
|
20 |
"name": "stdout",
|
21 |
"output_type": "stream",
|
22 |
"text": [
|
23 |
+
"days_on_market\n"
|
|
|
|
|
|
|
|
|
|
|
24 |
]
|
25 |
},
|
26 |
{
|
27 |
+
"ename": "UnboundLocalError",
|
28 |
+
"evalue": "cannot access local variable 'features' where it is not associated with a value",
|
29 |
"output_type": "error",
|
30 |
"traceback": [
|
31 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
32 |
+
"\u001b[0;31mUnboundLocalError\u001b[0m Traceback (most recent call last)",
|
33 |
+
"Cell \u001b[0;32mIn[14], line 12\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m config \u001b[38;5;129;01min\u001b[39;00m configs:\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28mprint\u001b[39m(config)\n\u001b[0;32m---> 12\u001b[0m dataset \u001b[38;5;241m=\u001b[39m \u001b[43mload_dataset\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmisikoff/zillow\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtrust_remote_code\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n",
|
34 |
"File \u001b[0;32m~/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/datasets/load.py:2548\u001b[0m, in \u001b[0;36mload_dataset\u001b[0;34m(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, trust_remote_code, **config_kwargs)\u001b[0m\n\u001b[1;32m 2543\u001b[0m verification_mode \u001b[38;5;241m=\u001b[39m VerificationMode(\n\u001b[1;32m 2544\u001b[0m (verification_mode \u001b[38;5;129;01mor\u001b[39;00m VerificationMode\u001b[38;5;241m.\u001b[39mBASIC_CHECKS) \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m save_infos \u001b[38;5;28;01melse\u001b[39;00m VerificationMode\u001b[38;5;241m.\u001b[39mALL_CHECKS\n\u001b[1;32m 2545\u001b[0m )\n\u001b[1;32m 2547\u001b[0m \u001b[38;5;66;03m# Create a dataset builder\u001b[39;00m\n\u001b[0;32m-> 2548\u001b[0m builder_instance \u001b[38;5;241m=\u001b[39m \u001b[43mload_dataset_builder\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2549\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2550\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2551\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2552\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_files\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_files\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2553\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2554\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeatures\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeatures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2555\u001b[0m \u001b[43m \u001b[49m\u001b[43mdownload_config\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdownload_config\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2556\u001b[0m \u001b[43m \u001b[49m\u001b[43mdownload_mode\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdownload_mode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2557\u001b[0m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2558\u001b[0m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2559\u001b[0m \u001b[43m \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstorage_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2560\u001b[0m \u001b[43m \u001b[49m\u001b[43mtrust_remote_code\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtrust_remote_code\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2561\u001b[0m \u001b[43m \u001b[49m\u001b[43m_require_default_config_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 2562\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mconfig_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2563\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2565\u001b[0m \u001b[38;5;66;03m# Return iterable dataset in case of streaming\u001b[39;00m\n\u001b[1;32m 2566\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m streaming:\n",
|
35 |
"File \u001b[0;32m~/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/datasets/load.py:2257\u001b[0m, in \u001b[0;36mload_dataset_builder\u001b[0;34m(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, trust_remote_code, _require_default_config_name, **config_kwargs)\u001b[0m\n\u001b[1;32m 2255\u001b[0m builder_cls \u001b[38;5;241m=\u001b[39m get_dataset_builder_class(dataset_module, dataset_name\u001b[38;5;241m=\u001b[39mdataset_name)\n\u001b[1;32m 2256\u001b[0m \u001b[38;5;66;03m# Instantiate the dataset builder\u001b[39;00m\n\u001b[0;32m-> 2257\u001b[0m builder_instance: DatasetBuilder \u001b[38;5;241m=\u001b[39m \u001b[43mbuilder_cls\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2258\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2259\u001b[0m \u001b[43m \u001b[49m\u001b[43mdataset_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdataset_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2260\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconfig_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2261\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2262\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_files\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata_files\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2263\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mhash\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdataset_module\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mhash\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2264\u001b[0m \u001b[43m \u001b[49m\u001b[43minfo\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minfo\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2265\u001b[0m \u001b[43m \u001b[49m\u001b[43mfeatures\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeatures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2266\u001b[0m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2267\u001b[0m \u001b[43m \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstorage_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2268\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mbuilder_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2269\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mconfig_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2270\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2271\u001b[0m builder_instance\u001b[38;5;241m.\u001b[39m_use_legacy_cache_dir_if_possible(dataset_module)\n\u001b[1;32m 2273\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m builder_instance\n",
|
36 |
+
"File \u001b[0;32m~/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/datasets/builder.py:382\u001b[0m, in \u001b[0;36mDatasetBuilder.__init__\u001b[0;34m(self, cache_dir, dataset_name, config_name, hash, base_path, info, features, token, use_auth_token, repo_id, data_files, data_dir, storage_options, writer_batch_size, name, **config_kwargs)\u001b[0m\n\u001b[1;32m 379\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m info \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 380\u001b[0m \u001b[38;5;66;03m# TODO FOR PACKAGED MODULES IT IMPORTS DATA FROM src/packaged_modules which doesn't make sense\u001b[39;00m\n\u001b[1;32m 381\u001b[0m info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_exported_dataset_info()\n\u001b[0;32m--> 382\u001b[0m info\u001b[38;5;241m.\u001b[39mupdate(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_info\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 383\u001b[0m info\u001b[38;5;241m.\u001b[39mbuilder_name \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mname\n\u001b[1;32m 384\u001b[0m info\u001b[38;5;241m.\u001b[39mdataset_name \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdataset_name\n",
|
37 |
+
"File \u001b[0;32m~/.cache/huggingface/modules/datasets_modules/datasets/misikoff--zillow/d642880e153f01354c57f69b68ea9e02d46260977e73b26b4c4853d95d4fccac/zillow.py:266\u001b[0m, in \u001b[0;36mNewDataset._info\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 234\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig\u001b[38;5;241m.\u001b[39mname \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhome_values\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m 235\u001b[0m features \u001b[38;5;241m=\u001b[39m datasets\u001b[38;5;241m.\u001b[39mFeatures(\n\u001b[1;32m 236\u001b[0m {\n\u001b[1;32m 237\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRegion ID\u001b[39m\u001b[38;5;124m\"\u001b[39m: datasets\u001b[38;5;241m.\u001b[39mValue(dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstring\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28mid\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRegion ID\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 260\u001b[0m }\n\u001b[1;32m 261\u001b[0m )\n\u001b[1;32m 262\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m datasets\u001b[38;5;241m.\u001b[39mDatasetInfo(\n\u001b[1;32m 263\u001b[0m \u001b[38;5;66;03m# This is the description that will appear on the datasets page.\u001b[39;00m\n\u001b[1;32m 264\u001b[0m description\u001b[38;5;241m=\u001b[39m_DESCRIPTION,\n\u001b[1;32m 265\u001b[0m \u001b[38;5;66;03m# This defines the different columns of the dataset and their types\u001b[39;00m\n\u001b[0;32m--> 266\u001b[0m features\u001b[38;5;241m=\u001b[39m\u001b[43mfeatures\u001b[49m, \u001b[38;5;66;03m# Here we define them above because they are different between the two configurations\u001b[39;00m\n\u001b[1;32m 267\u001b[0m \u001b[38;5;66;03m# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and\u001b[39;00m\n\u001b[1;32m 268\u001b[0m \u001b[38;5;66;03m# specify them. They'll be used if as_supervised=True in builder.as_dataset.\u001b[39;00m\n\u001b[1;32m 269\u001b[0m \u001b[38;5;66;03m# supervised_keys=(\"sentence\", \"label\"),\u001b[39;00m\n\u001b[1;32m 270\u001b[0m \u001b[38;5;66;03m# Homepage of the dataset for documentation\u001b[39;00m\n\u001b[1;32m 271\u001b[0m homepage\u001b[38;5;241m=\u001b[39m_HOMEPAGE,\n\u001b[1;32m 272\u001b[0m \u001b[38;5;66;03m# License for the dataset if available\u001b[39;00m\n\u001b[1;32m 273\u001b[0m license\u001b[38;5;241m=\u001b[39m_LICENSE,\n\u001b[1;32m 274\u001b[0m \u001b[38;5;66;03m# Citation for the dataset\u001b[39;00m\n\u001b[1;32m 275\u001b[0m citation\u001b[38;5;241m=\u001b[39m_CITATION,\n\u001b[1;32m 276\u001b[0m )\n",
|
38 |
+
"\u001b[0;31mUnboundLocalError\u001b[0m: cannot access local variable 'features' where it is not associated with a value"
|
39 |
]
|
40 |
}
|
41 |
],
|
42 |
"source": [
|
43 |
"configs = [\n",
|
44 |
+
" # \"home_value_forecasts\",\n",
|
45 |
+
" # \"new_constructions\",\n",
|
46 |
+
" # \"for_sale_listings\",\n",
|
47 |
+
" # \"rentals\",\n",
|
48 |
+
" # \"sales\",\n",
|
49 |
+
" # \"home_values\",\n",
|
50 |
" \"days_on_market\",\n",
|
51 |
"]\n",
|
52 |
"for config in configs:\n",
|