From 54eda12fb7996264dd63fe309446de7a18dedaff Mon Sep 17 00:00:00 2001 From: Michael BAUDIN Date: Wed, 23 Aug 2023 00:26:06 +0200 Subject: [PATCH] Added getDesign() --- .../MetaModel/LinearModel/LinearModelResult.cxx | 5 +++++ .../LinearModel/openturns/LinearModelResult.hxx | 1 + python/src/LinearModelResult_doc.i.in | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelResult.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelResult.cxx index 5d6548e0858..262ce199be9 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelResult.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelResult.cxx @@ -130,6 +130,11 @@ Basis LinearModelResult::getBasis() const return basis_; } +Matrix LinearModelResult::getDesign() const +{ + return design_; +} + /* Fitted sample accessor */ Sample LinearModelResult::getFittedSample() const { diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/openturns/LinearModelResult.hxx b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/openturns/LinearModelResult.hxx index ef71215bea7..e3c6f57e348 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/openturns/LinearModelResult.hxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/openturns/LinearModelResult.hxx @@ -71,6 +71,7 @@ public: /** Sample accessors */ virtual Basis getBasis() const; virtual Sample getFittedSample() const; + virtual Matrix getDesign() const; /** Condensed formula accessor */ virtual Point getCoefficients() const; diff --git a/python/src/LinearModelResult_doc.i.in b/python/src/LinearModelResult_doc.i.in index d1c42dd2400..1bfb4824aad 100644 --- a/python/src/LinearModelResult_doc.i.in +++ b/python/src/LinearModelResult_doc.i.in @@ -13,8 +13,8 @@ outputSample : 2-d sequence of float The output sample of a model. metaModel : :class:`~openturns.Function` The meta model. -trendCoefficients : sequence of float - The trend coeffients associated to the linearmodel. +coefficients : sequence of float + The trend coefficients associated to the linear model. formula : str The formula description. coefficientsNames : sequence of str @@ -46,7 +46,15 @@ LinearModelAlgorithm Returns ------- basis : :class:`~openturns.Basis` - The basis which had been passed to the constructor." + The basis." + +%feature("docstring") OT::LinearModelResult::getDesign +"Accessor to the design matrix. + +Returns +------- +design: :class:`~openturns.Matrix` + The design matrix." // --------------------------------------------------------------------- @@ -65,7 +73,7 @@ outputSample : :class:`~openturns.Sample` Returns ------- -beta : :class:`~openturns.Point` +coefficients : :class:`~openturns.Point` " // ---------------------------------------------------------------------