Skip to content

Structured Data for Machine Learning Model

Below, the user can find an example JSON structured representation for the Machine Learning Model.

  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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
{
    "description": "machine learning model type/subtype schema", 
    "allOf": [
        {
            "schemaId": "model", 
            "required": [
                "type", 
                "subtype", 
                "method"
            ], 
            "properties": {
                "subtype": {
                    "type": "string", 
                    "description": "general subtype of the model, eg. `lda`"
                }, 
                "type": {
                    "type": "string", 
                    "description": "general type of the model, eg. `dft`"
                }, 
                "method": {
                    "schemaId": "method", 
                    "required": [
                        "type", 
                        "subtype"
                    ], 
                    "properties": {
                        "subtype": {
                            "type": "string", 
                            "description": "general subtype of this method, eg. `ultra-soft`"
                        }, 
                        "type": {
                            "type": "string", 
                            "description": "general type of this method, eg. `pseudopotential`"
                        }, 
                        "precision": {
                            "type": "object", 
                            "description": "Object showing the actual possible precision based on theory and implementation"
                        }, 
                        "data": {
                            "type": "object", 
                            "description": "additional data specific to method, eg. array of pseudopotentials"
                        }
                    }, 
                    "title": "method schema (base)"
                }
            }, 
            "title": "model schema (base)"
        }
    ], 
    "schemaId": "models-directory-ml", 
    "title": "machine learning model schema", 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "properties": {
        "subtype": {
            "enum": [
                "re"
            ]
        }, 
        "type": {
            "enum": [
                "ml"
            ]
        }, 
        "method": {
            "oneOf": [
                {
                    "required": [
                        "precision", 
                        "data"
                    ], 
                    "schemaId": "methods-directory-regression", 
                    "allOf": [
                        {
                            "schemaId": "method", 
                            "required": [
                                "type", 
                                "subtype"
                            ], 
                            "properties": {
                                "subtype": {
                                    "type": "string", 
                                    "description": "general subtype of this method, eg. `ultra-soft`"
                                }, 
                                "type": {
                                    "type": "string", 
                                    "description": "general type of this method, eg. `pseudopotential`"
                                }, 
                                "precision": {
                                    "type": "object", 
                                    "description": "Object showing the actual possible precision based on theory and implementation"
                                }, 
                                "data": {
                                    "type": "object", 
                                    "description": "additional data specific to method, eg. array of pseudopotentials"
                                }
                            }, 
                            "title": "method schema (base)"
                        }
                    ], 
                    "properties": {
                        "subtype": {
                            "enum": [
                                "least_squares", 
                                "ridge"
                            ]
                        }, 
                        "type": {
                            "enum": [
                                "linear"
                            ]
                        }, 
                        "precision": {
                            "perProperty": {
                                "items": {
                                    "type": "object", 
                                    "properties": {
                                        "name": {
                                            "type": "string", 
                                            "description": "property name in 'flattened' format"
                                        }
                                    }, 
                                    "allOf": [
                                        {
                                            "schemaId": "methods-directory-regression-precision", 
                                            "oneOf": [
                                                {
                                                    "schemaId": "methods-directory-regression-linear-precision-per-property", 
                                                    "required": [
                                                        "trainingError"
                                                    ], 
                                                    "properties": {
                                                        "score": {
                                                            "type": "number", 
                                                            "description": "prediction score of the estimator. Eg: r2_score"
                                                        }, 
                                                        "trainingError": {
                                                            "type": "number", 
                                                            "description": "training error of the estimator"
                                                        }
                                                    }, 
                                                    "title": "precision schema for regression"
                                                }
                                            ], 
                                            "title": "regression precision"
                                        }
                                    ]
                                }
                            }
                        }, 
                        "data": {
                            "perProperty": {
                                "items": {
                                    "type": "object", 
                                    "properties": {
                                        "name": {
                                            "type": "string", 
                                            "description": "property name in 'flattened' format"
                                        }
                                    }, 
                                    "allOf": [
                                        {
                                            "schemaId": "methods-directory-regression-data", 
                                            "oneOf": [
                                                {
                                                    "schemaId": "methods-directory-regression-linear-data-per-property", 
                                                    "required": [
                                                        "intercept", 
                                                        "perFeature"
                                                    ], 
                                                    "properties": {
                                                        "perFeature": {
                                                            "items": {
                                                                "required": [
                                                                    "name", 
                                                                    "coefficient"
                                                                ], 
                                                                "type": "object", 
                                                                "properties": {
                                                                    "coefficient": {
                                                                        "type": "number", 
                                                                        "description": "coefficient in linear regression"
                                                                    }, 
                                                                    "importance": {
                                                                        "type": "number", 
                                                                        "description": "pvalue: https://en.wikipedia.org/wiki/P-value"
                                                                    }, 
                                                                    "name": {
                                                                        "type": "string", 
                                                                        "description": "feature name in 'flattened' format"
                                                                    }
                                                                }
                                                            }, 
                                                            "type": "array", 
                                                            "description": "per-feature (property used for training the ML method/model) paramters"
                                                        }, 
                                                        "intercept": {
                                                            "type": "number", 
                                                            "description": "intercept (shift) from the linear or non-linear fit of data points"
                                                        }
                                                    }, 
                                                    "title": "linear regression parameters schema"
                                                }
                                            ], 
                                            "title": "regression data"
                                        }
                                    ]
                                }
                            }, 
                            "dataSet": {
                                "schemaId": "methods-directory-regression-dataset", 
                                "required": [
                                    "exabyteIds"
                                ], 
                                "type": "object", 
                                "description": "dataset for ml", 
                                "properties": {
                                    "exabyteIds": {
                                        "items": {
                                            "type": "string"
                                        }, 
                                        "type": "array", 
                                        "description": "array of exabyteIds for materials in dataset"
                                    }, 
                                    "extra": {
                                        "description": "holder for any extra information, eg. coming from user-uploaded CSV file"
                                    }
                                }
                            }
                        }
                    }, 
                    "title": "linear methods schema"
                }
            ]
        }
    }
}
 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
{
    "subtype": "re", 
    "type": "ml", 
    "method": {
        "subtype": "least_squares", 
        "data": {
            "perProperty": [
                {
                    "perFeature": [
                        {
                            "coefficient": 0.015, 
                            "importance": 0.134, 
                            "name": "atomic_radius:Ge"
                        }, 
                        {
                            "coefficient": 0.016, 
                            "importance": 0.135, 
                            "name": "atomic_radius:Si"
                        }
                    ], 
                    "intercept": 0.363, 
                    "name": "band_gaps:direct"
                }, 
                {
                    "perFeature": [
                        {
                            "coefficient": 0.016, 
                            "importance": 0.135, 
                            "name": "atomic_radius:Ge"
                        }, 
                        {
                            "coefficient": 0.017, 
                            "importance": 0.136, 
                            "name": "atomic_radius:Si"
                        }
                    ], 
                    "intercept": 0.364, 
                    "name": "band_gaps:indirect"
                }
            ], 
            "dataSet": {
                "exabyteIds": [
                    "LCthJ6E2QabYCZqf4", 
                    "LCthJ6E2QabYCZqf5", 
                    "LCthJ6E2QabYCZqf6", 
                    "LCthJ6E2QabYCZqf7", 
                    "LCthJ6E2QabYCZqf8", 
                    "LCthJ6E2QabYCZqf9", 
                    "LCthJ6E2QabYCZq10", 
                    "LCthJ6E2QabYCZq11"
                ], 
                "extra": {}
            }
        }, 
        "precision": {
            "perProperty": {
                "score": 0.8, 
                "name": "band_gaps:direct", 
                "trainingError": 0.002
            }
        }, 
        "type": "linear"
    }
}