|
STK++ 1.0
|
@ More...
#include <STK_AAModelFactory.h>

Public Member Functions | |
| AAModelFactory (Matrix const *p_data) | |
| Constructor. | |
| virtual | ~AAModelFactory () |
| virtual destuctor. | |
| bool | isCentered () const |
| is the data set centered ? | |
| bool | isStandardized () const |
| is the data set standardized ? | |
| Point const & | mean () const |
| get the mean of the data set | |
| Point const & | std () const |
| get the standard deviation of the data set | |
| virtual bool | run (Integer const &dim) |
| run the estimation of the AA model. | |
| virtual bool | run (Vector const &weights, Integer const &dim) |
| run the estimation of the weighted AA model. | |
| void | center () |
| center the data set. | |
| void | center (Vector const &weights) |
| weighted centering of the data set. | |
| void | standardize () |
| standardize the data set. | |
| void | standardize (Vector const &weights) |
| weighted standardization the data set. | |
Protected Attributes | |
| Point | mean_ |
| vector of the means | |
| Point | std_ |
| vector of the standard deviation | |
| bool | isCentered_ |
a boolean true if the data set is centered, false otherwise | |
| bool | isStandardized_ |
a boolean true if the data set is standardized, false otherwise | |
@
Utility class for the AutoAssociative models.
The AAModel factory allow to center and to standradize the data set before the computation of the model. The results are then restablished after estimation.
Definition at line 51 of file STK_AAModelFactory.h.
| STK::AAModelFactory::AAModelFactory | ( | Matrix const * | p_data | ) |
Constructor.
| p_data | a pointer on the data set to process |
Definition at line 50 of file STK_AAModelFactory.cpp.
: IAAModel(p_data) , mean_() , std_() , isCentered_(false) , isStandardized_(false) { }
| STK::AAModelFactory::~AAModelFactory | ( | ) | [virtual] |
| bool STK::AAModelFactory::isCentered | ( | ) | const [inline] |
is the data set centered ?
true if the data set is centered, false otherwise Definition at line 65 of file STK_AAModelFactory.h.
References isCentered_.
{ return isCentered_;}
| bool STK::AAModelFactory::isStandardized | ( | ) | const [inline] |
is the data set standardized ?
true if the data set is standardized, false otherwise Definition at line 69 of file STK_AAModelFactory.h.
References isStandardized_.
{ return isStandardized_;}
| Point const& STK::AAModelFactory::mean | ( | ) | const [inline] |
get the mean of the data set
Definition at line 74 of file STK_AAModelFactory.h.
References mean_.
{ return mean_;}
| Point const& STK::AAModelFactory::std | ( | ) | const [inline] |
get the standard deviation of the data set
Definition at line 78 of file STK_AAModelFactory.h.
References std_.
{ return std_;}
| bool STK::AAModelFactory::run | ( | Integer const & | dim | ) | [virtual] |
run the estimation of the AA model.
The behavior of the estimation is the following :
| dim | the dimension of the AA Model |
Reimplemented from STK::IAAModel.
Definition at line 64 of file STK_AAModelFactory.cpp.
References STK::Stat::decenter(), STK::Stat::destandardize(), STK::IRunnerBase::error(), isCentered_, isStandardized_, mean_, STK::IRunnerBase::msg_error_, STK::IAAModel::p_reduced_, STK::IAAModel::p_reductor_, STK::IAAModel::p_workData_, STK::IAAModel::run(), STK::IReduct::setData(), and std_.
{
// set data to reductor
p_reductor_->setData(p_workData_);
// compute AAM
if (!IAAModel::run(dim))
{
return false;
}
try
{
// check if data have been standardized or centered
if (isStandardized_) Stat::destandardize(*p_reduced_, mean_, std_);
else
if (isCentered_) Stat::decenter(*p_reduced_, mean_);
}
catch (std::exception error)
{
msg_error_ = error.what();
return false;
}
return true;
}
run the estimation of the weighted AA model.
The behavior of the estimation is the following :
| dim | the dimension of the AA Model |
| p_weights | the container of the weights |
Reimplemented from STK::IAAModel.
Definition at line 90 of file STK_AAModelFactory.cpp.
References STK::Stat::decenter(), STK::Stat::destandardize(), STK::IRunnerBase::error(), isCentered_, isStandardized_, mean_, STK::IRunnerBase::msg_error_, STK::IAAModel::p_reduced_, STK::IAAModel::p_reductor_, STK::IAAModel::p_workData_, STK::IAAModel::run(), STK::IReduct::setData(), and std_.
{
// set data to reductor
p_reductor_->setData(p_workData_);
// compute AAM
if (!IAAModel::run(weights, dim)) { return false;}
try
{
// check if data have been standardized or centered
if (isStandardized_) Stat::destandardize(*p_reduced_, mean_, std_);
else
if (isCentered_) Stat::decenter(*p_reduced_, mean_);
}
catch (std::exception error)
{
msg_error_ = error.what();
return false;
}
return true;
}
| void STK::AAModelFactory::center | ( | ) |
center the data set.
Definition at line 112 of file STK_AAModelFactory.cpp.
References STK::Stat::decenter(), isCentered_, mean_, and STK::IAAModel::p_workData_.
Referenced by center().
{
if (isCentered_)
{
Stat::decenter(*p_workData_, mean_);
isCentered_ = false;
}
Stat::center(*p_workData_, mean_);
isCentered_ = true;
}
| void STK::AAModelFactory::center | ( | Vector const & | weights | ) |
weighted centering of the data set.
| the | weights of the samples |
Definition at line 136 of file STK_AAModelFactory.cpp.
References center(), STK::Stat::decenter(), isCentered_, mean_, and STK::IAAModel::p_workData_.
{
if (isCentered_)
{
Stat::decenter(*p_workData_, mean_);
isCentered_ = false;
}
Stat::center(*p_workData_, weights, mean_);
isCentered_ = true;
}
| void STK::AAModelFactory::standardize | ( | ) |
standardize the data set.
Definition at line 124 of file STK_AAModelFactory.cpp.
References STK::Stat::destandardize(), isStandardized_, mean_, STK::IAAModel::p_workData_, and std_.
Referenced by standardize().
{
if (isStandardized_)
{
Stat::destandardize(*p_workData_, mean_, std_);
isStandardized_ = false;
}
Stat::standardize(*p_workData_, mean_, std_);
isStandardized_ = true;
}
| void STK::AAModelFactory::standardize | ( | Vector const & | weights | ) |
weighted standardization the data set.
| the | weights of the samples |
Definition at line 148 of file STK_AAModelFactory.cpp.
References STK::Stat::destandardize(), isStandardized_, mean_, STK::IAAModel::p_workData_, standardize(), and std_.
{
if (isStandardized_)
{
Stat::destandardize(*p_workData_, mean_, std_);
isStandardized_ = false;
}
Stat::standardize(*p_workData_, weights, mean_, std_);
isStandardized_ = true;
}
Point STK::AAModelFactory::mean_ [protected] |
vector of the means
Definition at line 120 of file STK_AAModelFactory.h.
Referenced by center(), mean(), run(), and standardize().
Point STK::AAModelFactory::std_ [protected] |
vector of the standard deviation
Definition at line 122 of file STK_AAModelFactory.h.
Referenced by run(), standardize(), and std().
bool STK::AAModelFactory::isCentered_ [protected] |
a boolean true if the data set is centered, false otherwise
Definition at line 124 of file STK_AAModelFactory.h.
Referenced by center(), isCentered(), and run().
bool STK::AAModelFactory::isStandardized_ [protected] |
a boolean true if the data set is standardized, false otherwise
Definition at line 126 of file STK_AAModelFactory.h.
Referenced by isStandardized(), run(), and standardize().