Skip to content

Instantly share code, notes, and snippets.

View mbaudin47's full-sized avatar
😀

Michael Baudin mbaudin47

😀
  • EDF
  • Nowhere land
View GitHub Profile
@mbaudin47
mbaudin47 / ishigami_decomposition_exact.py
Created October 20, 2023 21:24
Compute exact coefficients of the standard Legendre expansion of the Ishigami function
"""
Le but de ce script est d'obtenir la décomposition en polynômes du chaos
exacte de la fonction Ishigami.
"""
# %%
import sympy as sp
import openturns as ot
from joblib import Parallel, delayed
import time
@mbaudin47
mbaudin47 / ishigami_read_PCE_from_data_file.py
Created October 15, 2023 17:25
Read a PCE from a table of pre-computed coefficients.
"""
Read a PCE from a table of pre-computed coefficients.
Michaël Baudin, 2023
Reference
---------
https://github.com/openturns/openturns/issues/2334
"""
# %%
import openturns as ot
@mbaudin47
mbaudin47 / gist:26eadbd1a503c51326ac36abc89eeb59
Last active October 6, 2023 19:20
Experiment selection history
"""
Experiment the selection history feature available at :
https://github.com/openturns/openturns/pull/2284
Michaël Baudin, 2023
"""
# %%
from openturns.usecases import ishigami_function
from openturns.usecases import flood_model
from openturns.usecases import fireSatellite_function
import openturns as ot
@mbaudin47
mbaudin47 / gist:dfe71c411bf551c47fa0bb4188b7c5ef
Created October 4, 2023 14:32
Create a FunctionalChaosResult with extra-features.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Create a FunctionalChaosResult with extra-features.
Compute Sobol' first order (closed) and total indices of a group of variables.
Michaël Baudin, 2023
"""
import openturns as ot
@mbaudin47
mbaudin47 / gist:9b07ecc8e957c21b1815a726300e3987
Created August 31, 2023 13:05
Different versions of the flooding model.
"""
Michaël Baudin (2023)
Compare different versions of the flooding model.
Reference
---------
http://openturns.github.io/openturns/1.19/usecases/use_case_flood_model.html
"""
# %%
import openturns as ot
import openturns.viewer as otv
@mbaudin47
mbaudin47 / burman_openturns.py
Last active August 2, 2023 10:18
Reproduces (Burman, 1989) with OpenTURNS (1.20).
"""
Reproduces (Burman, 1989) with OpenTURNS (1.20).
P. Burman. Comparative study of Ordinary Cross-Validation,
v-Fold Cross-Validation and the repeated Learning-Testing Methods.
Biometrika, 76(3):503–514, 1989.
"""
# %%
@mbaudin47
mbaudin47 / crossValidationDistribution.py
Last active July 24, 2023 20:35
See the distribution of the leave-one-out and K-Fold MSE estimators
"""
Compute the distribution of the cross-validation estimators of the mean squared
error (MSE) of a surrogate model.
Use leave-one-one, K-Fold estimators and Monte-Carlo MSE estimators.
References
----------
https://github.com/openturns/openturns/pull/2330
"""
@mbaudin47
mbaudin47 / benchmarkFunctionalChaosValidation.py
Last active July 9, 2023 21:02
Benchmark naive and analytical Leave-one-out and KFold cross validation on a FunctionalChaosResult
"""
Michaël Baudin, Juin-Juillet 2023.
## Introduction
Benchmark the PR https://github.com/openturns/openturns/pull/2330
https://gist.github.com/mbaudin47/794a36842e3f838014bc7069904412ef
This script considers the cross-validation of a polynomial chaos expansion.
@mbaudin47
mbaudin47 / testDataBaseFunction.py
Last active July 8, 2023 16:17
Experiment with DatabaseFunction
"""
Source :
https://matplotlib.org/stable/plot_types/unstructured/tricontourf.html#sphx-glr-plot-types-unstructured-tricontourf-py
https://openturns.discourse.group/t/contour-plots-using-matplotlib/272/2
"""
import openturns as ot
import openturns.viewer as otv
import matplotlib.pyplot as plt
import matplotlib as mpl
import pylab as pl