Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

SimpleTrainingPlan Struct Reference

Last update: 16.07.2025

TrainingPlan assigns a in a set of sample each sample a status on how the sample is to be treated during the training of a model A model is trained for a set of outputs. More...

Public Member Functions

virtual std::vector< string > getInputNames (::data_handler::DataHandlerBase datahandler) override
 Returns the input names from the datahandler. More...
 
virtual Matrix getInputs (::data_handler::DataHandlerBase datahandler) override
 Returns the inputs fitting the training plan from the datahandler. More...
 
virtual string getMOPIdent () override
 Returns the MOP ident the TrainingPlan is created for. More...
 
virtual std::vector< string > getOutputNames (::data_handler::DataHandlerBase datahandler) override
 Returns the output names from the datahandler. More...
 
virtual Matrix getOutputs (::data_handler::DataHandlerBase datahandler) override
 Returns the outputs fitting the training plan from the datahandler. More...
 
virtual SampleUsage getSampleUsageInSet (uint64_t i, uint64_t j) override
 getSampleUsage accessor of the j-th sample in the i-th training set More...
 
virtual SampleUsage getSampleUsageInSetRef (uint64_t i, uint64_t j) override
 getSampleUsageRef non- accessor of the j-th sample in the i-th training set More...
 
virtual ParameterImportance inputImportance (uint64_t i) override
 parameter returns the ParameterImportance for the i-th parameter More...
 
virtual ParameterImportance inputImportanceInSubspace (uint64_t i, uint64_t j, uint64_t o=0) override
 inputImportanceInSubspace returns true if the input j is in the subspace i for the given o-th output in the output-matrix. More...
 
virtual bool isValid (::data_handler::DataHandlerBase datahandler) override
 Checks if the training plan is valid for the give datahandler. More...
 
virtual uint64_t numInputs () override
 numInputs returns the number of inputs used and defined in this training plan More...
 
virtual uint64_t numOutputs () override
 numOutputs returns the number of outputs used in this training plan More...
 
virtual uint64_t numSamplesInSet (uint64_t i) override
 numSamplesInSet returns the number of elements (samples) in the training set More...
 
virtual uint64_t numSets () override
 numSets returns the number of training sets in the training plan More...
 
virtual uint64_t numSubspaces (uint64_t i=0) override
 numSubspaces returns the number of filtered subspaces available in the Training Plan to the i-th output in the output matrix More...
 
virtual uint64_t numTestSamplesInSet (uint64_t i) override
 numTestSamplesInSet returns the number of elements (samples) in the training set More...
 
virtual uint64_t numTrainingSamplesInSet (uint64_t i) override
 numTrainingSamplesInSet returns the number of elements (samples) in the training set More...
 
SimpleTrainingPlan operator= (SimpleTrainingPlan)=default
 Copy-Assignment.
 
virtual uint64_t output (uint64_t i) override
 parameter returns the index of the i-th output in the output matrix More...
 
virtual setInputs (::data_handler::DataHandlerBase datahandler, Matrix inputs)
 Inserts the inputs fitting the training plan from the datahandler. More...
 
virtual setOutputs (::data_handler::DataHandlerBase datahandler, Matrix outputs)
 Inserts the outputs fitting the training plan from the datahandler. More...
 
 SimpleTrainingPlan ()=default
 Constructor.
 
 SimpleTrainingPlan (TrainingPlanVector plan, ParameterImportanceVector params, IndexVector output_map, SubspaceMatrixList subspace_matrix_list, uint64_t num_inputs, string mop_ident=handler::defaultMOPIdent)
 Initializing Constructor. More...
 
 SimpleTrainingPlan (SimpleTrainingPlan)=default
 Copy-Contructor.
 

Public Attributes

ParameterImportanceVector m_input_importance
 
string m_mop_ident
 
uint64_t m_num_inputs
 
IndexVector m_output_mapping
 
SubspaceMatrixList m_subspace_matrix_list
 
TrainingPlanVector m_training
 

Detailed Description

TrainingPlan assigns a in a set of sample each sample a status on how the sample is to be treated during the training of a model A model is trained for a set of outputs.

  • if the set is a singleton (one element), the trained model is a scalar one
  • if the set has more than one element the output dimension should be consistent for all samples. if it is not consistent, we are dealing with incomplete samples. Either the model itself has then to decide how to handle this or this should be handled before the competition is defined i.e. by the (Scalar)MOP The training plan is not concerned with failed/incomplete inputs. It should always handle a consistent input/output pair

Constructor & Destructor Documentation

◆ SimpleTrainingPlan()

SimpleTrainingPlan ( TrainingPlanVector  plan,
ParameterImportanceVector  params,
IndexVector  output_map,
SubspaceMatrixList  subspace_matrix_list,
uint64_t  num_inputs,
string  mop_ident = handler::defaultMOPIdent 
)

Initializing Constructor.

Parameters
planA collection of lists that describe for each sample if its used for training, testing or is ignored Multiple lists are used for instance in the Leave-One-Out or cross-validation scenario
paramsDefines for each input parameter its importance (if it is ignored, mandatory or optional)
output_mapDefines how the vectors in the output matrix are mapped to the actual output in the training
subspace_matrix_listDefines a list of possible input subspaces for each output (after output mapping). This may be used by model for increased approximation quality.
num_inputsThe number of inputs for the training
mop_dentThe mops ident

Member Function Documentation

◆ getInputNames()

virtual std::vector<string> getInputNames ( ::data_handler::DataHandlerBase  datahandler)
overridevirtual

Returns the input names from the datahandler.

