Skip to content

Commit e689efa

Browse files
0.33.0
Kriging updated
1 parent e6bd049 commit e689efa

6 files changed

Lines changed: 305 additions & 838 deletions

File tree

notebooks/00_spotPython_tests.ipynb

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4714,32 +4714,9 @@
47144714
},
47154715
{
47164716
"cell_type": "code",
4717-
"execution_count": 1,
4717+
"execution_count": null,
47184718
"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": [],
47434720
"source": [
47444721
"import os\n",
47454722
"import numpy as np\n",
@@ -4851,24 +4828,9 @@
48514828
},
48524829
{
48534830
"cell_type": "code",
4854-
"execution_count": 2,
4831+
"execution_count": null,
48554832
"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": [],
48724834
"source": [
48734835
"from spotpython.utils.file import load_and_run_spot_python_experiment\n",
48744836
"# spot_load_res = load_and_run_spot_python_experiment(filename=\"TEST_SAVE_res.pkl\")\n",
@@ -14177,12 +14139,46 @@
1417714139
"S_3.get_spot_attributes_as_df()"
1417814140
]
1417914141
},
14142+
{
14143+
"cell_type": "markdown",
14144+
"metadata": {},
14145+
"source": [
14146+
"# Test new prediction "
14147+
]
14148+
},
1418014149
{
1418114150
"cell_type": "code",
14182-
"execution_count": null,
14151+
"execution_count": 1,
1418314152
"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+
]
1418614182
},
1418714183
{
1418814184
"cell_type": "code",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.32.3"
10+
version = "0.33.0"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

0 commit comments

Comments
 (0)