Classes | Typedefs | Functions
SQPreparePrediction.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQVariable.h"
#include "SQPrediction.h"
#include "SQStringMatrix.h"

Go to the source code of this file.

Classes

struct  tagSQ_PreparePrediction
 

Typedefs

typedef struct tagSQ_PreparePredictionSQ_PreparePrediction
 

Functions

SQ_ErrorCode SQ_ClearPreparePrediction (SQ_PreparePrediction *pPreparePrediction)
 
SQ_ErrorCode SQ_GetVariablesForPrediction (SQ_PreparePrediction pPreparePrediction, SQ_VariableVector *pVariables)
 
SQ_ErrorCode SQ_SetQualitativeData (SQ_PreparePrediction pPreparePrediction, int iRow, int iVariableIndex, const char *szData)
 
SQ_ErrorCode SQ_SetQualitativeDataMatrix (SQ_PreparePrediction pPreparePrediction, SQ_StringMatrix oData)
 
SQ_ErrorCode SQ_SetQualitativeLagData (SQ_PreparePrediction pPreparePrediction, SQ_Variable pVar, int iLagStep, const char *szData)
 
SQ_ErrorCode SQ_SetQuantitativeData (SQ_PreparePrediction pPreparePrediction, int iRow, int iVariableIndex, const float fVal)
 
SQ_ErrorCode SQ_SetPredictClass (SQ_PreparePrediction pPreparePrediction, int iRow, int iClass)
 
SQ_ErrorCode SQ_SetQuantitativeDataRaw (SQ_PreparePrediction pPreparePrediction, int iRows, const float *pfVals)
 
SQ_ErrorCode SQ_SetQuantitativeDataMatrix (SQ_PreparePrediction pPreparePrediction, SQ_FloatMatrix pMatrix)
 
SQ_ErrorCode SQ_SetQuantitativeLagData (SQ_PreparePrediction pPreparePrediction, SQ_Variable pVar, int iLagStep, const float fVal)
 
SQ_ErrorCode SQ_GetPrediction (SQ_PreparePrediction pPreparePrediction, SQ_Prediction *pPrediction)
 

Detailed Description

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

Typedef Documentation

◆ SQ_PreparePrediction

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

Function Documentation

◆ SQ_ClearPreparePrediction()

SQ_ErrorCode SQ_ClearPreparePrediction ( SQ_PreparePrediction pPreparePrediction)

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

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

◆ SQ_GetPrediction()

SQ_ErrorCode SQ_GetPrediction ( SQ_PreparePrediction  pPreparePrediction,
SQ_Prediction pPrediction 
)

Performs a prediction on the data that have been set with SQ_SetQualitativeData and SQ_SetQuantitativeData. The returned object must be released by SQ_ClearPrediction.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[out]pPredictionThe prediction object that should be used to retrieve the prediction results.
Must be released by SQ_ClearPrediction or is removed when the model is closed.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariablesForPrediction()

SQ_ErrorCode SQ_GetVariablesForPrediction ( SQ_PreparePrediction  pPreparePrediction,
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.
[out]pVariablesThe variables needed as input to GetPrediction.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetPredictClass()

SQ_ErrorCode SQ_SetPredictClass ( SQ_PreparePrediction  pPreparePrediction,
int  iRow,
int  iClass 
)

Sets class for an observation in the prediction set

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]iRowThe row/observation to set the data for.
[in]iClassThe new class.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeData()

SQ_ErrorCode SQ_SetQualitativeData ( SQ_PreparePrediction  pPreparePrediction,
int  iRow,
int  iVariableIndex,
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 PreparePrediction object to use for the prediction.
[in]iRowThe row/observation to set the data for. The matrix will automatically be increased to the correct size.
[in]iVariableIndexThe variable to set the data for, represents the variable index returned by SQ_GetVariablesForPrediction.
[in]szDataThe string data to predict, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeDataMatrix()

SQ_ErrorCode SQ_SetQualitativeDataMatrix ( SQ_PreparePrediction  pPreparePrediction,
SQ_StringMatrix  oData 
)

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 PreparePrediction object to use for the prediction.
[in]oDataA string matrix to use for the predictions
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQualitativeLagData()

SQ_ErrorCode SQ_SetQualitativeLagData ( SQ_PreparePrediction  pPreparePrediction,
SQ_Variable  pVar,
int  iLagStep,
const char *  szData 
)

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

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]pVarThe variable to set the lagged data for.
[in]iLagStepThe lag step to set the value for.
[in]szDataThe string data to predict, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeData()

SQ_ErrorCode SQ_SetQuantitativeData ( SQ_PreparePrediction  pPreparePrediction,
int  iRow,
int  iVariableIndex,
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 PreparePrediction object to use for the prediction.
[in]iRowThe row/observation to set the data for. The matrix will automatically be increased to the correct size.
[in]iVariableIndexThe variable to set the data for, represents the variable index returned by SQ_GetVariablesForPrediction.
[in]fValThe float data to predict.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeDataMatrix()

SQ_ErrorCode SQ_SetQuantitativeDataMatrix ( SQ_PreparePrediction  pPreparePrediction,
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 PreparePrediction object to use for the prediction.
[in]pMatrixThe matrix to set as prediction data
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeDataRaw()

SQ_ErrorCode SQ_SetQuantitativeDataRaw ( SQ_PreparePrediction  pPreparePrediction,
int  iRows,
const float *  pfVals 
)

Sets quantitative data for the prediction with raw float values. Must be of the size NumberOfVariablesToPredict x iRows This function can be used even for qualitative data, the index of the settings should then be used.

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]iRowsNumber of rows that to set values for The matrix will automatically be increased to the correct size.
[in]pfValsThe float data to predict. Must be of correct size!
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetQuantitativeLagData()

SQ_ErrorCode SQ_SetQuantitativeLagData ( SQ_PreparePrediction  pPreparePrediction,
SQ_Variable  pVar,
int  iLagStep,
const float  fVal 
)

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

Parameters
[in]pPreparePredictionThe PreparePrediction object to use for the prediction.
[in]pVarThe variable to set the lagged data for.
[in]iLagStepThe lag step to set the value for.
[in]fValThe float data to predict.
Returns
Returns SQ_E_OK if success or an error code

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