|
4714 | 4714 | }, |
4715 | 4715 | { |
4716 | 4716 | "cell_type": "code", |
4717 | | - "execution_count": 1, |
| 4717 | + "execution_count": null, |
4718 | 4718 | "metadata": {}, |
4719 | | - "outputs": [ |
4720 | | - { |
4721 | | - "name": "stderr", |
4722 | | - "output_type": "stream", |
4723 | | - "text": [ |
4724 | | - "Seed set to 123\n", |
4725 | | - "Seed set to 123\n" |
4726 | | - ] |
4727 | | - }, |
4728 | | - { |
4729 | | - "name": "stdout", |
4730 | | - "output_type": "stream", |
4731 | | - "text": [ |
4732 | | - "Experiment saved to TEST_SAVE_exp.pkl\n", |
4733 | | - "Anisotropic model: n_theta set to 15\n", |
4734 | | - "Anisotropic model: n_theta set to 15\n", |
4735 | | - "spotpython tuning: 311.9606862434023 [#---------] 13.84% \n", |
4736 | | - "Anisotropic model: n_theta set to 15\n", |
4737 | | - "spotpython tuning: 311.9606862434023 [##########] 100.00% Done...\n", |
4738 | | - "\n", |
4739 | | - "Experiment saved to TEST_SAVE_res.pkl\n" |
4740 | | - ] |
4741 | | - } |
4742 | | - ], |
| 4719 | + "outputs": [], |
4743 | 4720 | "source": [ |
4744 | 4721 | "import os\n", |
4745 | 4722 | "import numpy as np\n", |
|
4851 | 4828 | }, |
4852 | 4829 | { |
4853 | 4830 | "cell_type": "code", |
4854 | | - "execution_count": 2, |
| 4831 | + "execution_count": null, |
4855 | 4832 | "metadata": {}, |
4856 | | - "outputs": [ |
4857 | | - { |
4858 | | - "name": "stdout", |
4859 | | - "output_type": "stream", |
4860 | | - "text": [ |
4861 | | - "Loaded experiment from TEST_SAVE_exp.pkl\n", |
4862 | | - "Anisotropic model: n_theta set to 15\n", |
4863 | | - "Anisotropic model: n_theta set to 15\n", |
4864 | | - "spotpython tuning: 311.9608671871864 [#---------] 14.28% \n", |
4865 | | - "Anisotropic model: n_theta set to 15\n", |
4866 | | - "spotpython tuning: 311.9608671871864 [##########] 100.00% Done...\n", |
4867 | | - "\n", |
4868 | | - "Experiment saved to TEST_SAVE_res.pkl\n" |
4869 | | - ] |
4870 | | - } |
4871 | | - ], |
| 4833 | + "outputs": [], |
4872 | 4834 | "source": [ |
4873 | 4835 | "from spotpython.utils.file import load_and_run_spot_python_experiment\n", |
4874 | 4836 | "# spot_load_res = load_and_run_spot_python_experiment(filename=\"TEST_SAVE_res.pkl\")\n", |
@@ -14177,12 +14139,46 @@ |
14177 | 14139 | "S_3.get_spot_attributes_as_df()" |
14178 | 14140 | ] |
14179 | 14141 | }, |
| 14142 | + { |
| 14143 | + "cell_type": "markdown", |
| 14144 | + "metadata": {}, |
| 14145 | + "source": [ |
| 14146 | + "# Test new prediction " |
| 14147 | + ] |
| 14148 | + }, |
14180 | 14149 | { |
14181 | 14150 | "cell_type": "code", |
14182 | | - "execution_count": null, |
| 14151 | + "execution_count": 1, |
14183 | 14152 | "metadata": {}, |
14184 | | - "outputs": [], |
14185 | | - "source": [] |
| 14153 | + "outputs": [ |
| 14154 | + { |
| 14155 | + "name": "stdout", |
| 14156 | + "output_type": "stream", |
| 14157 | + "text": [ |
| 14158 | + "Standard Kriging. Dimensions: 2\n", |
| 14159 | + "Anisotropic model: n_theta set to 2\n", |
| 14160 | + "bounds for differential_evolution: [(-3.0, 2.0), (-3.0, 2.0), (-9.0, 0.0)]\n", |
| 14161 | + "Prediction at [0.25 0.25]: f=0.14995512874385375, s=8.354296177760167e-05, SigmaSqr=1.3948369741908675, SSqr=6.979426462573815e-09\n", |
| 14162 | + "Prediction at [0.75 0.75]: f=0.2500448712561424, s=8.354296270441831e-05, SigmaSqr=1.3948369741908675, SSqr=6.9794266174318275e-09\n", |
| 14163 | + "Predictions: [[1.49955129e-01 8.35429618e-05]\n", |
| 14164 | + " [2.50044871e-01 8.35429627e-05]]\n" |
| 14165 | + ] |
| 14166 | + } |
| 14167 | + ], |
| 14168 | + "source": [ |
| 14169 | + "import numpy as np\n", |
| 14170 | + "from spotpython.surrogate.kriging import Kriging\n", |
| 14171 | + "# Training data\n", |
| 14172 | + "X_train = np.array([[0.0, 0.0], [0.5, 0.5], [1.0, 1.0]])\n", |
| 14173 | + "y_train = np.array([0.1, 0.2, 0.3])\n", |
| 14174 | + "# Fit the Kriging model\n", |
| 14175 | + "model = Kriging().fit(X_train, y_train)\n", |
| 14176 | + "# Test data\n", |
| 14177 | + "X_test = np.array([[0.25, 0.25], [0.75, 0.75]])\n", |
| 14178 | + "# Predict responses\n", |
| 14179 | + "y_pred = model.predict(X_test)\n", |
| 14180 | + "print(\"Predictions:\", y_pred)" |
| 14181 | + ] |
14186 | 14182 | }, |
14187 | 14183 | { |
14188 | 14184 | "cell_type": "code", |
|
0 commit comments