DataModel¶
- class persalys.DataModel(*args)¶
- Create a data model from an imported dataset. - The interface allows the user to load data samples and analyse them. They are considered as data models. - DataModel(name, fileName, inputColumns, outputColumns, inputNames, outputNames) - DataModel(name, inputSample, outputSample) - Parameters:
- namestr
- Name 
- 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 (optional) 
- inputNamessequence of str
- Names of the input variables (optional) 
- outputNamessequence of str
- Names of the output variables (optional) 
- inputSampleopenturns.Sample
- Input sample 
- outputSampleopenturns.Sample
- Output sample (optional) 
 
 - Methods - Accessor to the object's name. - Effective indices accessor. - File name accessor. - Columns 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. - Columns of the output variables accessor. - Names of the output variables accessor. - Output sample accessor. - Physical model accessor. - Python script accessor. - Sample accessor. - Sample from the file accessor. - 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(*args)- Columns and names of variables accessor. - setFileName(*args)- File name accessor. - setInputSample(sample)- Input sample accessor. - setName(name)- Accessor to the object's name. - setOutputSample(sample)- Output sample accessor. - setSample - Examples - >>> import openturns as ot >>> import persalys >>> ot.RandomGenerator.SetSeed(0) >>> fileName = 'sample.csv' >>> sample = ot.Normal(3).getSample(30) >>> sample.exportToCSVFile(fileName) >>> model = persalys.DataModel('dataModel', fileName, [0, 2], [1], ['var1', 'var2'], ['var3']) - __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:
- indicesopenturns.Indices
- Input sample and output sample 
 
- indices
 
 - getFileName()¶
- File name accessor. - Returns:
- fileNamestr
- Name of the file containing data 
 
 
 - getInputColumns()¶
- Columns of the input variables accessor. - Returns:
- columnsopenturns.Indices
- Columns of the input variables 
 
- columns
 
 - getInputNames()¶
- Names of the input variables accessor. - Returns:
- namesopenturns.Description
- Names of the input variables 
 
- names
 
 - getInputSample()¶
- Input sample accessor. - Returns:
- sampleopenturns.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:
- sampleopenturns.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. 
 
 
 - getOutputColumns()¶
- Columns of the output variables accessor. - Returns:
- columnsopenturns.Indices
- Columns of the output variables 
 
- columns
 
 - getOutputNames()¶
- Names of the output variables accessor. - Returns:
- namesopenturns.Description
- Names of the output variables 
 
- names
 
 - getOutputSample()¶
- Output sample accessor. - Returns:
- sampleopenturns.Sample
- Output sample 
 
- sample
 
 - getPhysicalModel()¶
- Physical model accessor. - Returns:
- modelPhysicalModel
- Physical model 
 
- model
 
 - getPythonScript()¶
- Python script accessor. - Returns:
- scriptstr
- Python script to rebuild the design of experiments 
 
 
 - getSample()¶
- Sample accessor. - Returns:
- sampleopenturns.Sample
- Input sample and output sample 
 
- sample
 
 - getSampleFromFile()¶
- Sample from the file accessor. - Returns:
- sampleopenturns.Sample
- Sample from the file 
 
- sample
 
 - 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(*args)¶
- Columns and names of variables accessor. - Parameters:
- inputColumnssequence of int
- Columns of input variables 
- inNamessequence of str
- Names of input variables 
- outputColumnssequence of int, optional
- Columns of output variables 
- outNamessequence of str
- Names of output variables 
 
 
 - setFileName(*args)¶
- File name accessor. - Parameters:
- fileNamestr
- Name of the file containing data 
 
 
 - setInputSample(sample)¶
- Input sample accessor. - Parameters:
- sampleopenturns.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:
- sampleopenturns.Sample
- Output sample 
 
- sample
 
 
