PLearn 0.1
FieldConvertCommand.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // Copyright (C) 2004 Université de Montréal
00004 //
00005 // Redistribution and use in source and binary forms, with or without
00006 // modification, are permitted provided that the following conditions are met:
00007 //
00008 //  1. Redistributions of source code must retain the above copyright
00009 //     notice, this list of conditions and the following disclaimer.
00010 //
00011 //  2. Redistributions in binary form must reproduce the above copyright
00012 //     notice, this list of conditions and the following disclaimer in the
00013 //     documentation and/or other materials provided with the distribution.
00014 //
00015 //  3. The name of the authors may not be used to endorse or promote
00016 //     products derived from this software without specific prior written
00017 //     permission.
00018 //
00019 // THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
00020 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00021 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
00022 // NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
00024 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00025 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00026 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00027 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00028 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // This file is part of the PLearn library. For more information on the PLearn
00031 // library, go to the PLearn Web site at www.plearn.org
00032 
00033 /* *******************************************************
00034  * $Id: FieldConvertCommand.h 3995 2005-08-25 13:58:23Z chapados $
00035  ******************************************************* */
00036 
00037 #ifndef FieldConvertCommand_INC
00038 #define FieldConvertCommand_INC
00039 
00040 #include "PLearnCommand.h"
00041 #include "PLearnCommandRegistry.h"
00042 #include <plearn/math/pl_math.h>    
00043 #include <plearn/io/PPath.h>
00044 
00045 namespace PLearn {
00046 using namespace std;
00047 
00048 class FieldConvertCommand: public PLearnCommand
00049 {
00050 public:
00051 
00053     FieldConvertCommand();
00054 
00056     enum FieldType {
00057         binary,
00058         constant,
00059         continuous,
00060         discrete_corr,
00061         discrete_uncorr,
00062         skip,
00063         unknown //< Default value before the decision on the field type is made.
00064     };
00065   
00066     virtual void run(const vector<string>& args);
00067 
00068 protected:
00069 
00070     // Convert a string into our enum type.
00071     FieldType stringToFieldType(string s);
00072 
00073     static PLearnCommandRegistry reg_;
00074 
00075     real DISCRETE_TOLERANCE;
00076     real UNIQUE_NMISSING_FRACTION_TO_ASSUME_CONTINUOUS;
00077     real PVALUE_THRESHOLD;
00078     real FRAC_MISSING_TO_SKIP;
00079     real FRAC_ENOUGH;
00080     PPath source_fn, desti_fn,force_fn,report_fn;
00081     string precompute;
00082     int target;
00083     FieldType type;
00084 };
00085 
00086   
00087 } // end of namespace PLearn
00088 
00089 #endif
00090 
00091 
00092 /*
00093   Local Variables:
00094   mode:c++
00095   c-basic-offset:4
00096   c-file-style:"stroustrup"
00097   c-file-offsets:((innamespace . 0)(inline-open . 0))
00098   indent-tabs-mode:nil
00099   fill-column:79
00100   End:
00101 */
00102 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=79 :
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines