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
00041
00042
00043
00044
#include "AutoVMatrix.h"
00045
#include <plearn/db/getDataSet.h>
00046
00047
namespace PLearn {
00048
using namespace std;
00049
00050
PLEARN_IMPLEMENT_OBJECT(AutoVMatrix,
00051
"Automatically builds an appropriate VMat given its specification.",
00052
"AutoVMatrix tries to interpret the given 'specification' (it will call getDataSet) and\n"
00053
"will be a wrapper around the appropriate VMatrix type, simply forwarding calls to it.\n"
00054
"AutoVMatrix can be used to access the UCI databases.\n");
00055
00056 AutoVMatrix::AutoVMatrix(
const string& the_specification)
00057 :specification(the_specification)
00058 {
build_(); }
00059
00060 void AutoVMatrix::declareOptions(
OptionList& ol)
00061 {
00062
declareOption(ol,
"specification", &AutoVMatrix::specification, OptionBase::buildoption,
00063
"This is any string understood by getDataSet. Typically a file or directory path.\n"
00064
"In order to access the UCI datasets the dataset name must start with UCI_. The possible\n"
00065
"dataset names are:\n"
00066
" UCI_annealing\n"
00067
" UCI_heart-disease_ID=va\n"
00068
" UCI_heart-disease_ID=cleveland\n"
00069
" UCI_heart-disease_ID=hungarian\n"
00070
" UCI_heart-disease_ID=switzerland\n"
00071
" UCI_housing\n"
00072
" UCI_image\n"
00073
" UCI_ionosphere\n"
00074
" UCI_iris\n"
00075
" UCI_iris_ID=bezdekIris\n"
00076
" UCI_isolet_ID=1+2+3+4\n"
00077
" UCI_isolet_ID=5\n"
00078
" UCI_monks-problems_ID=monks-1\n"
00079
" UCI_monks-problems_ID=monks-2\n"
00080
" UCI_monks-problems_ID=monks-3\n"
00081
" UCI_mushroom\n"
00082
" UCI_musk_ID=clean1\n"
00083
" UCI_musk_ID=clean2\n"
00084
" UCI_page-blocks\n"
00085
" UCI_pima-indians-diabetes\n"
00086
" UCI_solar-flare_ID=data1\n"
00087
" UCI_solar-flare_ID=data2\n"
00088
" UCI_statlog_ID=german\n"
00089
" UCI_statlog_ID=australian\n"
00090
" UCI_statlog_ID=heart\n"
00091
" UCI_statlog_ID=satimage\n"
00092
" UCI_statlog_ID=segment\n"
00093
" UCI_statlog_ID=vehicle\n"
00094
" UCI_statlog_ID=shuttle\n"
00095
" UCI_thyroid-disease_ID=allbp\n"
00096
" UCI_thyroid-disease_ID=allhyper\n"
00097
" UCI_thyroid-disease_ID=allhypo\n"
00098
" UCI_thyroid-disease_ID=allrep\n"
00099
" UCI_thyroid-disease_ID=ann\n"
00100
" UCI_thyroid-disease_ID=dis\n"
00101
" UCI_thyroid-disease_ID=sick\n"
00102
" UCI_thyroid-disease_ID=hypothyroid\n"
00103
" UCI_thyroid-disease_ID=new-thyroid\n"
00104
" UCI_thyroid-disease_ID=sick-euthyroid\n"
00105
" UCI_thyroid-disease_ID=thyroid0387\n"
00106
" UCI_abalone\n"
00107
" UCI_adult\n"
00108
" UCI_covtype\n"
00109
" UCI_internet_ads\n"
00110
" UCI_nursery\n"
00111
" UCI_pendigits\n"
00112
" UCI_spambase\n"
00113
" UCI_yeast\n"
00114
"In order to access the UCI KDD datasets the dataset name must start with UCI_KDD_. The possible\n"
00115
"dataset names are:\n"
00116
" UCI_KDD_corel_ID=ColorMoments\n"
00117
" UCI_KDD_corel_ID=ColorHistogram\n"
00118
" UCI_KDD_corel_ID=CoocTexture\n"
00119
" UCI_KDD_corel_ID=LayoutHistogram\n"
00120
" UCI_KDD_insurance-bench\n" );
00121
00122 inherited::declareOptions(ol);
00123
00124
00125
redeclareOption(ol,
"vm", &AutoVMatrix::vm, OptionBase::nosave,
"");
00126 }
00127
00128 void AutoVMatrix::build_()
00129 {
00130
if(
specification==
"")
00131 setVMat(
VMat());
00132
else
00133 setVMat(
getDataSet(
specification));
00134 }
00135
00136 void AutoVMatrix::build()
00137 {
00138 inherited::build();
00139
build_();
00140 }
00141
00143
00145 void AutoVMatrix::makeDeepCopyFromShallowCopy(map<const void*, void*>& copies) {
00146 inherited::makeDeepCopyFromShallowCopy(copies);
00147 }
00148
00149 }
00150