STK++ 0.9.13
STK::IRunnerUnsupervised< Array, Weights_ > Class Template Referenceabstract

Abstract class for all classes making unsupervised learning. More...

#include <STK_IRunner.h>

Inheritance diagram for STK::IRunnerUnsupervised< Array, Weights_ >:
Inheritance graph

Public Member Functions

Array constp_data () const
 get the data set
 
virtual void setData (Array const *p_data)
 Set the data set.
 
virtual void setData (Array const &data)
 Set the data set.
 
virtual bool run ()=0
 run the computations.
 
virtual bool run (Weights_ const &weights)=0
 run the weighted computations.
 
- Public Member Functions inherited from STK::IRunnerBase
String consterror () const
 get the last error message.
 

Protected Member Functions

 IRunnerUnsupervised ()
 default constructor.
 
 IRunnerUnsupervised (Array const *const p_data)
 constructor with a pointer on the constant data set
 
 IRunnerUnsupervised (Array const &data)
 constructor with a constant reference on the data set
 
 IRunnerUnsupervised (IRunnerUnsupervised const &runner)
 copy constructor
 
 ~IRunnerUnsupervised ()
 destructor
 
- Protected Member Functions inherited from STK::IRunnerBase
 IRunnerBase ()
 default constructor
 
 IRunnerBase (IRunnerBase const &runner)
 copy constructor
 
virtual ~IRunnerBase ()
 destructor
 
virtual void update ()
 update the runner.
 

Protected Attributes

Array constp_data_
 A pointer on the original data set.
 
- Protected Attributes inherited from STK::IRunnerBase
String msg_error_
 String with the last error message.
 
bool hasRun_
 true if run has been used, false otherwise
 

Detailed Description

template<class Array, class Weights_>
class STK::IRunnerUnsupervised< Array, Weights_ >

Abstract class for all classes making unsupervised learning.

This Interface is designed for unsupervised learning purpose. In a supervised learning setting, use IRunnerSupervised. The data set to process is not copied and a ptr on the data set is stored internally.

The pure virtual methods to implement are

bool run();
bool run(weights);
virtual bool run()=0
run the computations.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...

Definition at line 189 of file STK_IRunner.h.

Constructor & Destructor Documentation

◆ IRunnerUnsupervised() [1/4]

template<class Array , class Weights_ >
STK::IRunnerUnsupervised< Array, Weights_ >::IRunnerUnsupervised ( )
inlineprotected

default constructor.

Definition at line 193 of file STK_IRunner.h.

193: p_data_(0) {}
Array const * p_data_
A pointer on the original data set.

◆ IRunnerUnsupervised() [2/4]

template<class Array , class Weights_ >
STK::IRunnerUnsupervised< Array, Weights_ >::IRunnerUnsupervised ( Array const *const  p_data)
inlineprotected

constructor with a pointer on the constant data set

Parameters
p_datapointer on the data set to run

Definition at line 197 of file STK_IRunner.h.

197: p_data_(p_data) {}
Array const * p_data() const
get the data set

◆ IRunnerUnsupervised() [3/4]

template<class Array , class Weights_ >
STK::IRunnerUnsupervised< Array, Weights_ >::IRunnerUnsupervised ( Array const data)
inlineprotected

constructor with a constant reference on the data set

Parameters
datadata set to run

Definition at line 201 of file STK_IRunner.h.

201: p_data_(&data) {}

◆ IRunnerUnsupervised() [4/4]

template<class Array , class Weights_ >
STK::IRunnerUnsupervised< Array, Weights_ >::IRunnerUnsupervised ( IRunnerUnsupervised< Array, Weights_ > const runner)
inlineprotected

copy constructor

Parameters
runnerthe runner to copy

Definition at line 205 of file STK_IRunner.h.

206 : IRunnerBase(runner)
207 , p_data_(runner.p_data_)
208 {}
IRunnerBase()
default constructor
Definition STK_IRunner.h:68

◆ ~IRunnerUnsupervised()

template<class Array , class Weights_ >
STK::IRunnerUnsupervised< Array, Weights_ >::~IRunnerUnsupervised ( )
inlineprotected

destructor

Definition at line 210 of file STK_IRunner.h.

210{}

Member Function Documentation

◆ p_data()

template<class Array , class Weights_ >
Array const * STK::IRunnerUnsupervised< Array, Weights_ >::p_data ( ) const
inline

◆ run() [1/2]

◆ run() [2/2]

template<class Array , class Weights_ >
virtual bool STK::IRunnerUnsupervised< Array, Weights_ >::run ( Weights_ const weights)
pure virtual

run the weighted computations.

Parameters
weightsthe weights of the samples
Returns
true if no error occur during the running process, false otherwise

Implemented in STK::LinearAAModel< Array >, STK::ILinearReduct< Array, VectorX >, STK::Stat::Multivariate< Array, WColVector, Type >, STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >, and STK::ILinearReduct< Array, Weights >.

◆ setData() [1/2]

template<class Array , class Weights_ >
virtual void STK::IRunnerUnsupervised< Array, Weights_ >::setData ( Array const data)
inlinevirtual

Set the data set.

If the state of the derived runner change when a new data set is set the user have to overload the udpate() method.

Parameters
dataThe data set to run

Definition at line 230 of file STK_IRunner.h.

231 {
232 p_data_ = &data;
233 update();
234 this->hasRun_ = false;
235 }
virtual void update()
update the runner.
Definition STK_IRunner.h:94
bool hasRun_
true if run has been used, false otherwise
Definition STK_IRunner.h:98

References STK::IRunnerBase::hasRun_, STK::IRunnerUnsupervised< Array, Weights_ >::p_data_, and STK::IRunnerBase::update().

◆ setData() [2/2]

template<class Array , class Weights_ >
virtual void STK::IRunnerUnsupervised< Array, Weights_ >::setData ( Array const p_data)
inlinevirtual

Set the data set.

If the state of the derived runner change when a new data set is set the user have to overload the udpate() method.

Parameters
p_dataA pointer on the data set to run

Definition at line 221 of file STK_IRunner.h.

222 {
223 p_data_ = p_data;
224 update();
225 }

References STK::IRunnerUnsupervised< Array, Weights_ >::p_data(), STK::IRunnerUnsupervised< Array, Weights_ >::p_data_, and STK::IRunnerBase::update().

Member Data Documentation

◆ p_data_


The documentation for this class was generated from the following file: