Functions
SQMModel.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQModel.h"
#include "SQComponentVector.h"
#include "SQMWorkset.h"

Go to the source code of this file.

Functions

SQ_ErrorCode SQ_GetWorksetCopy (SQ_Model pModel, SQ_Workset *pWorksetHandle)
 
SQ_ErrorCode SQ_AutofitModel (SQ_Model pModel)
 
SQ_ErrorCode SQ_AutofitClassModels (SQ_Model pModel, SQ_IntVector hClasses, SQ_ComponentVector hComponents)
 
SQ_ErrorCode SQ_SetCenterOfScores (SQ_Model pModel, float fCenterOfScores)
 
SQ_ErrorCode SQ_GetCenterOfScores (SQ_Model pModel, float *pfCenterOfScores)
 
SQ_ErrorCode SQ_SetModelTitle (SQ_Model pModel, const char *szModelTitle)
 
SQ_ErrorCode SQ_SetModelConfidenceLevel (SQ_Model pModel, float fLevel)
 
SQ_ErrorCode SQ_SetModelSignificanceLevel (SQ_Model pModel, float fLevel)
 
SQ_ErrorCode SQ_DeleteModel (SQ_Model pModel)
 
SQ_ErrorCode SQ_CalculateNextComponent (SQ_Model pModel)
 
SQ_ErrorCode SQ_CalculateOPLSComponents (SQ_Model pModel, SQ_ComponentVector oComponents)
 
SQ_ErrorCode SQ_RemoveComponent (SQ_Model pModel)
 
SQ_ErrorCode SQ_SetCVGroupAsEveryNthObservation (SQ_Model pModel, int iCVGroupsNumber)
 
SQ_ErrorCode SQ_SetCVGroupObservationBasedOnScores (SQ_Model pModel, int iCVGroupsNumber, int iScoresFromModel, SQ_CVGroupBy eCVGroupBy)
 
SQ_ErrorCode SQ_SetCVGroupObservationBasedOnVariable (SQ_Model pModel, int iCVGroupsNumber, int iDSIndex, int iVarIndex, SQ_CVGroupBy eCVGroupBy)
 
SQ_ErrorCode SQ_SetCVGroupObservationBasedOnObservationID (SQ_Model pModel, int iCVGroupsNumber, int iVarID, SQ_CVGroupBy eCVGroupBy)
 
SQ_ErrorCode SQ_SetHierarchicalBaseModel (SQ_Model pModel, SQ_Hierarchical eIncludeVar)
 
SQ_ErrorCode SQ_SetNonHierarchicalBaseModel (SQ_Model pModel)
 
SQ_ErrorCode SQ_ChangeModelType (SQ_Model pModel, SQ_ModelType eType, int iClassNo)
 

Function Documentation

◆ SQ_AutofitClassModels()

SQ_ErrorCode SQ_AutofitClassModels ( SQ_Model  pModel,
SQ_IntVector  hClasses,
SQ_ComponentVector  hComponents 
)

Autofit class models.

Parameters
[in]pModelThe model handle to use
[in]hClassesArray of classes to use
[in]hComponentsArray of number of components for each class. If number of components for a class is set to -1 autofit will be made.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_AutofitModel()

SQ_ErrorCode SQ_AutofitModel ( SQ_Model  pModel)

Autofit model.

Parameters
[in]pModelThe model handle to use
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_CalculateNextComponent()

SQ_ErrorCode SQ_CalculateNextComponent ( SQ_Model  pModel)

Calculate the next component. This can not be called for OPLS/O2PLS models.

Parameters
[in]pModelThe model handle to use
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_CalculateOPLSComponents()

SQ_ErrorCode SQ_CalculateOPLSComponents ( SQ_Model  pModel,
SQ_ComponentVector  oComponents 
)

Calculate component. This should be used for OPLS/O2PLS models.

Parameters
[in]pModelThe model handle to use
[in]oComponentsA component vector of at least size 1 with the number of components for each type oComponents[]={ Predictive components, X-Side orthogonal components, Y-Side orthogonal components, X-Side PCA components, for extended O2PLS models Y-Side PCA components}, for extended O2PLS models
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_ChangeModelType()

SQ_ErrorCode SQ_ChangeModelType ( SQ_Model  pModel,
SQ_ModelType  eType,
int  iClassNo 
)

Change model type. The function fails if the model is fitted.

Parameters
[in]pModelThe model handle to use
[in]eTypeThe new model type.
[in]iClassNoThe class number to set, for PCA_Class and PLS_Class.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_DeleteModel()

SQ_ErrorCode SQ_DeleteModel ( SQ_Model  pModel)

Delete a model.

Parameters
[in]pModelThe model handle to use
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetCenterOfScores()

SQ_ErrorCode SQ_GetCenterOfScores ( SQ_Model  pModel,
float *  pfCenterOfScores 
)

Gets the center value of T used when calculating T2Range.

Parameters
[in]pModelThe model handle to use
[out]pfCenterOfScoresThe currently used center value.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetWorksetCopy()

SQ_ErrorCode SQ_GetWorksetCopy ( SQ_Model  pModel,
SQ_Workset pWorksetHandle 
)

