Classes | Typedefs | Functions
SQPrepareBatchPrediction.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQVariable.h"
#include "SQBatchPrediction.h"
#include "SQStringMatrix.h"

Go to the source code of this file.

Classes

struct  tagSQ_PrepareBatchPrediction
 

Typedefs

typedef struct tagSQ_PrepareBatchPredictionSQ_PrepareBatchPrediction
 

Functions

SQ_ErrorCode SQ_ClearPrepareBatchPrediction (SQ_PrepareBatchPrediction *pPreparePrediction)
 
SQ_ErrorCode SQ_GetVariablesForBatchPrediction (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, SQ_VariableVector *pVariables)
 
SQ_ErrorCode SQ_SetQualitativeBatchData (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, int iRow, int iColumn, const char *szData)
 
SQ_ErrorCode SQ_SetQualitativeBatchDataMatrix (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, SQ_StringMatrix pMatrix)
 
SQ_ErrorCode SQ_SetQuantitativeBatchData (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, int iRow, int iColumn, const float fVal)
 
SQ_ErrorCode SQ_SetQuantitativeBatchDataMatrix (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, SQ_FloatMatrix pMatrix)
 
SQ_ErrorCode SQ_SetQuantitativeBatchDataRaw (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, int iNumberOfRows, const float *pValues)
 
SQ_ErrorCode SQ_GetLocalCenteringInfo (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, SQ_VariableVector *pVariables, SQ_FloatVector *pDefaultValues)
 
SQ_ErrorCode SQ_SpecifyLocalCentering (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, SQ_VariableVector pVariables, SQ_FloatVector pLocalCenteringValue)
 
SQ_ErrorCode SQ_GetBatchConditionVariablesForBatchPrediction (SQ_PrepareBatchPrediction pPreparePrediction, SQ_VariableVector *pBCVariables)
 
SQ_ErrorCode SQ_GetPhaseIterationConditionVariablesForBatchPrediction (SQ_PrepareBatchPrediction pPreparePrediction, SQ_VariableVector *pBCVariables)
 
SQ_ErrorCode SQ_SetQualitativeBatchConditionData (SQ_PrepareBatchPrediction pPreparePrediction, int iBCIndex, const char *szData)
 
SQ_ErrorCode SQ_SetPhaseIterations (SQ_PrepareBatchPrediction pPreparePrediction, int iPhase, SQ_IntVector pPhaseIterations)
 
SQ_ErrorCode SQ_SetQualitativeBatchConditionDataVector (SQ_PrepareBatchPrediction pPreparePrediction, SQ_StringVector pData)
 
SQ_ErrorCode SQ_SetQuantitativeBatchConditionData (SQ_PrepareBatchPrediction pPreparePrediction, int iBCIndex, const float fVal)
 
SQ_ErrorCode SQ_SetQuantitativeBatchConditionDataVector (SQ_PrepareBatchPrediction pPreparePrediction, SQ_FloatVector pData)
 
SQ_ErrorCode SQ_SetQualitativePhaseIterationConditionData (SQ_PrepareBatchPrediction pPreparePrediction, int iPCVarIndex, const char *szPhase, int iPItCIndex, const char *szData)
 
SQ_ErrorCode SQ_SetQualitativePhaseIterationConditionDataMatrix (SQ_PrepareBatchPrediction pPreparePrediction, const char *szPhase, SQ_StringMatrix pData)
 
SQ_ErrorCode SQ_SetQuantitativePhaseIterationConditionData (SQ_PrepareBatchPrediction pPreparePrediction, int iPCVarIndex, const char *szPhase, int iPItCIndex, const float fVal)
 
SQ_ErrorCode SQ_SetQuantitativePhaseIterationConditionDataMatrix (SQ_PrepareBatchPrediction pPreparePrediction, const char *szPhase, SQ_FloatMatrix pData)
 
SQ_ErrorCode SQ_GetBatchPrediction (SQ_PrepareBatchPrediction pPreparePrediction, SQ_BatchPrediction *pPrediction)
 

Detailed Description

This file list the SQ_PrepareBatchPrediction object used to set data for a prediction.

Typedef Documentation

◆ SQ_PrepareBatchPrediction

The handle used to identify the object that sets data for a batch prediction. IMPORTANT: Always initialize it to NULL!

Function Documentation

◆ SQ_ClearPrepareBatchPrediction()

SQ_ErrorCode SQ_ClearPrepareBatchPrediction ( SQ_PrepareBatchPrediction pPreparePrediction)

Removes the allocated memory for the PrepareBatchPrediction object. This function must be called for every PrepareBatchPrediction object that is created, if not a memory leak will occur.

