00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef CLASSIFICATION
00027 #define CLASSIFICATION
00028
00029 #ifndef MODELH
00030 #include <BALL/QSAR/Model.h>
00031 #endif
00032
00033 #ifndef CLASVALIDATION
00034 #include <BALL/QSAR/classificationValidation.h>
00035 #endif
00036
00037 #ifndef QSAR_EXCEPTION
00038 #include <BALL/QSAR/exception.h>
00039 #endif
00040
00041
00042 namespace BALL
00043 {
00044 namespace QSAR
00045 {
00046 class BALL_EXPORT ClassificationModel : public Model
00047 {
00048 public:
00054 ClassificationModel(const QSARData& q);
00055
00056 ~ClassificationModel();
00057
00058 virtual void operator=(ClassificationModel& m);
00060
00061
00066 ClassificationValidation* validation;
00067
00068 std::vector<int> getClassLabels();
00070
00071
00072 protected:
00073
00078 void readLabels();
00079
00081 std::vector<int> no_substances_;
00083
00087 void readClassInformationFromFile(std::ifstream& input, int no_classes);
00088 void saveClassInformationToFile(std::ofstream& out);
00090
00091
00092
00101 void (ClassificationModel::* discretizeFeatures)(uint bins, BALL::Matrix<double>& discretization_information);
00102
00105 void (ClassificationModel::* discretizeTestDataFeatures)(Vector<double>& compound, uint bins, const BALL::Matrix<double>& discretization_information);
00106
00107
00109 void equalSpaceDiscretization(uint bins, BALL::Matrix<double>& discretization_information);
00110
00111 void equalSpaceDiscretizationTestData(Vector<double>& compound, uint bins, const BALL::Matrix<double>& discretization_information);
00112
00113
00114
00115
00117
00118
00123 std::vector<int> labels_;
00125
00126 friend class ClassificationValidation;
00127
00128
00129
00130 };
00131 }
00132 }
00133
00134 #endif // CLASSIFICATION