Create a new workset as a copy of the workset used in an existing model. The workset can be manipulated with the functions in SQMWorkset.h Note that no new model is created in the project until SQ_CreateModel or SQ_UpdateModel is called. The returned workset handle must be released with SQ_ReleaseWorkset

See also
SQMWorksetCInterface.h
Parameters
[in]pModelThe model handle to use
[out]pWorksetHandleThe handle to the new workset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_RemoveComponent()

SQ_ErrorCode SQ_RemoveComponent ( SQ_Model  pModel)

Remove a component. This can not be called for OPLS/O2PLS models.

Parameters
[in]pModelThe model handle to use
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetCenterOfScores()

SQ_ErrorCode SQ_SetCenterOfScores ( SQ_Model  pModel,
float  fCenterOfScores 
)

Sets the center value of T used when calculating T2Range. Set it to -99 to use the arithmetic mean.

Parameters
[in]pModelThe model handle to use
[in]fCenterOfScoresThe center value to use.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetCVGroupAsEveryNthObservation()

SQ_ErrorCode SQ_SetCVGroupAsEveryNthObservation ( SQ_Model  pModel,
int  iCVGroupsNumber 
)

Change the cross validation groups. Select every Nth observation where N is the number of cross validation groups. The function fails if the model is fitted.

Parameters
[in]pModelThe model handle to use
[in]iCVGroupsNumberThe number of cross validation groups.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetCVGroupObservationBasedOnObservationID()

SQ_ErrorCode SQ_SetCVGroupObservationBasedOnObservationID ( SQ_Model  pModel,
int  iCVGroupsNumber,
int  iVarID,
SQ_CVGroupBy  eCVGroupBy 
)

Change the cross validation groups by selecting a secondary variable ID. The function fails if the model is fitted.

Parameters
[in]pModelThe model handle to use
[in]iCVGroupsNumberThe number of cross validation groups.
[in]iVarIDThe index of the Variable ID that will be used to identify the variables in the project. The variable names in the selected variable ID must be unique or the initialization will fail.
[in]eCVGroupByThe strategy for dividing the observations into groups.
See also
SQ_CVGroupBy
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetCVGroupObservationBasedOnScores()

SQ_ErrorCode SQ_SetCVGroupObservationBasedOnScores ( SQ_Model  pModel,
int  iCVGroupsNumber,
int  iScoresFromModel,
SQ_CVGroupBy  eCVGroupBy 
)

Change the cross validation groups. Assign observation based on the scores from an existing model. The function fails if the model is fitted.

Parameters
[in]pModelThe model handle to use
[in]iCVGroupsNumberThe number of cross validation groups.
[in]iScoresFromModelThe model to use the scores from. This model must be fitted.
[in]eCVGroupByThe strategy for dividing the observations into groups.
See also
SQ_CVGroupBy
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetCVGroupObservationBasedOnVariable()

SQ_ErrorCode SQ_SetCVGroupObservationBasedOnVariable ( SQ_Model  pModel,
int  iCVGroupsNumber,
int  iDSIndex,
int  iVarIndex,
SQ_CVGroupBy  eCVGroupBy 
)

Change the cross validation groups by selecting a variable from a dataset. The function fails if the model is fitted.

Parameters
[in]pModelThe model handle to use
[in]iCVGroupsNumberThe number of cross validation groups.
[in]iDSIndexThe index of the dataset.
[in]iVarIndexThe index of the variable in the dataset.
[in]eCVGroupByThe strategy for dividing the observations into groups.
See also
SQ_CVGroupBy
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetHierarchicalBaseModel()

SQ_ErrorCode SQ_SetHierarchicalBaseModel ( SQ_Model  pModel,
SQ_Hierarchical  eIncludeVar 
)

Sets a fitted model as a hierarchical base model.

Parameters
[in]pModelThe model handle to use
[in]eIncludeVarDefines what variables should be added to the new worksets.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetModelConfidenceLevel()

SQ_ErrorCode SQ_SetModelConfidenceLevel ( SQ_Model  pModel,
float  fLevel 
)

Set the default model confidence level.

Parameters
[in]pModelThe model handle to use
[in]fLevelThe confidence level. 0.95 means 95% confidence level.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetModelSignificanceLevel()

SQ_ErrorCode SQ_SetModelSignificanceLevel ( SQ_Model  pModel,
float  fLevel 
)

Set the default model significance level for DModX and Hotelling's T2.

Parameters
[in]pModelThe model handle to use
[in]fLevelThe significance level. 0.05 means 95% probability level.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetModelTitle()

SQ_ErrorCode SQ_SetModelTitle ( SQ_Model  pModel,
const char *  szModelTitle 
)

Set the model title.

Parameters
[in]pModelThe model handle to use
[in]szModelTitleThe new model title, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetNonHierarchicalBaseModel()

SQ_ErrorCode SQ_SetNonHierarchicalBaseModel ( SQ_Model  pModel)

Remove the hierarchical base model flag on an hierarchical base model. Note: If there exists top level models with variables from the given model, these models will be deleted.

Parameters
[in]pModelThe model handle to use
Returns
Returns SQ_E_OK if success or an error code

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