File size: 4,251 Bytes
24199a4
 
bbb071d
 
 
 
 
 
 
 
 
 
 
 
 
fc9e422
bbb071d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fc9e422
 
 
 
bbb071d
 
fc9e422
bbb071d
 
fc9e422
bbb071d
 
fc9e422
bbb071d
fc9e422
 
bbb071d
24199a4
 
 
 
 
 
 
 
 
 
 
 
85a552e
24199a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85a552e
 
 
 
24199a4
 
85a552e
24199a4
 
85a552e
24199a4
 
85a552e
24199a4
85a552e
 
24199a4
bbb071d
 
 
 
 
 
 
 
24199a4
 
 
 
 
 
 
 
 
abc970b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
---
dataset_info:
- config_name: Z_1-90
  features:
  - name: material_id
    dtype: string
  - name: formation_energy_per_atom
    dtype: float64
  - name: dft_band_gap
    dtype: float64
  - name: pretty_formula
    dtype: string
  - name: e_above_hull
    dtype: float64
  - name: elements
    sequence: string
  - name: spacegroup_number
    dtype: float64
  - name: azure_bulk_modulus
    dtype: float64
  - name: larsen_score_2d
    dtype: float64
  - name: Si_100_mismatch
    dtype: float64
  - name: azure_band_gap
    dtype: float64
  - name: dft_bulk_modulus
    dtype: float64
  - name: dft_poisson_ratio
    dtype: float64
  - name: dft_mag_density
    dtype: float64
  - name: structure
    dtype: string
  - name: unique_elements
    sequence: string
  - name: num_sites
    dtype: int64
  splits:
  - name: train
    num_bytes: 69299317
    num_examples: 25923
  - name: valid
    num_bytes: 22967236
    num_examples: 8650
  - name: test
    num_bytes: 22926999
    num_examples: 8647
  download_size: 42557908
  dataset_size: 115193552
- config_name: default
  features:
  - name: material_id
    dtype: string
  - name: formation_energy_per_atom
    dtype: float64
  - name: dft_band_gap
    dtype: float64
  - name: pretty_formula
    dtype: string
  - name: e_above_hull
    dtype: float64
  - name: elements
    sequence: string
  - name: spacegroup_number
    dtype: float64
  - name: azure_bulk_modulus
    dtype: float64
  - name: larsen_score_2d
    dtype: float64
  - name: Si_100_mismatch
    dtype: float64
  - name: azure_band_gap
    dtype: float64
  - name: dft_bulk_modulus
    dtype: float64
  - name: dft_poisson_ratio
    dtype: float64
  - name: dft_mag_density
    dtype: float64
  - name: structure
    dtype: string
  - name: unique_elements
    sequence: string
  - name: num_sites
    dtype: int64
  splits:
  - name: train
    num_bytes: 72244062
    num_examples: 27136
  - name: valid
    num_bytes: 23916305
    num_examples: 9047
  - name: test
    num_bytes: 23864869
    num_examples: 9046
  download_size: 44322023
  dataset_size: 120025236
configs:
- config_name: Z_1-90
  data_files:
  - split: train
    path: Z_1-90/train-*
  - split: valid
    path: Z_1-90/valid-*
  - split: test
    path: Z_1-90/test-*
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: valid
    path: data/valid-*
  - split: test
    path: data/test-*
---

The dataset is created with this pipeline:
```bash
git clone https://github.com/microsoft/mattergen.git
cd mattergen
git lfs pull -I data-release/mp-20/ --exclude=""
unzip data-release/mp-20/mp_20.zip -d datasets
```

```python
import pandas as pd
from tqdm.auto import tqdm
from pymatgen.io.cif import CifParser
from datasets import DatasetDict, Dataset

train_path = "./datasets/mp_20/train.csv"
valid_path = "./datasets/mp_20/val.csv"
test_path = "./datasets/mp_20/test.csv"

train_df = pd.read_csv(train_path)
train_structures = [
    CifParser.from_str(s).parse_structures(primitive=True, on_error="ignore")[0]
    for s in tqdm(train_df["cif"], desc="Parsing CIFs", miniters=20)
]
train_df = train_df.drop(columns=['Unnamed: 0', 'cif'])
train_df["structure"] = [s.to_json() for s in tqdm(train_structures, miniters=20)]

valid_df = pd.read_csv(valid_path)
valid_structures = [
    CifParser.from_str(s).parse_structures(primitive=True, on_error="ignore")[0]
    for s in tqdm(valid_df["cif"], desc="Parsing CIFs", miniters=20)
]
valid_df = valid_df.drop(columns=['Unnamed: 0', 'cif'])
valid_df["structure"] = [s.to_json() for s in tqdm(valid_structures, miniters=20)]

test_df = pd.read_csv(test_path)
test_structures = [
    CifParser.from_str(s).parse_structures(primitive=True, on_error="ignore")[0]
    for s in tqdm(test_df["cif"], desc="Parsing CIFs", miniters=20)
]
test_df = test_df.drop(columns=['Unnamed: 0', 'cif'])
test_df["structure"] = [s.to_json() for s in tqdm(test_structures, miniters=20)]



train_dataset = Dataset.from_pandas(train_df)
valid_dataset = Dataset.from_pandas(valid_df)
test_dataset = Dataset.from_pandas(test_df)

dataset_dict = DatasetDict({
    'train': train_dataset,
    'valid': valid_dataset,
    'test': test_dataset
})
dataset_dict.push_to_hub('xpanceo-team/mp-20', private=True)
```