We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The matrix returned by DesignProxy.computeDesign() fails to be used as an input argument to QRMethod.
DesignProxy.computeDesign()
QRMethod
The script (see below for the full script):
designMatrix = design_proxy.computeDesign(functionIndices) leastSquaresMethod = ot.QRMethod(designMatrix) # Fails!
produces:
TypeError: Wrong number or type of arguments for overloaded function 'new_QRMethod'.
The workaround is to convert the matrix into a Matrix:
Matrix
leastSquaresMethod = ot.QRMethod(ot.Matrix(designMatrix)) # Workaround
# %% import openturns as ot from openturns.usecases import ishigami_function import numpy as np # %% print(ot.__version__) # %% im = ishigami_function.IshigamiModel() sampleSize = 20 inputSample = im.distributionX.getSample(sampleSize) multivariateBasis = ot.OrthogonalProductPolynomialFactory([im.X1, im.X2, im.X3]) selectionAlgorithm = ot.PenalizedLeastSquaresAlgorithmFactory() # Not sparse projectionStrategy = ot.LeastSquaresStrategy(selectionAlgorithm) basisSize = 10 # Caution: set basis size <= sample size adaptiveStrategy = ot.FixedStrategy(multivariateBasis, basisSize) functionIndices = ot.Indices(basisSize) functionIndices.fill() functionCollection = [multivariateBasis.build(i) for i in functionIndices] transformation = ot.DistributionTransformation( im.distributionX, multivariateBasis.getMeasure() ) z_train = transformation(inputSample) basis = ot.Basis(functionCollection) design_proxy = ot.DesignProxy(z_train, basis) designMatrix = design_proxy.computeDesign(functionIndices) # %% leastSquaresMethod = ot.QRMethod(designMatrix) # Fails! # %% leastSquaresMethod = ot.QRMethod(ot.Matrix(designMatrix)) # Workaround
1.21
Linux
conda
No response
The text was updated successfully, but these errors were encountered:
with OT 1.22 I can not reproduce
OT 1.22
Sorry, something went wrong.
No branches or pull requests
What happened?
The matrix returned by
DesignProxy.computeDesign()
fails to be used as an input argument toQRMethod
.The script (see below for the full script):
produces:
The workaround is to convert the matrix into a
Matrix
:How to reproduce the issue?
Version
1.21
Operating System
Linux
Installation media
conda
Additional Context
No response
The text was updated successfully, but these errors were encountered: