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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00044
#include "UCISpecification.h"
00045
00046
namespace PLearn {
00047
using namespace std;
00048
00049 UCISpecification::UCISpecification()
00050 : header_exists(0),
00051 header_fields(0),
00052 file_all(""),
00053 file_test(""),
00054 file_train(""),
00055 format("UCI"),
00056 inputsize(-1),
00057 targetsize(-1),
00058 weightsize(-1),
00059 target_is_first(0)
00060 {
00061 }
00062
00063
PLEARN_IMPLEMENT_OBJECT(
UCISpecification,
00064
"Describes the specifications of a UCI database.",
00065
"This object specifies characteristics of a database from the UCI machine\n"
00066
"learning repository, such as the input size, target size, etc...\n"
00067
"It is intended to be used in a script put in the same directory as the\n"
00068
"database, in order to be loaded by the getDataSet() method.\n"
00069 );
00070
00071 void UCISpecification::declareOptions(
OptionList& ol)
00072 {
00073
00074
00075
00076
00077
00078
00079
declareOption(ol,
"header_exists", &UCISpecification::header_exists, OptionBase::buildoption,
00080
"Specifies if there is a header for the dataset");
00081
00082
declareOption(ol,
"header_fields", &UCISpecification::header_fields, OptionBase::buildoption,
00083
"The fields that are present in the header");
00084
00085
declareOption(ol,
"file_all", &UCISpecification::file_all, OptionBase::buildoption,
00086
"The filename for the whole dataset");
00087
00088
declareOption(ol,
"file_train", &UCISpecification::file_train, OptionBase::buildoption,
00089
"The filename for the train data.");
00090
00091
declareOption(ol,
"file_test", &UCISpecification::file_test, OptionBase::buildoption,
00092
"The filename for the test data.");
00093
00094
declareOption(ol,
"format", &UCISpecification::format, OptionBase::buildoption,
00095
"The format of the dataset file.");
00096
00097
declareOption(ol,
"inputsize", &UCISpecification::inputsize, OptionBase::buildoption,
00098
"Input size of the data");
00099
00100
declareOption(ol,
"targetsize", &UCISpecification::targetsize, OptionBase::buildoption,
00101
"Target size of the data");
00102
00103
declareOption(ol,
"weightsize", &UCISpecification::weightsize, OptionBase::buildoption,
00104
"Weight size of the data");
00105
00106
declareOption(ol,
"target_is_first", &UCISpecification::target_is_first, OptionBase::buildoption,
00107
"Whether the target is the first column (otherwise it is assumed to be the last one..");
00108
00109
00110 inherited::declareOptions(ol);
00111 }
00112
00113 void UCISpecification::build_()
00114 {
00115
00116
00117
00118
00119
00120
00121
00122 }
00123
00124
00125 void UCISpecification::build()
00126 {
00127 inherited::build();
00128
build_();
00129 }
00130
00131 void UCISpecification::makeDeepCopyFromShallowCopy(map<const void*, void*>& copies)
00132 {
00133 inherited::makeDeepCopyFromShallowCopy(copies);
00134
00135
00136
00137
00138
00139
00140
00141
00142
PLERROR(
"UCISpecification::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
00143 }
00144
00145 }