|
118 | 118 | }, |
119 | 119 | { |
120 | 120 | "cell_type": "code", |
121 | | - "execution_count": 6, |
| 121 | + "execution_count": 4, |
122 | 122 | "id": "9c1800f4-464c-4f17-937c-9347762a7ffb", |
123 | 123 | "metadata": {}, |
124 | 124 | "outputs": [], |
|
129 | 129 | "with open(\"Jorg21_Cpx_only_Press.onnx\", \"wb\") as f:\n", |
130 | 130 | " f.write(model_onnx_P.SerializeToString())" |
131 | 131 | ] |
132 | | - }, |
133 | | - { |
134 | | - "cell_type": "code", |
135 | | - "execution_count": 1, |
136 | | - "id": "d6ae8543-ce65-4455-9cba-3b8dc72feb0c", |
137 | | - "metadata": {}, |
138 | | - "outputs": [ |
139 | | - { |
140 | | - "ename": "NameError", |
141 | | - "evalue": "name 'ExtraTreesRegressor' is not defined", |
142 | | - "output_type": "error", |
143 | | - "traceback": [ |
144 | | - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", |
145 | | - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", |
146 | | - "Cell \u001b[1;32mIn[1], line 8\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Scaling\u001b[39;00m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;66;03m#scaler = StandardScaler().fit(x_train)\u001b[39;00m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m#x_train_scaled = scaler.transform(x_train)\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[38;5;66;03m# Using the parameters from Petrelli supplement for P. Don't actually present a regression for T, \u001b[39;00m\n\u001b[0;32m 7\u001b[0m \u001b[38;5;66;03m# but we add it here.\u001b[39;00m\n\u001b[1;32m----> 8\u001b[0m regr_T \u001b[38;5;241m=\u001b[39m ExtraTreesRegressor(n_estimators\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m201\u001b[39m, criterion\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msquared_error\u001b[39m\u001b[38;5;124m'\u001b[39m, max_features\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m6\u001b[39m, \n\u001b[0;32m 9\u001b[0m \n\u001b[0;32m 10\u001b[0m random_state\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m120\u001b[39m) \u001b[38;5;66;03m# random_state fixed for reproducibility\u001b[39;00m\n\u001b[0;32m 12\u001b[0m \u001b[38;5;66;03m# Define the regressor, in our case the Extra Tree Regressor\u001b[39;00m\n\u001b[0;32m 13\u001b[0m regr_P \u001b[38;5;241m=\u001b[39m ExtraTreesRegressor(n_estimators\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m201\u001b[39m, criterion\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msquared_error\u001b[39m\u001b[38;5;124m'\u001b[39m, max_features\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m6\u001b[39m, \n\u001b[0;32m 14\u001b[0m \n\u001b[0;32m 15\u001b[0m random_state\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m120\u001b[39m) \u001b[38;5;66;03m# random_state fixed for reproducibility\u001b[39;00m\n", |
147 | | - "\u001b[1;31mNameError\u001b[0m: name 'ExtraTreesRegressor' is not defined" |
148 | | - ] |
149 | | - } |
150 | | - ], |
151 | | - "source": [ |
152 | | - "# Scaling\n", |
153 | | - "#scaler = StandardScaler().fit(x_train)\n", |
154 | | - "#x_train_scaled = scaler.transform(x_train)\n", |
155 | | - "\n", |
156 | | - "# Define the regressor, in our case the Extra Tree Regressor\n", |
157 | | - "# Using the parameters from Petrelli supplement for P. Don't actually present a regression for T, \n", |
158 | | - "# but we add it here.\n", |
159 | | - "regr_T = ExtraTreesRegressor(n_estimators=201, criterion='squared_error', max_features=6, \n", |
160 | | - " \n", |
161 | | - " random_state=120) # random_state fixed for reproducibility\n", |
162 | | - "\n", |
163 | | - "# Define the regressor, in our case the Extra Tree Regressor\n", |
164 | | - "regr_P = ExtraTreesRegressor(n_estimators=201, criterion='squared_error', max_features=6, \n", |
165 | | - " \n", |
166 | | - " random_state=120) # random_state fixed for reproducibility\n", |
167 | | - "\n", |
168 | | - "# Train the model\n", |
169 | | - "regr_T.fit(x_train, y_train_T.ravel())\n", |
170 | | - "regr_P.fit(x_train, y_train_P.ravel())\n", |
171 | | - "\n", |
172 | | - "\n", |
173 | | - "#x_test_scaled=scaler.transform(x_test)" |
174 | | - ] |
175 | 132 | } |
176 | 133 | ], |
177 | 134 | "metadata": { |
|
0 commit comments