Parameters
datahandlerThe datahandler to get the data from
Returns
The input data names

Implements TrainingPlanBase.

◆ getInputs()

virtual Matrix getInputs ( ::data_handler::DataHandlerBase  datahandler)
overridevirtual

Returns the inputs fitting the training plan from the datahandler.

Parameters
datahandlerThe datahandler to get the data from
Returns
The (scalar) input data

Implements TrainingPlanBase.

◆ getMOPIdent()

virtual string getMOPIdent ( )
overridevirtual

Returns the MOP ident the TrainingPlan is created for.

Returns
The ident for the MOP

Implements TrainingPlanBase.

◆ getOutputNames()

virtual std::vector<string> getOutputNames ( ::data_handler::DataHandlerBase  datahandler)
overridevirtual

Returns the output names from the datahandler.

Parameters
datahandlerThe datahandler to get the data from
Returns
The output data names

Implements TrainingPlanBase.

◆ getOutputs()

virtual Matrix getOutputs ( ::data_handler::DataHandlerBase  datahandler)
overridevirtual

Returns the outputs fitting the training plan from the datahandler.

Parameters
datahandlerThe datahandler to get the data from
Returns
The (scalar) output data

Implements TrainingPlanBase.

◆ getSampleUsageInSet()

virtual SampleUsage getSampleUsageInSet ( uint64_t  i,
uint64_t  j 
)
overridevirtual

getSampleUsage accessor of the j-th sample in the i-th training set

Parameters
iIndex of the training set
jIndex of the sample in training set i
Returns
The sample at the given indices

Implements TrainingPlanBase.

◆ getSampleUsageInSetRef()

virtual SampleUsage getSampleUsageInSetRef ( uint64_t  i,
uint64_t  j 
)
overridevirtual

getSampleUsageRef non- accessor of the j-th sample in the i-th training set

Parameters
iIndex of the training set
jIndex of the sample in training set i
Returns
The sample at the given indices

Implements TrainingPlanBase.

◆ inputImportance()

virtual ParameterImportance inputImportance ( uint64_t  i)
overridevirtual

parameter returns the ParameterImportance for the i-th parameter

Parameters
iThe index of the parameter
Returns
The ParameterUsage of parameter i

Implements TrainingPlanBase.

◆ inputImportanceInSubspace()

virtual ParameterImportance inputImportanceInSubspace ( uint64_t  i,
uint64_t  j,
uint64_t  o = 0 
)
overridevirtual

inputImportanceInSubspace returns true if the input j is in the subspace i for the given o-th output in the output-matrix.

Parameters
iIndex of the subspace
jIndex of the input parameter
oThe o-th output the input is important to
Returns
ParameterImportance of input j in subspace i for the given output

Implements TrainingPlanBase.

◆ isValid()

virtual bool isValid ( ::data_handler::DataHandlerBase  datahandler)
overridevirtual

Checks if the training plan is valid for the give datahandler.

Returns
true iff the training plan is valid

Implements TrainingPlanBase.

◆ numInputs()

virtual uint64_t numInputs ( )
overridevirtual

numInputs returns the number of inputs used and defined in this training plan

Returns
The number of parameters the training plan is defined on

Implements TrainingPlanBase.

◆ numOutputs()

virtual uint64_t numOutputs ( )
overridevirtual

numOutputs returns the number of outputs used in this training plan

Returns
The number of outputs the training plan is defined on

Implements TrainingPlanBase.

◆ numSamplesInSet()

virtual uint64_t numSamplesInSet ( uint64_t  i)
overridevirtual

numSamplesInSet returns the number of elements (samples) in the training set

Parameters
iThe index of the training set
Returns
The number of elements in set i

Implements TrainingPlanBase.

◆ numSets()

virtual uint64_t numSets ( )
overridevirtual

numSets returns the number of training sets in the training plan

Returns
The number of training sets

Implements TrainingPlanBase.

◆ numSubspaces()

virtual uint64_t numSubspaces ( uint64_t  i = 0)
overridevirtual

numSubspaces returns the number of filtered subspaces available in the Training Plan to the i-th output in the output matrix

Parameters
iThe index of the output
Returns
The number of Subspaces

Implements TrainingPlanBase.

◆ numTestSamplesInSet()

virtual uint64_t numTestSamplesInSet ( uint64_t  i)
overridevirtual

numTestSamplesInSet returns the number of elements (samples) in the training set

Parameters
iThe index of the training set
Returns
The number of elements in set i

Implements TrainingPlanBase.

◆ numTrainingSamplesInSet()

virtual uint64_t numTrainingSamplesInSet ( uint64_t  i)
overridevirtual

numTrainingSamplesInSet returns the number of elements (samples) in the training set

Parameters
iThe index of the training set
Returns
The number of elements in set i

Implements TrainingPlanBase.

◆ output()

virtual uint64_t output ( uint64_t  i)
overridevirtual

parameter returns the index of the i-th output in the output matrix

Parameters
iThe index of the parameter
Returns
The index of output i in the output matrix

Implements TrainingPlanBase.

◆ setInputs()

virtual setInputs ( ::data_handler::DataHandlerBase  datahandler,
Matrix  inputs 
)
virtual

Inserts the inputs fitting the training plan from the datahandler.

Parameters
datahandlerThe datahandler to set the data in
inputsThe data to set

◆ setOutputs()

virtual setOutputs ( ::data_handler::DataHandlerBase  datahandler,
Matrix  outputs 
)
virtual

Inserts the outputs fitting the training plan from the datahandler.

Parameters
datahandlerThe datahandler to set the data in
outputsThe data to set

Connect with Ansys