From 0e7bf665f157b8d04222c15be591aa1e930d61f5 Mon Sep 17 00:00:00 2001 From: MRIDUL JAIN <105979087+Spinachboul@users.noreply.github.com> Date: Sun, 14 Jan 2024 07:13:11 +0530 Subject: [PATCH] Update tensor_prod.md --- docs/src/tensor_prod.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/tensor_prod.md b/docs/src/tensor_prod.md index 015aef85..27b395a2 100644 --- a/docs/src/tensor_prod.md +++ b/docs/src/tensor_prod.md @@ -9,7 +9,7 @@ a: A constant parameter # Generating Data and Plotting -``` +```@example function tensor_product_function(x, a) return prod(cos.(a * π * xi) for xi in x) end @@ -46,7 +46,7 @@ plot_data_and_true_function(x_train, y_train, x_test, y_test, a, lb, ub) # Training various Surrogates Now let's train various surrogate models and evaluate their performance on the test data -``` +```@example # Train different surrogate models function train_surrogates(x_train, y_train, lb, ub, alpha=2.0, n=6) loba = LobachevskySurrogate(x_train, y_train, lb, ub, alpha=alpha, n=n) @@ -82,7 +82,7 @@ plot_surrogate_predictions(loba_pred, krig_pred, x_test, y_test, 2.0, lb, ub) # Reporting the best Surrogate Model To determine the best surrogate, you can compare their accuracy and performance metrics on the test data. For instance, you can calculate and compare the mean squared error (MSE) or any other relevant metric -``` +```@example using Statistics # Evaluate performance metrics