Julia Moska commited on
Commit ·
b7c077d
1
Parent(s): 7154101
changes to official data splits
Browse files- chicago_crime.py +5 -4
- data/{crimes_2020.parquet → 2020/chicago_crimes_2020.parquet} +0 -0
- data/2020/chicago_crimes_2020_test.parquet +3 -0
- data/2020/chicago_crimes_2020_train.parquet +3 -0
- data/{crimes_2021.parquet → 2021/chicago_crimes_2021.parquet} +0 -0
- data/2021/chicago_crimes_2021_test.parquet +3 -0
- data/2021/chicago_crimes_2021_train.parquet +3 -0
- data/{crimes_2022.parquet → 2022/chicago_crimes_2022.parquet} +0 -0
- data/2022/chicago_crimes_2022_test.parquet +3 -0
- data/2022/chicago_crimes_2022_train.parquet +3 -0
chicago_crime.py
CHANGED
|
@@ -25,13 +25,13 @@ class ChicagoCrimesDatasetConfig(datasets.BuilderConfig):
|
|
| 25 |
|
| 26 |
class FourSquareDataset(datasets.ArrowBasedBuilder):
|
| 27 |
BUILDER_CONFIG_CLASS = ChicagoCrimesDatasetConfig
|
| 28 |
-
# DEFAULT_CONFIG_NAME = "all"
|
| 29 |
BUILDER_CONFIGS = [
|
| 30 |
|
| 31 |
ChicagoCrimesDatasetConfig(
|
| 32 |
name=y,
|
| 33 |
description="",
|
| 34 |
-
data_url=f"https://huggingface.co/datasets/kraina/chicago_crime/resolve/main/data/
|
|
|
|
| 35 |
|
| 36 |
) for y in YEARS
|
| 37 |
]
|
|
@@ -41,7 +41,7 @@ class FourSquareDataset(datasets.ArrowBasedBuilder):
|
|
| 41 |
def _info(self):
|
| 42 |
return datasets.DatasetInfo(
|
| 43 |
# This is the description that will appear on the datasets page.
|
| 44 |
-
description=DESCRIPTION,
|
| 45 |
homepage="https://data.cityofchicago.org",
|
| 46 |
# This defines the different columns of the dataset and their types
|
| 47 |
features=datasets.Features(
|
|
@@ -76,7 +76,8 @@ class FourSquareDataset(datasets.ArrowBasedBuilder):
|
|
| 76 |
# files = _URLS[self.config.name]
|
| 77 |
downloaded_files = dl_manager.download(self.config.data_url)
|
| 78 |
return [
|
| 79 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={'filepath': downloaded_files})
|
|
|
|
| 80 |
]
|
| 81 |
|
| 82 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
|
|
|
| 25 |
|
| 26 |
class FourSquareDataset(datasets.ArrowBasedBuilder):
|
| 27 |
BUILDER_CONFIG_CLASS = ChicagoCrimesDatasetConfig
|
|
|
|
| 28 |
BUILDER_CONFIGS = [
|
| 29 |
|
| 30 |
ChicagoCrimesDatasetConfig(
|
| 31 |
name=y,
|
| 32 |
description="",
|
| 33 |
+
data_url={"train": f"https://huggingface.co/datasets/kraina/chicago_crime/resolve/main/data/{y}/chicago_crimes_{y}_train.parquet",
|
| 34 |
+
"test": f"https://huggingface.co/datasets/kraina/chicago_crime/resolve/main/data/{y}/chicago_crimes_{y}_test.parquet"}
|
| 35 |
|
| 36 |
) for y in YEARS
|
| 37 |
]
|
|
|
|
| 41 |
def _info(self):
|
| 42 |
return datasets.DatasetInfo(
|
| 43 |
# This is the description that will appear on the datasets page.
|
| 44 |
+
description=f"This is the official train test split for Chicago Crime dataset of year {self.config.name}"+DESCRIPTION,
|
| 45 |
homepage="https://data.cityofchicago.org",
|
| 46 |
# This defines the different columns of the dataset and their types
|
| 47 |
features=datasets.Features(
|
|
|
|
| 76 |
# files = _URLS[self.config.name]
|
| 77 |
downloaded_files = dl_manager.download(self.config.data_url)
|
| 78 |
return [
|
| 79 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={'filepath': downloaded_files["train"]}),
|
| 80 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={'filepath': downloaded_files["test"]}),
|
| 81 |
]
|
| 82 |
|
| 83 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
data/{crimes_2020.parquet → 2020/chicago_crimes_2020.parquet}
RENAMED
|
File without changes
|
data/2020/chicago_crimes_2020_test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7c7c2e242a5083ec64834a8bf2dc7bcde475194e7e6a737fe0cae67dd2e89d8
|
| 3 |
+
size 2943177
|
data/2020/chicago_crimes_2020_train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99d16807122dd22cee87f32f23a8fc9cea09937e783c03b448d3fbfe7ec61e64
|
| 3 |
+
size 10220376
|
data/{crimes_2021.parquet → 2021/chicago_crimes_2021.parquet}
RENAMED
|
File without changes
|
data/2021/chicago_crimes_2021_test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:16c3f2187c8e218259bcf33da97ddc0412fd7d153542c77456580f35bdcb3c1e
|
| 3 |
+
size 2860854
|
data/2021/chicago_crimes_2021_train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a076db40132409c53d178fa8eb7faf518c496742f56c378a1bd38d84d42dbe2a
|
| 3 |
+
size 9970206
|
data/{crimes_2022.parquet → 2022/chicago_crimes_2022.parquet}
RENAMED
|
File without changes
|
data/2022/chicago_crimes_2022_test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f30adac4b394523986fd6089f648825d028ecbfdd7b4474fb3465980bd84a30
|
| 3 |
+
size 3216155
|
data/2022/chicago_crimes_2022_train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a51d3a8bd025ecd4606403dcae2602b4da333da45605aeaa4f65907be168ce5a
|
| 3 |
+
size 11041501
|