#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_PreparePrediction * | SQ_PreparePrediction |
This file list the SQ_PreparePrediction object used to set data for a prediction.
typedef struct tagSQ_PreparePrediction * SQ_PreparePrediction |
The handle used to identify the object that sets data for a prediction. IMPORTANT: Always initialize it to NULL!
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.
[in] | pPreparePrediction | The PreparePrediction object to remove. |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[out] | pPrediction | The 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. |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[out] | pVariables | The variables needed as input to GetPrediction. |
SQ_ErrorCode SQ_SetPredictClass | ( | SQ_PreparePrediction | pPreparePrediction, |
int | iRow, | ||
int | iClass | ||
) |
Sets class for an observation in the prediction set
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | iRow | The row/observation to set the data for. |
[in] | iClass | The new class. |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | iRow | The row/observation to set the data for. The matrix will automatically be increased to the correct size. |
[in] | iVariableIndex | The variable to set the data for, represents the variable index returned by SQ_GetVariablesForPrediction. |
[in] | szData | The string data to predict, UTF-8 encoded. |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | oData | A string matrix to use for the predictions |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | pVar | The variable to set the lagged data for. |
[in] | iLagStep | The lag step to set the value for. |
[in] | szData | The string data to predict, UTF-8 encoded. |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | iRow | The row/observation to set the data for. The matrix will automatically be increased to the correct size. |
[in] | iVariableIndex | The variable to set the data for, represents the variable index returned by SQ_GetVariablesForPrediction. |
[in] | fVal | The float data to predict. |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | pMatrix | The matrix to set as prediction data |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | iRows | Number of rows that to set values for The matrix will automatically be increased to the correct size. |
[in] | pfVals | The float data to predict. Must be of correct size! |
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.
[in] | pPreparePrediction | The PreparePrediction object to use for the prediction. |
[in] | pVar | The variable to set the lagged data for. |
[in] | iLagStep | The lag step to set the value for. |
[in] | fVal | The float data to predict. |
Copyright (C) Sartorius Stedim Data Analytics AB - Generated by Doxygen