Classes | Typedefs | Functions
SQMWorkset.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQCommon.h"
#include "SQMDefines.h"

Go to the source code of this file.

Classes

struct  tagSQ_WorksetHandle
 

Typedefs

typedef struct tagSQ_WorksetHandleSQ_Workset
 

Functions

SQ_ErrorCode SQ_ReleaseWorkset (SQ_Workset hWorkset)
 
SQ_ErrorCode SQ_AddDataset (SQ_Workset hWorkset, int iDatasetNumber)
 
SQ_ErrorCode SQ_AddObservations (SQ_Workset hWorkset, int iDatasetNumber, SQ_IntVector vecObservationIndices, SQ_IntVector *piWorksetIndices)
 
SQ_ErrorCode SQ_AddVariable (SQ_Workset hWorkset, int iDatasetNumber, SQ_IntVector hDSVariableIndices, SQ_FloatVector *pLags, SQ_IntVector *pLagTimeVariable, SQ_IntVector *pLagSpeedVariable, SQ_VariableBlock eBlock, int *hWorksetIndex)
 
SQ_ErrorCode SQ_CreateDefaultWorkset (SQ_Workset hWorkset)
 
SQ_ErrorCode SQ_SetWorksetDescription (SQ_Workset hWorkset, const char *szDescription)
 
SQ_ErrorCode SQ_GetWorksetDescription (SQ_Workset hWorkset, char *szDescription, int iBufferLen)
 
SQ_ErrorCode SQ_GetVariableSize (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int *pSize)
 
SQ_ErrorCode SQ_GetMissingValueToleranceObs (SQ_Workset hWorkset, float *pfFractionTolerated)
 
SQ_ErrorCode SQ_GetMissingValueToleranceVar (SQ_Workset hWorkset, float *pfFractionTolerated)
 
SQ_ErrorCode SQ_SetMissingValueToleranceObs (SQ_Workset hWorkset, float fFractionTolerated)
 
SQ_ErrorCode SQ_SetMissingValueToleranceVar (SQ_Workset hWorkset, float fFractionTolerated)
 
SQ_ErrorCode SQ_SetKeepLowVarianceVariables (SQ_Workset hWorkset, SQ_Bool bKeepVariables)
 
