Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

AutoVMatrix.cc

Go to the documentation of this file.
00001 // -*- C++ -*- 00002 00003 // AutoVMatrix.cc 00004 // Copyright (C) 2002 Pascal Vincent 00005 // 00006 00007 // Redistribution and use in source and binary forms, with or without 00008 // modification, are permitted provided that the following conditions are met: 00009 // 00010 // 1. Redistributions of source code must retain the above copyright 00011 // notice, this list of conditions and the following disclaimer. 00012 // 00013 // 2. Redistributions in binary form must reproduce the above copyright 00014 // notice, this list of conditions and the following disclaimer in the 00015 // documentation and/or other materials provided with the distribution. 00016 // 00017 // 3. The name of the authors may not be used to endorse or promote 00018 // products derived from this software without specific prior written 00019 // permission. 00020 // 00021 // THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 00022 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00023 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00024 // NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00025 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 00026 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00027 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00028 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00029 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 // 00032 // This file is part of the PLearn library. For more information on the PLearn 00033 // library, go to the PLearn Web site at www.plearn.org 00034 00035 00036 00037 00038 /* ******************************************************* 00039 * $Id: AutoVMatrix.cc,v 1.11 2004/08/09 22:16:24 mariusmuja Exp $ 00040 * This file is part of the PLearn library. 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 // Now call the parent class' declareOptions 00122 inherited::declareOptions(ol); 00123 00124 // Hide the 'vm' option, that is overwritten at build time anyway. 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 // makeDeepCopyFromShallowCopy // 00145 void AutoVMatrix::makeDeepCopyFromShallowCopy(map<const void*, void*>& copies) { 00146 inherited::makeDeepCopyFromShallowCopy(copies); 00147 } 00148 00149 } 00150

Generated on Tue Aug 17 15:48:43 2004 for PLearn by doxygen 1.3.7