Loading...
Searching...
No Matches
registry.h
Go to the documentation of this file.
#ifndef BALL_QSAR_REGISTRY_H
#define BALL_QSAR_REGISTRY_H
#ifndef MODEL_FACTORY_H
#include <BALL/QSAR/modelFactory.h>
#endif
#include <map>
#ifdef BALL_HAS_LIBSVM
# include <BALL/QSAR/libsvmModel.h>
#endif
namespace BALL
{
namespace QSAR
{
class QSARData;
typedef Model* (*CreateMethod) (const QSARData& q);
typedef Model* (*CreateKernel1) (const QSARData& q, int k, double p1, double p2);
typedef Model* (*CreateKernel2) (const QSARData& q, String s1, String s2);
class Registry;
class BALL_EXPORT RegistryEntry
{
public:
RegistryEntry(bool k, bool r, String n, String ab, CreateMethod c0);
RegistryEntry(bool k, bool r, String n, String ab, CreateKernel1 c1, CreateKernel2 c2);
RegistryEntry(const RegistryEntry& entry);
~RegistryEntry();
const std::map<unsigned int,String>* getStatistics();
String getStatName(int s);
bool kernel;
bool regression; // regression or classification?!
bool latent_variables; // is this a latent variable model?!
std::multiset<int> optimizableParameters;
//bool optimizable;
String name; // name of the Model
String name_abreviation;
CreateMethod create;
CreateKernel1 createKernel1;
CreateKernel2 createKernel2;
vector<String> parameterNames;
vector<double> parameterDefaults;
Registry* getRegistry();
private:
Registry* registry_;
friend class Registry;
};
typedef std::map<int,RegistryEntry>::iterator RegistryEntryIterator;
class BALL_EXPORT Registry
{
public:
Registry();
~Registry();
double default_kernel_par1;
double default_kernel_par2;
double default_rbf_par;
int default_k;
int default_no_permutations;
int default_no_boostrap_samples;
double default_valdition_fraction;
int default_nested_folds;
double default_correlation_cutoff;
double default_gridsearch_stepwidth;
int default_gridsearch_recursion;
int default_gridsearch_steps;
double default_gridsearch_par1_start;
double default_gridsearch_par2_start;
void addEntry(RegistryEntry entry, int uniqueID);
RegistryEntry* getEntry(String model_name);
RegistryEntry* getEntry(int ID);
int getModelNo(String model_name);
String getClassificationStatisticName(unsigned int no);
String getRegressionStatisticName(unsigned int no);
String getFeatureSelectionName(unsigned int no);
String getValidationName(unsigned int no);
const std::map<unsigned int,String>* getClassificationStatistics();
const std::map<unsigned int,String>* getRegressionStatistics();
RegistryEntryIterator beginEntry();
RegistryEntryIterator endEntry();
private:
std::map<int,RegistryEntry> registered_models;
std::map<String,int> model_map;
std::map<unsigned int,String> classification_statistics;
std::map<unsigned int,String> regression_statistics;
std::map<unsigned int,String> feature_selection_names;
std::map<unsigned int,String> validation_names;
friend class RegistryEntry;
};
}
}
#endif // BALL_QSAR_REGISTRY_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::QSAR::Model
Definition Model.h:35
BALL::QSAR::QSARData
Definition QSARData.h:56
BALL::QSAR::RegistryEntry::parameterDefaults
vector< double > parameterDefaults
Definition registry.h:60
BALL::QSAR::RegistryEntry::latent_variables
bool latent_variables
Definition registry.h:51
BALL::QSAR::RegistryEntry::RegistryEntry
RegistryEntry(bool k, bool r, String n, String ab, CreateMethod c0)
BALL::QSAR::RegistryEntry::parameterNames
vector< String > parameterNames
Definition registry.h:59
BALL::QSAR::RegistryEntry::getStatistics
const std::map< unsigned int, String > * getStatistics()
BALL::QSAR::RegistryEntry::~RegistryEntry
~RegistryEntry()
BALL::QSAR::RegistryEntry::optimizableParameters
std::multiset< int > optimizableParameters
Definition registry.h:52
BALL::QSAR::RegistryEntry::name_abreviation
String name_abreviation
Definition registry.h:55
BALL::QSAR::RegistryEntry::getRegistry
Registry * getRegistry()
BALL::QSAR::RegistryEntry::create
CreateMethod create
Definition registry.h:56
BALL::QSAR::RegistryEntry::RegistryEntry
RegistryEntry(bool k, bool r, String n, String ab, CreateKernel1 c1, CreateKernel2 c2)
BALL::QSAR::RegistryEntry::name
String name
Definition registry.h:54
BALL::QSAR::RegistryEntry::createKernel1
CreateKernel1 createKernel1
Definition registry.h:57
BALL::QSAR::RegistryEntry::RegistryEntry
RegistryEntry(const RegistryEntry &entry)
BALL::QSAR::RegistryEntry::regression
bool regression
Definition registry.h:50
BALL::QSAR::RegistryEntry::Registry
friend class Registry
Definition registry.h:66
BALL::QSAR::RegistryEntry::createKernel2
CreateKernel2 createKernel2
Definition registry.h:58
BALL::QSAR::RegistryEntry::kernel
bool kernel
Definition registry.h:49
BALL::QSAR::RegistryEntry::getStatName
String getStatName(int s)
BALL::QSAR::Registry
Definition registry.h:73
BALL::QSAR::Registry::default_kernel_par1
double default_kernel_par1
Definition registry.h:80
BALL::QSAR::Registry::default_gridsearch_stepwidth
double default_gridsearch_stepwidth
Definition registry.h:106
BALL::QSAR::Registry::default_rbf_par
double default_rbf_par
Definition registry.h:86
BALL::QSAR::Registry::beginEntry
RegistryEntryIterator beginEntry()
BALL::QSAR::Registry::default_correlation_cutoff
double default_correlation_cutoff
Definition registry.h:104
BALL::QSAR::Registry::default_k
int default_k
Definition registry.h:89
BALL::QSAR::Registry::getModelNo
int getModelNo(String model_name)
BALL::QSAR::Registry::getClassificationStatisticName
String getClassificationStatisticName(unsigned int no)
BALL::QSAR::Registry::getEntry
RegistryEntry * getEntry(String model_name)
BALL::QSAR::Registry::endEntry
RegistryEntryIterator endEntry()
BALL::QSAR::Registry::getFeatureSelectionName
String getFeatureSelectionName(unsigned int no)
BALL::QSAR::Registry::default_gridsearch_par2_start
double default_gridsearch_par2_start
Definition registry.h:110
BALL::QSAR::Registry::RegistryEntry
friend class RegistryEntry
Definition registry.h:148
BALL::QSAR::Registry::~Registry
~Registry()
BALL::QSAR::Registry::default_gridsearch_recursion
int default_gridsearch_recursion
Definition registry.h:107
BALL::QSAR::Registry::default_gridsearch_steps
int default_gridsearch_steps
Definition registry.h:108
BALL::QSAR::Registry::getRegressionStatisticName
String getRegressionStatisticName(unsigned int no)
BALL::QSAR::Registry::getEntry
RegistryEntry * getEntry(int ID)
BALL::QSAR::Registry::getValidationName
String getValidationName(unsigned int no)
BALL::QSAR::Registry::default_nested_folds
int default_nested_folds
Definition registry.h:101
BALL::QSAR::Registry::getClassificationStatistics
const std::map< unsigned int, String > * getClassificationStatistics()
BALL::QSAR::Registry::default_valdition_fraction
double default_valdition_fraction
Definition registry.h:98
BALL::QSAR::Registry::default_no_permutations
int default_no_permutations
Definition registry.h:92
BALL::QSAR::Registry::default_gridsearch_par1_start
double default_gridsearch_par1_start
Definition registry.h:109
BALL::QSAR::Registry::Registry
Registry()
BALL::QSAR::Registry::default_no_boostrap_samples
int default_no_boostrap_samples
Definition registry.h:95
BALL::QSAR::Registry::getRegressionStatistics
const std::map< unsigned int, String > * getRegressionStatistics()
BALL::QSAR::Registry::default_kernel_par2
double default_kernel_par2
Definition registry.h:83
BALL::QSAR::Registry::addEntry
void addEntry(RegistryEntry entry, int uniqueID)
BALL::String
Definition string.h:57
libsvmModel.h
modelFactory.h
BALL::QSAR
Definition allModel.h:17
BALL::QSAR::RegistryEntryIterator
std::map< int, RegistryEntry >::iterator RegistryEntryIterator
Definition registry.h:70
BALL::QSAR::CreateKernel1
Model *(* CreateKernel1)(const QSARData &q, int k, double p1, double p2)
Definition registry.h:21
BALL::QSAR::CreateKernel2
Model *(* CreateKernel2)(const QSARData &q, String s1, String s2)
Definition registry.h:22
BALL::QSAR::CreateMethod
Model *(* CreateMethod)(const QSARData &q)
Definition registry.h:20
BALL
Definition constants.h:13