SQ_ErrorCode SQ_GetLongScalingName (SQ_WSScaleInfo *pScaleInfo, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_CreateModel (SQ_Workset hWorkset, SQ_Bool bCreateClassModels, SQ_ModelType eModelType, SQ_IntVector *pModelNumbers)
 
SQ_ErrorCode SQ_UpdateModel (SQ_Workset hWorkset)
 
SQ_ErrorCode SQ_GetObservationClass (SQ_Workset hWorkset, int iWorksetObservationIndex, int *piClassNo)
 
SQ_ErrorCode SQ_GetVariableClass (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetVariableIndex, SQ_IntVector *piClasses)
 
SQ_ErrorCode SQ_GetWorksetClasses (SQ_Workset hWorkset, SQ_IntVector *piClasses)
 
SQ_ErrorCode SQ_GetScaling (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetIndex, SQ_WSScaleInfo *pScaleInfo)
 
SQ_ErrorCode SQ_GetLongTransformName (SQ_WSTransformInfo *pTransformInfo, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_GetWorksetObservationName (SQ_Workset hWorkset, int iWorksetIndex, int iID, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_GetWorksetObservationSize (SQ_Workset hWorkset, int *piSize)
 
SQ_ErrorCode SQ_GetShortScalingName (SQ_WSScaleInfo *pScaleInfo, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_GetShortTransformName (SQ_WSTransformInfo *pTransformInfo, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_GetTransform (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iIndex, SQ_WSTransformInfo *pTransformInfo)
 
SQ_ErrorCode SQ_GetWorksetClassName (SQ_Workset hWorkset, int iClassNo, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_SetWorksetClassName (SQ_Workset hWorkset, int iClassNo, const char *szName)
 
SQ_ErrorCode SQ_AutogenerateClasses (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetIndex)
 
SQ_ErrorCode SQ_SetScaling (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetIndex, SQ_WSScaleInfo *pScaleInfo)
 
SQ_ErrorCode SQ_SetTransform (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetIndex, SQ_WSTransformInfo *pTransformInfo)
 
SQ_ErrorCode SQ_SetAutoTransformAll (SQ_Workset hWorkset, SQ_Bool bAutoTransformAllIfOneNeddsTransform)
 
SQ_ErrorCode SQ_SetObservationClass (SQ_Workset hWorkset, int iWorksetObservationIndex, int iClassNo)
 
SQ_ErrorCode SQ_SetObservationClasses (SQ_Workset hWorkset, SQ_IntVector *pClasses)
 
SQ_ErrorCode SQ_SetVariableClass (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetIndex, int iClassNo)
 
SQ_ErrorCode SQ_RemoveObservation (SQ_Workset hWorkset, int iWorksetIndex)
 
SQ_ErrorCode SQ_RemoveVariable (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iWorksetIndex)
 
SQ_ErrorCode SQ_GetObservationWorksetIndex (SQ_Workset hWorkset, int iDSIndex, int *hWorksetIndex)
 
SQ_ErrorCode SQ_GetObservationDatasetIndex (SQ_Workset hWorkset, int iWorksetIndex, int *pDatasetIndex)
 
SQ_ErrorCode SQ_GetVariableWorksetIndex (SQ_Workset hWorkset, int iDatasetNumber, SQ_IntVector pDSVariableIndices, SQ_FloatVector *pLags, SQ_IntVector *pLagTimeVariable, SQ_IntVector *pLagSpeedVariable, SQ_VariableBlock eSQBlock, int *pWorksetIndex)
 
SQ_ErrorCode SQ_GetVariableWorksetName (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iIndex, int iID, char *szName, int iBufferLen)
 
SQ_ErrorCode SQ_GetVariable (SQ_Workset hWorkset, SQ_VariableBlock eBlock, int iIndex, int *iDSNumber, SQ_IntVector *pDSVariableIndices, SQ_FloatVector *pLags, SQ_IntVector *pLagTimeVariable, SQ_IntVector *pLagSpeedVariable)
 

Typedef Documentation

◆ SQ_Workset

typedef struct tagSQ_WorksetHandle * SQ_Workset

The Workset handle used to identify a Workset. IMPORTANT: Always initialize it to NULL!

Function Documentation

◆ SQ_AddDataset()

SQ_ErrorCode SQ_AddDataset ( SQ_Workset  hWorkset,
int  iDatasetNumber 
)

Adds a new dataset last in the workset.

Parameters
[in]hWorksetHandle to the workset.
[in]iDatasetNumberThe number of the dataset to add from, if that dataset is not already in the model it will be added last.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_AddObservations()

SQ_ErrorCode SQ_AddObservations ( SQ_Workset  hWorkset,
int  iDatasetNumber,
SQ_IntVector  vecObservationIndices,
SQ_IntVector piWorksetIndices 
)

Adds observations to the workset.

Parameters
[in]hWorksetHandle to the workset.
[in]iDatasetNumberThe number of the dataset to add from, if that dataset is not already in the model it will be added last.
[in]vecObservationIndicesA vector of indices of the observation to add from the dataset.
[out]piWorksetIndicesThe indices of the added observations in the workset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_AddVariable()

SQ_ErrorCode SQ_AddVariable ( SQ_Workset  hWorkset,
int  iDatasetNumber,
SQ_IntVector  hDSVariableIndices,
SQ_FloatVector pLags,
SQ_IntVector pLagTimeVariable,
SQ_IntVector pLagSpeedVariable,
SQ_VariableBlock  eBlock,
int *  hWorksetIndex 
)

Adds a variable to the workset. The added variable will be un-scaled (SQ_ScaleNone).

See also
SQ_SetScaling.
Parameters
[in]hWorksetHandle to the workset.
[in]iDatasetNumberThe number of the dataset to add from.
[in]hDSVariableIndicesA vector containing variable indices in the dataset. Ex. If the dataset contains variables A, B and C (in that order), and pDSVariableIndices contains 1, 1, 3, the added variable will be A*A*C The vector must have at least one element and a maximum of three.
[in]pLagsLags for the variables indexed by pDS1VariableIndices. This parameter must have the same length as pDS1VariableIndices or be of zero length (if none of the sub-variables are to be lagged). if pLagTimeVariable and pLagSpeedVariable is not supplied or <1 the pLag is assumed to be integer steps.
[in]pLagTimeVariableThe index of the time variable used to calculate the dynamic lag This parameter must have the same length as pLags be null or empty if both pLagTimeVariable and pLagSpeedVariable is empty or a value <1 means that the variable is lagged by step and pLags is rounded to the closest integer value else it is dynamically lagged by this variable. The first element has index 1.
[in]pLagSpeedVariableThe index of the speed variable used to calculate the dynamic lag This parameter must have the same length as pLags be null or empty if it both pLagTimeVariable and pLagSpeedVariable a value <1 means that the variable is lagged by step and pLags is rounded to the closest integer value else it is dynamically lagged by this variable. The first element has index 1.
[in]eBlockThe block where the new variable is to be added. Interaction terms can not be added to the Y-block.
[out]hWorksetIndexWill contain the index in the workset of the new variable on return.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_AutogenerateClasses()

SQ_ErrorCode SQ_AutogenerateClasses ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetIndex 
)

Autogenerate classes from a qualitative variable in the workset.

Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iWorksetIndexThe index of the variable in the workset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_CreateDefaultWorkset()

SQ_ErrorCode SQ_CreateDefaultWorkset ( SQ_Workset  hWorkset)

Creates a default workset. The default workset is a PCA model containing all variables in the main dataset unless something else has been defined in the project options. The function clears the workset before creating the new workset.

Parameters
[in]hWorksetA handle to the Workset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_CreateModel()

SQ_ErrorCode SQ_CreateModel ( SQ_Workset  hWorkset,
SQ_Bool  bCreateClassModels,
SQ_ModelType  eModelType,
SQ_IntVector pModelNumbers 
)

Creates one or several unfitted models from the workset. If class model are to be created as many models as there are classes will be created.

Parameters
[in]hWorksetA handle to the workset.
[in]bCreateClassModelsSet to SQ_True if class models are to be created.
[in]eModelTypeThe type of model to create.
[out]pModelNumbersVector with the new model numbers.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetLongScalingName()

SQ_ErrorCode SQ_GetLongScalingName ( SQ_WSScaleInfo pScaleInfo,
char *  szName,
int  iBufferLen 
)

Returns a string containing a complete description of a variable scaling. The string returned can be up to 130 characters long.

Parameters
[in]pScaleInfoDescribes the scaling.
[in,out]szNameWill contain the name, UTF-8 encoded.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetLongTransformName()

SQ_ErrorCode SQ_GetLongTransformName ( SQ_WSTransformInfo pTransformInfo,
char *  szName,
int  iBufferLen 
)

Gets a string with a complete description of a transform. The string returned is never more than 45 characters long.

Parameters
[in]pTransformInfoDescribes the transform.
[in,out]szNameWill contain the name on return, UTF-8 encoded.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetMissingValueToleranceObs()

SQ_ErrorCode SQ_GetMissingValueToleranceObs ( SQ_Workset  hWorkset,
float *  pfFractionTolerated 
)

Gets the missing value tolerance for observations. Observations with more missing values than the limit will be excluded from the model when the model is created.

Parameters
[in]hWorksetA handle to the workset.
[out]pfFractionToleratedThe tolerance as a fraction (between 0 and 1).
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetMissingValueToleranceVar()

SQ_ErrorCode SQ_GetMissingValueToleranceVar ( SQ_Workset  hWorkset,
float *  pfFractionTolerated 
)

Gets the missing value tolerance for variables. Variables with more missing values than the limit will be excluded from the model when the model is created.

Parameters
[in]hWorksetA handle to the workset.
[out]pfFractionToleratedThe tolerance as a fraction (between 0 and 1).
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetObservationClass()

SQ_ErrorCode SQ_GetObservationClass ( SQ_Workset  hWorkset,
int  iWorksetObservationIndex,
int *  piClassNo 
)

Gets the number of the class that an observation belongs to.

Parameters
[in]hWorksetA handle to the workset.
[in]iWorksetObservationIndexThe index of the observation in the workset.
[out]piClassNoThe number of the class that the observation belongs to. If the observation belongs to all classes, this parameter will be 0 (zero) on exit.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetObservationDatasetIndex()

SQ_ErrorCode SQ_GetObservationDatasetIndex ( SQ_Workset  hWorkset,
int  iWorksetIndex,
int *  pDatasetIndex 
)

Returns the index of a observation in the dataset.

Parameters
[in]hWorksetA handle to the workset
[in]iWorksetIndexThe index in the workset of the observation
[out]pDatasetIndexWill contain the index in the dataset of the observation on return.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetObservationWorksetIndex()

SQ_ErrorCode SQ_GetObservationWorksetIndex ( SQ_Workset  hWorkset,
int  iDSIndex,
int *  hWorksetIndex 
)

Returns the index of a observation in the workset.

Parameters
[in]hWorksetA handle to the workset.
[in]iDSIndexThe index in the dataset of the observation.
[out]hWorksetIndexWill contain the index in the workset of the observation on return or 0 if it is not in the workset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetScaling()

SQ_ErrorCode SQ_GetScaling ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetIndex,
SQ_WSScaleInfo pScaleInfo 
)

Gets the scaling for a variable.

See also
SQ_SetScaling() for further details.
Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iWorksetIndexThe index in the workset of the variable.
[out]*pScaleInfoWill contain the scaling info on exit.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetShortScalingName()

SQ_ErrorCode SQ_GetShortScalingName ( SQ_WSScaleInfo pScaleInfo,
char *  szName,
int  iBufferLen 
)

Returns a short string describing the scaling for a variable. The string returned is never more than 10 characters long.

Parameters
[in]pScaleInfoDescribes the scaling.
[in,out]szNameWill contain the name on return, UTF-8 encoded.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetShortTransformName()

SQ_ErrorCode SQ_GetShortTransformName ( SQ_WSTransformInfo pTransformInfo,
char *  szName,
int  iBufferLen 
)

Gets a short name for a transform. The string returned is never more than 15 characters long.

Parameters
[in]pTransformInfoDescribes the transform.
[out]szNameWill contain the name on return, UTF-8 encoded.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetTransform()

SQ_ErrorCode SQ_GetTransform ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iIndex,
SQ_WSTransformInfo pTransformInfo 
)

Gets the transformation of a variable.

Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iIndexThe index in the workset of the variable.
[out]pTransformInfoWill contain the transformation info on exit.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariable()

SQ_ErrorCode SQ_GetVariable ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iIndex,
int *  iDSNumber,
SQ_IntVector pDSVariableIndices,
SQ_FloatVector pLags,
SQ_IntVector pLagTimeVariable,
SQ_IntVector pLagSpeedVariable 
)

Gets a variable.

See also
SQ_AddVariable.
Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iIndexThe index of the variable in it's block.
[out]iDSNumberThe dataset number where .
[out]pDSVariableIndicesA vector that contains dataset indices of the variables comprising this term. The first element has index 1.
[out]pLagsA vector that contains the lags of the variables. The first element has index 1.
[in]pLagTimeVariableA vector that contains the time variable for dynamic lags if both pLagTimeVariable and pLagSpeedVariable is empty or a value <1 means that the variable is lagged by step and pLags is rounded to the closest integer value else it is dynamically lagged by this variable. The first element has index 1.
[in]pLagSpeedVariableA vector that contains the speed variable for dynamic lags if it both pLagTimeVariable and pLagSpeedVariable a value <1 means that the variable is lagged by step and pLags is rounded to the closest integer value else it is dynamically lagged by this variable. The first element has index 1.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariableClass()

SQ_ErrorCode SQ_GetVariableClass ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetVariableIndex,
SQ_IntVector piClasses 
)

Gets the classes that a variable belongs to.

Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iWorksetVariableIndexThe index in the workset of the variable.
[out]piClassesA vector containing the numbers of the classes that the variable belongs to. The first element in the vector has index 0.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariableSize()

SQ_ErrorCode SQ_GetVariableSize ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int *  pSize 
)

Returns the number of variables in a block.

Parameters
[in]hWorksetA handle to the workset
[in]eBlockThe block (SQ_BlockX or SQ_BlockY).
[out]pSizeWill contain the number of variables in the block on exit.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariableWorksetIndex()

SQ_ErrorCode SQ_GetVariableWorksetIndex ( SQ_Workset  hWorkset,
int  iDatasetNumber,
SQ_IntVector  pDSVariableIndices,
SQ_FloatVector pLags,
SQ_IntVector pLagTimeVariable,
SQ_IntVector pLagSpeedVariable,
SQ_VariableBlock  eSQBlock,
int *  pWorksetIndex 
)

Returns the index of a variable in the workset.

Parameters
[in]hWorksetA handle to the workset
[in]iDatasetNumberThe number of the dataset to add from.
[in]pDSVariableIndicesA vector containing variable indices in the dataset. Ex. If the dataset contains variables A, B and C (in that order), and pDS1VariableIndices contains 1, 1, 3, the variable is A*A*C The vector must have at least one element and a maximum of three.
[in]pLagsLags for the variables indexed by pDS1VariableIndices. This parameter must have the same length as pDS1VariableIndices or be of zero length (if none of the sub-variables are to be lagged). if pLagDistanceVariable is not supplied or <1 the pLag is assumed to be integer steps.
[in]pLagTimeVariableThe index of the time variable used to calculate the dynamic lag This parameter must have the same length as pLags be null or empty if both pLagTimeVariable and pLagSpeedVariable is empty or a value <1 means that the variable is lagged by step and pLags is rounded to the closest integer value else it is dynamically lagged by this variable. The first element has index 1.
[in]pLagSpeedVariableThe index of the speed variable used to calculate the dynamic lag This parameter must have the same length as pLags be null or empty if it both pLagTimeVariable and pLagSpeedVariable a value <1 means that the variable is lagged by step and pLags is rounded to the closest integer value else it is dynamically lagged by this variable. The first element has index 1.
[in]eSQBlockThe block that the variable belongs to.
[out]pWorksetIndexWill contain the index in the workset of the variable on return. If the variable does not exist in the workset the index is set to -1.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetVariableWorksetName()

