| 3032 | throw new python.Error(`Model file does not specify ${key}.`); |
| 3033 | }; |
| 3034 | const list = (key, size) => { |
| 3035 | if (key_vals.has(key)) { |
| 3036 | const value = key_vals.get(key).split(' '); |
| 3037 | if (value.length !== size) { |
| 3038 | throw new python.Error(`Wrong size of ${key}.`); |
| 3039 | } |
| 3040 | return value; |
| 3041 | } |
| 3042 | throw new python.Error(`Model file does not contain ${key}.`); |
| 3043 | }; |
| 3044 | this.version = key_vals.get('version') || ''; |
| 3045 | this.num_class = atoi('num_class'); |
| 3046 | this.num_tree_per_iteration = atoi('num_tree_per_iteration', this.num_class); |