Observations¶
- class persalys.Observations(*args)¶
Create observations for variables of a model.
- Available constructors:
Observations(name, physicalModel)
Observations(name, physicalModel, inputSample, outputSample)
Observations(name, physicalModel, fileName, inputColumns, outputColumns, inputNames, outputNames)
- Parameters:
- namestr
Name
- physicalModel
PhysicalModel Physical model
- fileNamestr
Name of a data file (.txt ot .csv) to load
- inputColumnssequence of int
Indices of columns of the input variables in file to consider
- outputColumnssequence of int
Indices of columns of the output variables in file to consider
- inputNamessequence of str
Names of the input variables
- outputNamessequence of str
Names of the output variables
- inputSample
openturns.Sample Input sample (its description must be a list of input variable names)
- outputSample
openturns.Sample Output sample (its description must be a list of output variable names)
Methods
Accessor to the object's name.
Effective indices accessor.
File name of the imported dataset accessor.
Indices of the input variables accessor.
Names of the input variables accessor.
Input sample accessor.
List of input values.
List of input values.
getMarginalWithoutNaN(index)Returns a marginal sample with NaN values removed.
getName()Accessor to the object's name.
Names of the output variables accessor.
Output sample accessor.
Physical model accessor.
Python script accessor.
Sample accessor.
Returns the sample contained inside the imported dataset.
getType()Type getter.
hasName()Test if the object is named.
Whether it contains a physical model.
Empty the input and output samples.
isValid()Whether the model is valid.
setColumns(inputColumns, inputNames, ...)Columns and names of variables accessor.
setFileName(fileName)Sets the file name of the imported dataset.
setInputSample(sample)Input sample accessor.
setName(name)Accessor to the object's name.
setOutputSample(sample)Output sample accessor.
setPhysicalModel(physicalModel)Physical model setter.
setType(type)Type setter.
getOutputColumns
removePhysicalModel
setSample
Examples
>>> import openturns as ot >>> import persalys >>> ot.RandomGenerator.SetSeed(0)
Create the model:
>>> X0 = persalys.Input('X0') >>> X1 = persalys.Input('X1') >>> X2 = persalys.Input('X2') >>> X3 = persalys.Input('X3') >>> Y0 = persalys.Output('Y0') >>> Y1 = persalys.Output('Y1') >>> model = persalys.SymbolicPhysicalModel('aModelPhys', [X0, X1, X2, X3], [Y0, Y1], ['sin(X0)+8*X1', 'X2 + X3'])
Create the observations:
>>> filename = 'data.csv' >>> ot.Normal(8).getSample(10).exportToCSVFile(filename) >>> aObs = persalys.Observations('anObs', model, filename, [2, 7], [3], ['X0', 'X2'], ['Y1'])
- __init__(*args)¶
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getEffectiveInputIndices()¶
Effective indices accessor.
Indices of non-const variables in the design.
- Returns:
- indices
openturns.Indices Input sample and output sample
- indices
- getFileName()¶
File name of the imported dataset accessor.
- Returns:
- fileNamestr
File name of the imported dataset
- getInputColumns()¶
Indices of the input variables accessor.
- Returns:
- columns
openturns.Indices Indices of the input variables
- columns
- getInputNames()¶
Names of the input variables accessor.
- Returns:
- names
openturns.Description Names of the input variables
- names
- getInputSample()¶
Input sample accessor.
- Returns:
- sample
openturns.Sample Input sample
- sample
- getListXMax()¶
List of input values.
- Returns:
- listSampleCollection
List of input values
- getListXMin()¶
List of input values.
- Returns:
- listSampleCollection
List of input values
- getMarginalWithoutNaN(index)¶
Returns a marginal sample with NaN values removed.
- Parameters:
- indexint
Index of the wanted marginal
- Returns:
- sample
openturns.Sample A subsample of the present sample with the requested marginal with NaN values removed.
- sample
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getOutputNames()¶
Names of the output variables accessor.
- Returns:
- names
openturns.Description Names of the output variables
- names
- getOutputSample()¶
Output sample accessor.
- Returns:
- sample
openturns.Sample Output sample
- sample
- getPhysicalModel()¶
Physical model accessor.
- Returns:
- model
PhysicalModel Physical model
- model
- getPythonScript()¶
Python script accessor.
- Returns:
- scriptstr
Python script to rebuild the design of experiments
- getSample()¶
Sample accessor.
- Returns:
- sample
openturns.Sample Input sample and output sample
- sample
- getSampleFromFile()¶
Returns the sample contained inside the imported dataset.
- Returns:
- sample
openturns.Sample Sample contained inside the imported dataset
- sample
- getType()¶
Type getter.
- Returns:
- typeint
- possible values are
persalys.DataModel.UK, persalys.DataModel.MC, persalys.DataModel.QMC, persalys.DataModel.RLHS, persalys.DataModel.OLHS, persalys.DataModel.GRID, persalys.DataModel.MORRIS
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- hasPhysicalModel()¶
Whether it contains a physical model.
- Returns:
- hasPhysicalModelbool
Whether it contains a physical model
- initialize()¶
Empty the input and output samples.
- isValid()¶
Whether the model is valid.
- Returns:
- isValidbool
Whether the model is valid
- setColumns(inputColumns, inputNames, outputColumns, outputNames)¶
Columns and names of variables accessor.
- Parameters:
- inputColumnssequence of int
Columns of input variables
- inNamessequence of str
Names of input variables
- outputColumnssequence of int
Columns of output variables
- outNamessequence of str
Names of output variables
- setFileName(fileName)¶
Sets the file name of the imported dataset.
- Parameters:
- fileNamestr
File name of the imported dataset
- setInputSample(sample)¶
Input sample accessor.
- Parameters:
- sample
openturns.Sample Input sample
- sample
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setOutputSample(sample)¶
Output sample accessor.
- Parameters:
- sample
openturns.Sample Output sample
- sample
- setPhysicalModel(physicalModel)¶
Physical model setter.
- Parameters:
- model
PhysicalModel Physical model to set
- model
- setType(type)¶
Type setter.
- Parameters:
- typeint
- possible values are
persalys.DataModel.UK, persalys.DataModel.MC, persalys.DataModel.QMC, persalys.DataModel.RLHS, persalys.DataModel.OLHS, persalys.DataModel.GRID, persalys.DataModel.MORRIS