SQ_ErrorCode SQ_GetVariableWorksetName ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iIndex,
int  iID,
char *  szName,
int  iBufferLen 
)

Returns the name of a variable.

Parameters
[in]hWorksetA handle to the workset
[in]eBlockThe block (SQ_BlockX or SQ_BlockY).
[in]iIndexThe index of the variable. The first index is 1.
[in]iIDThe variable ID to use. Variables always has a primary ID (with index 1) but can have one or more secondary IDs also. You can use GetNrVarObsIDs to obtain the number of IDs.
[in,out]szNameWill contain the variable name on return, UTF-8 encoded.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetWorksetClasses()

SQ_ErrorCode SQ_GetWorksetClasses ( SQ_Workset  hWorkset,
SQ_IntVector piClasses 
)

Gets all classes in the workset which at least one observation belongs to.

Parameters
[in]hWorksetA handle to the workset.
[out]piClassesA vector containing the classes that at least one variable belongs to. The first element in the vector has index 0.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetWorksetClassName()

SQ_ErrorCode SQ_GetWorksetClassName ( SQ_Workset  hWorkset,
int  iClassNo,
char *  szName,
int  iBufferLen 
)

Gets class name in the workset.

Parameters
[in]hWorksetA handle to the workset.
[in]iClassNoThe class number to get the name, UTF-8 encoded.
[in,out]szNameWill contain the name on exit.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetWorksetDescription()

