Framework Class Reference

#include <Framework.h>

Inheritance diagram for Framework:

Algorithm AlgorithmExploration AUC Autoencoder AutomaticParameterTuner BlendingNN BlendStopping Data DatasetReader GBDT InputFeatureSelector KernelRidgeRegression KNearestNeighbor LinearModel LinearModelNonNeg LogisticRegression NeuralNetwork NeuralNetworkRBMauto NN NNRBM NumericalTools PolynomialRegression Scheduler StandardAlgorithm

List of all members.

Public Member Functions

 Framework ()
 ~Framework ()

Static Public Member Functions

static void setDatasetType (bool isClassification)
static bool getDatasetType ()
static void setMaxThreads (int n)
static int getMaxThreads ()
static void setRandomSeed (int n)
static int getRandomSeed ()
static void setFrameworkMode (int mode)
static int getFrameworkMode ()
static void setAdditionalStartupParameter (char *s)
static int getAdditionalStartupParameter ()
static uint convertDateToInt (uint day, uint month, uint year, uint hour, uint minute, uint second)
static void convertIntToDate (uint date, uint &day, uint &month, uint &year, uint &hour, uint &minute, uint &second, uint &weekday)

Static Private Attributes

static bool m_isClassificationDataset
static int m_maxThreads
static int m_randomSeed
static int m_frameworkMode
static int m_additionalStartupParameter


Detailed Description

Basic class for the framework, all classes are derived from this class Currently this class has the information of the dataset type as a static member and other infos like random seed

The global status vars can be accessed from everywhere by static methods

Definition at line 22 of file Framework.h.


Constructor & Destructor Documentation

Framework::Framework (  ) 

Constructor

Definition at line 14 of file Framework.cpp.

00015 {
00016     //cout<<"Framework"<<endl;
00017 }

Framework::~Framework (  ) 

Constructor

Definition at line 22 of file Framework.cpp.

00023 {
00024     //cout<<"descructor Framework"<<endl;
00025 }


Member Function Documentation

uint Framework::convertDateToInt ( uint  day,
uint  month,
uint  year,
uint  hour,
uint  minute,
uint  second 
) [static]

Convert a date to a unix time_t stamp

Parameters:
day The day: 1..31
month The month: 1..12
year The year
hour The hour: 0..23
minute The minute: 0..59
second The second: 0..59
Returns:
Unix time stamp time_t

Definition at line 147 of file Framework.cpp.

00148 {
00149     struct tm t;
00150     t.tm_year = year - 1900;
00151     t.tm_mon = month - 1;
00152     t.tm_mday = day;
00153     t.tm_hour = hour;
00154     t.tm_min = minute;
00155     t.tm_sec = second;
00156     t.tm_isdst = 0;
00157     time_t tt = mktime(&t);
00158     
00159     time_t secondsFromNow = time(0);
00160     tm* t0 = gmtime(&secondsFromNow);
00161     
00162     if(t0->tm_isdst == 0)
00163         tt += 3600;
00164     
00165     return tt;
00166 }

void Framework::convertIntToDate ( uint  date,
uint &  day,
uint &  month,
uint &  year,
uint &  hour,
uint &  minute,
uint &  second,
uint &  weekday 
) [static]

Convert the unix time stamp back to individual values.

Parameters:
date Input: unix time stamp
day Reference value, return parameter
month Reference value, return parameter
year Reference value, return parameter
hour Reference value, return parameter
minute Reference value, return parameter
second Reference value, return parameter

Definition at line 179 of file Framework.cpp.

00180 {
00181     time_t seconds = date;
00182     struct tm t = *gmtime(&seconds);
00183     day = t.tm_mday;
00184     month = t.tm_mon + 1;
00185     year = t.tm_year + 1900;
00186     hour = t.tm_hour;
00187     minute = t.tm_min;
00188     second = t.tm_sec;
00189     weekday = t.tm_wday; // 0..6  days since Sunday
00190 }

int Framework::getAdditionalStartupParameter (  )  [static]

Return additional run parameter on startup

Returns:
Random Seed

Definition at line 131 of file Framework.cpp.

00132 {
00133     return m_additionalStartupParameter;
00134 }

bool Framework::getDatasetType (  )  [static]

Returns the stored type

Returns:
The dataset type (bool)

Definition at line 43 of file Framework.cpp.

00044 {
00045     return m_isClassificationDataset;
00046 }

int Framework::getFrameworkMode (  )  [static]

Return Framework mode

Returns:
the mode: train(0), predict(1), blend(2)

Definition at line 108 of file Framework.cpp.

00109 {
00110     return m_frameworkMode;
00111 }

int Framework::getMaxThreads (  )  [static]

Return max threads

Returns:
Max. threads

Definition at line 65 of file Framework.cpp.

00066 {
00067     return m_maxThreads;
00068 }

int Framework::getRandomSeed (  )  [static]

Return random seed

Returns:
Random Seed

Definition at line 86 of file Framework.cpp.

00087 {
00088     return m_randomSeed;
00089 }

void Framework::setAdditionalStartupParameter ( char *  s  )  [static]

Set additional run parameter on startup

Parameters:
s Random Seed

Definition at line 118 of file Framework.cpp.

00119 {
00120     int n = -1;
00121     sscanf ( s,"%d",&n );
00122     m_additionalStartupParameter = n;
00123     cout<<"additionalStartupParameter: "<<m_additionalStartupParameter<<endl;
00124 }

void Framework::setDatasetType ( bool  isClassification  )  [static]

Set the dataset type

Parameters:
isClassification True: the dataset is a classification dataset

Definition at line 32 of file Framework.cpp.

00033 {
00034     m_isClassificationDataset = isClassification;
00035     cout<<"isClassificationDataset: "<<m_isClassificationDataset<<endl;
00036 }

void Framework::setFrameworkMode ( int  mode  )  [static]

Set Framework mode train(0), predict(1), blend(2)

Parameters:
mode The mode

Definition at line 97 of file Framework.cpp.

00098 {
00099     m_frameworkMode = mode;
00100     cout<<"frameworkMode: "<<m_frameworkMode<<endl;
00101 }

void Framework::setMaxThreads ( int  n  )  [static]

Set max threads

Parameters:
n Max. threads for OPENMP

Definition at line 53 of file Framework.cpp.

00054 {
00055     m_maxThreads = n;
00056     omp_set_num_threads ( m_maxThreads );  // set this value for OPENMP pragmas
00057     cout<<"maxThreads(OPENMP): "<<m_maxThreads<<endl;
00058 }

void Framework::setRandomSeed ( int  s  )  [static]

Set random seed

Parameters:
s Random Seed

Definition at line 75 of file Framework.cpp.

00076 {
00077     m_randomSeed = s;
00078     cout<<"randomSeed: "<<m_randomSeed<<endl;
00079 }


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

Generated on Tue Jan 26 09:21:06 2010 for ELF by  doxygen 1.5.8