Parameters
[in]pPreparePredictionThe PrepareBatchPrediction object to remove.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetBatchConditionVariablesForBatchPrediction()

SQ_ErrorCode SQ_GetBatchConditionVariablesForBatchPrediction ( SQ_PrepareBatchPrediction  pPreparePrediction,
SQ_VariableVector pBCVariables 
)

Retrieves the batch and phase condition variables that are included in the BLM. If data is missing for any of the variables, set them to "missing value". Both quantitative and qualitative variables and X and Y will be returned.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[out]pBCVariablesThe Batch condition variables needed as input to GetBatchPrediction.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetBatchPrediction()

SQ_ErrorCode SQ_GetBatchPrediction ( SQ_PrepareBatchPrediction  pPreparePrediction,
SQ_BatchPrediction pPrediction 
)

Performs a batch prediction on the data that have been set with SQ_SetQualitativeBatchData and SQ_SetQuantitativeBatchData. The returned object must be released by SQ_ClearBatchPrediction.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[out]pPredictionThe prediction object that should be used to retrieve the prediction results.
Must be released by SQ_ClearBatchPrediction.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetLocalCenteringInfo()

SQ_ErrorCode SQ_GetLocalCenteringInfo ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
SQ_VariableVector pVariables,
SQ_FloatVector pDefaultValues 
)

A request for the local centering connected with the given model number. If the model is a batch model and local centering was not specified for a variable in this phase, but has been specified for the variable in another phase, the average of all phases will be returned for this phase.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]iPhaseThe phase to get the Local Centering information for.
[out]pVariablesThe variables that local centering data was found for.
[out]pDefaultValuesThe default values.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetPhaseIterationConditionVariablesForBatchPrediction()

SQ_ErrorCode SQ_GetPhaseIterationConditionVariablesForBatchPrediction ( SQ_PrepareBatchPrediction  pPreparePrediction,
SQ_VariableVector pBCVariables 
)

Retrieves the phase iteration condition variables that are included in the BLM. If data is missing for any of the variables, set them to "missing value". Both quantitative and qualitative variables and X and Y will be returned.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[out]pBCVariablesThe phase iteration condition variables needed as input to GetBatchPrediction.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariablesForBatchPrediction()

SQ_ErrorCode SQ_GetVariablesForBatchPrediction ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
SQ_VariableVector pVariables 
)

Retrieves the variables that the current model are based on. These are the variables that are needed to perform a prediction. If data is missing for any of the variables, set them to "missing value". Both quantitative and qualitative variables and X and Y will be returned.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]iPhaseThe index of the phase to set the data for.
[out]pVariablesThe variables needed as input to GetBatchPrediction.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetPhaseIterations()

SQ_ErrorCode SQ_SetPhaseIterations ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
SQ_IntVector  pPhaseIterations 
)

Sets the phase iteration for each observation, the vectur muste bee sorted ascending.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPhaseThe index of the phase to set the data for.
[in]pPhaseIterationsThe phase iteration indexes for each observation in the phase, the vector must be sorted ascending.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeBatchConditionData()

SQ_ErrorCode SQ_SetQualitativeBatchConditionData ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iBCIndex,
const char *  szData 
)

Sets qualitative Batch/Phase Condition data for the prediction. This function can be used even for quantitative data, the string will then be converted to a float.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iBCIndexThe index of the Batch/Phase Condition variable to set the data for.
[in]szDataThe string data to predict, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeBatchConditionDataVector()

SQ_ErrorCode SQ_SetQualitativeBatchConditionDataVector ( SQ_PrepareBatchPrediction  pPreparePrediction,
SQ_StringVector  pData 
)

Sets qualitative Batch/Phase Condition data for the prediction. This function can be used even for quantitative data, the string will then be converted to a float.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]pDataThe string data for batch predictions. Must be the number of columns as batch and phase condition variables.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeBatchData()

SQ_ErrorCode SQ_SetQualitativeBatchData ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
int  iRow,
int  iColumn,
const char *  szData 
)

Sets qualitative data for the prediction. This function can be used even for quantitative data, the string will then be converted to a float.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPhaseThe index of the phase to set the data for.
[in]iRowThe row/observation to set the data for. The matrix will automatically be increased to the correct size.
[in]iColumnThe column/variable to set the data for.
[in]szDataThe string data to predict, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeBatchDataMatrix()

SQ_ErrorCode SQ_SetQualitativeBatchDataMatrix ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
SQ_StringMatrix  pMatrix 
)

Sets qualitative data for the prediction. This function can be used even for quantitative data, the string will then be converted to a float.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPhaseThe phase to set the data for.
[in]pMatrixA matrix with the same number of columns as the phase it should set prediction data for.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativePhaseIterationConditionData()

SQ_ErrorCode SQ_SetQualitativePhaseIterationConditionData ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPCVarIndex,
const char *  szPhase,
int  iPItCIndex,
const char *  szData 
)

Sets qualitative Phase Iteration Condition data for the prediction. This function can be used even for quantitative data, the string will then be converted to a float.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPCVarIndexThe index of the Phase Iteration Condition variable to set the data for.
[in]iPItCIndexThe index of the Phase Iteration Condition to set the data for.
[in]szPhaseThe name of the Phase.
[in]szDataThe string data to predict, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativePhaseIterationConditionDataMatrix()

SQ_ErrorCode SQ_SetQualitativePhaseIterationConditionDataMatrix ( SQ_PrepareBatchPrediction  pPreparePrediction,
const char *  szPhase,
SQ_StringMatrix  pData 
)

Sets qualitative Phase Iteration Condition data for the prediction. This function can be used even for quantitative data, the string will then be converted to a float.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]szPhaseThe name of the Phase.
[in]pDataThe string data for batch predictions. Must be one row per phase iteration and one column per phase iteration condition variable.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeBatchConditionData()

SQ_ErrorCode SQ_SetQuantitativeBatchConditionData ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iBCIndex,
const float  fVal 
)

Sets quantitative Batch/Phase Condition data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iBCIndexThe index of the Batch/Phase Condition variable to set the data for.
[in]fValThe float data to predict.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeBatchConditionDataVector()

SQ_ErrorCode SQ_SetQuantitativeBatchConditionDataVector ( SQ_PrepareBatchPrediction  pPreparePrediction,
SQ_FloatVector  pData 
)

Sets quantitative Batch/Phase Condition data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]pDataThe string data for batch predictions. Must be the number of columns as batch and phase condition variables.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeBatchData()

SQ_ErrorCode SQ_SetQuantitativeBatchData ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
int  iRow,
int  iColumn,
const float  fVal 
)

Sets quantitative data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPhaseThe phase to set the data for.
[in]iRowThe row/observation to set the data for. The matrix will automatically be increased to the correct size.
[in]iColumnThe column/variable to set the data for.
[in]fValThe float data to predict.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeBatchDataMatrix()

SQ_ErrorCode SQ_SetQuantitativeBatchDataMatrix ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
SQ_FloatMatrix  pMatrix 
)

Sets quantitative data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPhaseThe phase to set the data for.
[in]pMatrixA matrix with the same number of columns as the phase it should set prediction data for.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeBatchDataRaw()

SQ_ErrorCode SQ_SetQuantitativeBatchDataRaw ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
int  iNumberOfRows,
const float *  pValues 
)

Sets quantitative data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPhaseThe phase to set the data for.
[in]iNumberOfRowsThe number of rows included in the prediction data The matrix will automatically be increased to the correct size.
[in]pValuesA pointer to a matrix of float values with the same number of columns as the phase it should set prediction data for.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativePhaseIterationConditionData()

SQ_ErrorCode SQ_SetQuantitativePhaseIterationConditionData ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPCVarIndex,
const char *  szPhase,
int  iPItCIndex,
const float  fVal 
)

Sets quantitative Phase Iteration Condition data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]iPCVarIndexThe index of the Phase Iteration Condition variable to set the data for.
[in]szPhaseThe name of the Phase.
[in]iPItCIndexThe index of the Phase Iteration Condition in that pahse to set the data for.
[in]fValThe float data to predict.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativePhaseIterationConditionDataMatrix()

SQ_ErrorCode SQ_SetQuantitativePhaseIterationConditionDataMatrix ( SQ_PrepareBatchPrediction  pPreparePrediction,
const char *  szPhase,
SQ_FloatMatrix  pData 
)

Sets quantitative Phase Iteration Condition data for the prediction. This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe data to use for the prediction.
[in]szPhaseThe name of the Phase.
[in]pDataThe string data for batch predictions. Must be one row per phase iteration and one column per phase iteration condition variable.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SpecifyLocalCentering()

SQ_ErrorCode SQ_SpecifyLocalCentering ( SQ_PrepareBatchPrediction  pPreparePrediction,
int  iPhase,
SQ_VariableVector  pVariables,
SQ_FloatVector  pLocalCenteringValue 
)

Will specify new local centering values that will be used when performing predictions.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]iPhaseThe phase to specify the Local Centering information for.
[in]pVariablesThe variables that local centering data was found for.
[in]pLocalCenteringValueThe new center values to use.
Returns
Returns SQ_E_OK if success or an error code

Copyright (C) Sartorius Stedim Data Analytics AB - Generated by Doxygen