SQ_ErrorCode SQ_GetWorksetDescription ( SQ_Workset  hWorkset,
char *  szDescription,
int  iBufferLen 
)

Returns the description of the workset.

Parameters
[in]hWorksetA handle to the workset
[in,out]szDescriptionHolds the description of the workset on exit, UTF-8 encoded.
[in]iBufferLenThe length of szDescription buffer
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetWorksetObservationName()

SQ_ErrorCode SQ_GetWorksetObservationName ( SQ_Workset  hWorkset,
int  iWorksetIndex,
int  iID,
char *  szName,
int  iBufferLen 
)

Gets the name of an observation in the workset.

Parameters
[in]hWorksetA handle to the workset.
[in]iWorksetIndexThe index of the observation in the workset.
[in]iIDThe variable ID to use. Variables always has a primary ID (with index 1) but can have one or more secondary IDs also. you can use GetNrVarObsIDs to obtain the number of IDs.
[in,out]szNameThe name of the observation.
[in]iBufferLenLength of the in buffer to get the name.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetWorksetObservationSize()

SQ_ErrorCode SQ_GetWorksetObservationSize ( SQ_Workset  hWorkset,
int *  piSize 
)

Returns the number of observations in the workset.

Parameters
[in]hWorksetA handle to the workset.
[out]piSizeThe number of observations in the workset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_ReleaseWorkset()

SQ_ErrorCode SQ_ReleaseWorkset ( SQ_Workset  hWorkset)

Releases the workset (frees resources used by the workset). This function has to be called for each SQ_WorksetHandle obtained from SQ_GetNewWorkset(). The handle should not be used after this function has been called.

Parameters
[in]hWorksetThe workset that is to be released.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_RemoveObservation()

SQ_ErrorCode SQ_RemoveObservation ( SQ_Workset  hWorkset,
int  iWorksetIndex 
)

Removes an observation from the workset.

Parameters
[in]hWorksetA handle to the workset
[in]iWorksetIndexThe index of the observation in the workset. If iIndex = -1 all observations in the workset will be removed.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_RemoveVariable()

SQ_ErrorCode SQ_RemoveVariable ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetIndex 
)

Removes a variable from the workset.

Parameters
[in]hWorksetA handle to the workset
[in]eBlockThe block that the variable belongs to.
[in]iWorksetIndexThe index of the variable in the workset. If iIndex = -1 then all variables belonging to the given variable block will be removed.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetAutoTransformAll()

SQ_ErrorCode SQ_SetAutoTransformAll ( SQ_Workset  hWorkset,
SQ_Bool  bAutoTransformAllIfOneNeddsTransform 
)

Checks all variables and sets transformations for them as necessary. The function will remove any previously set transformations.

Parameters
[in]hWorksetA handle to the workset.
[out]bAutoTransformAllIfOneNeddsTransformIf equal to 0 only variables needing transformation is transformed otherwise all variables are transformed if at least one needs transformation.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetKeepLowVarianceVariables()

SQ_ErrorCode SQ_SetKeepLowVarianceVariables ( SQ_Workset  hWorkset,
SQ_Bool  bKeepVariables 
)

Decide if we should exclude variables with low variance.

Parameters
[in]hWorksetA handle to the workset.
[in]bKeepVariablesSQ_True to keep low variance variables, SQ_False to exclude them
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetMissingValueToleranceObs()

SQ_ErrorCode SQ_SetMissingValueToleranceObs ( SQ_Workset  hWorkset,
float  fFractionTolerated 
)

Sets the missing value tolerance for observations. Observations with more missing values than the limit will be excluded from the model when the model is created. The default value is the default for the project.

Parameters
[in]hWorksetA handle to the workset.
[in]fFractionToleratedThe tolerance as a fraction (must be between 0 and 1).
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetMissingValueToleranceVar()

SQ_ErrorCode SQ_SetMissingValueToleranceVar ( SQ_Workset  hWorkset,
float  fFractionTolerated 
)

Sets the missing value tolerance for variables. Variables with more missing values than the limit will be excluded from the model when the model is created. The default value is the default for the project.

Parameters
[in]hWorksetA handle to the workset.
[in]fFractionToleratedThe tolerance as a fraction (must be between 0 and 1).
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetObservationClass()

SQ_ErrorCode SQ_SetObservationClass ( SQ_Workset  hWorkset,
int  iWorksetObservationIndex,
int  iClassNo 
)

Sets the class that an observation belongs to.

Parameters
[in]hWorksetA handle to the workset.
[in]iWorksetObservationIndexThe index of the observation in the workset.
[in]iClassNoThe class that the observation should belong to. The class number must be larger than or equal to 0 with 0 meaning that the observation belongs to all classes.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetObservationClasses()

SQ_ErrorCode SQ_SetObservationClasses ( SQ_Workset  hWorkset,
SQ_IntVector pClasses 
)

Sets the class membership to the observations in the workset.

Parameters
[in]hWorksetA handle to the workset.
[in]pClassesA vector containing the class number for each observation. The vector needs to be the same size as the number of observations in the dataset or use NULL to remove the classes.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetScaling()

SQ_ErrorCode SQ_SetScaling ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetIndex,
SQ_WSScaleInfo pScaleInfo 
)

Sets the scaling for a variable. The default scaling (Unit variance, centered around the mean and no block scaling) is equivalent to: SQ_SetScaling(hWorkset, iVariableIndex, SQ_ScaleUnitVariance, 0, SQ_CenterAuto, 0, 1, SQ_BlockScaleNone, 0) note that the fScalingWeight, fCenter and iBlockScalingBlock parameters are ignored in this case.

Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iWorksetIndexThe index in the workset of the variable for which scaling is to be set.
[in]pScaleInfoThe scaling to use for this variable.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetTransform()

SQ_ErrorCode SQ_SetTransform ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetIndex,
SQ_WSTransformInfo pTransformInfo 
)

Sets the transform for a variable. Note that transforms can not be set for lagged and expanded variables.

Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iWorksetIndexThe index in the workset of the variable for which transformation is to be set.
[in]pTransformInfoThe transform to use for this variable.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetVariableClass()

SQ_ErrorCode SQ_SetVariableClass ( SQ_Workset  hWorkset,
SQ_VariableBlock  eBlock,
int  iWorksetIndex,
int  iClassNo 
)

Adds a class or clears the classes that a variable belongs to.

Parameters
[in]hWorksetA handle to the workset.
[in]eBlockThe block that the variable belongs to.
[in]iWorksetIndexThe index of the variable in the workset.
[in]iClassNoIf this parameter is larger than 0, that class will be added to the set of classes that the variable belongs to. If it is 0 the set of classes that the variable belongs to will be cleared (it will belong to all classes).
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetWorksetClassName()

SQ_ErrorCode SQ_SetWorksetClassName ( SQ_Workset  hWorkset,
int  iClassNo,
const char *  szName 
)

Sets class name in the workset.

Parameters
[in]hWorksetA handle to the workset.
[in]iClassNoThe class number to set the name.
[in]szNameThe name of the class, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetWorksetDescription()

SQ_ErrorCode SQ_SetWorksetDescription ( SQ_Workset  hWorkset,
const char *  szDescription 
)

Sets the description of the workset. The description is usually a longer string that the name. The default is 'Untitled'.

Parameters
[in]hWorksetA handle to the workset.
[in]szDescriptionThe description of the workset, UTF-8 encoded, or NULL to use the default description
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_UpdateModel()

SQ_ErrorCode SQ_UpdateModel ( SQ_Workset  hWorkset)

Updates the model, the model becomes unfitted. You can only use a handle retrieved from SQ_GetWorksetCopy, (not SQ_GetNewWorkset).

Parameters
[in]hWorksetA handle to the workset.
Returns
Returns SQ_E_OK if success or an error code

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