Looking for a C ++ implementation of the C4.5 algorithm

I was looking for C ++, an implementation of the C4.5 algorithm , but I could not find it yet. I found Quinlan C4.5 Release 8 , but it is written in C ... did anyone see any C ++ - open source implementations of the C4.5 algorithm

I'm going to port the J48 source code (or just write a wrapper around version C) if I can't find open source in C ++, but I hope I don't need to do this! Please let me know if you are faced with the implementation of the algorithm in C ++.

Update

I considered writing a thin C ++ shell around the C implementation of the C5.0 algorithm ( C5.0 is an improved version of C4.5 ). I downloaded and compiled the C implementation of the C5.0 algorithm, but it does not look easily portable in C ++. The C implementation uses many global variables, and simply writing a thin C ++ shell around C functions will not lead to an object-oriented design, because each instance of the class will change the same global parameters. In other words: I will not have encapsulation, and this is a pretty simple thing that I need.

In order to get the encapsulation, I will need to make a fully deflated port of C-code in C ++, which is about the same as porting the Java version (J48) to C ++.

Update 2.0

Here are some specific requirements:

  • (.. , ).
  • .

: , 10- , 10 . C , 10 , . , , , , .

+5
3

, ++- C5.0 (See5.0), , , .

, C5.0:

See5Sam [C5.0] , . , .

, , .

Update

, ++:

class CMee5
{
  public:

    /**
      Create a See 5 engine from tree/rules files.
      \param pcFileStem The stem of the See 5 file system. The engine
             initialisation will look for the following files:
              - pcFileStem.names Vanilla See 5 names file (mandatory)
              - pcFileStem.tree or pcFileStem.rules Vanilla See 5 tree or rules
                file (mandatory)
              - pcFileStem.costs Vanilla See 5 costs file (mandatory)
    */
    inline CMee5(const char* pcFileStem, bool bUseRules);

    /**
      Release allocated memory for this engine.
    */
    inline ~CMee5();

    /**
      General classification routine accepting a data record.
    */
    inline unsigned int classifyDataRec(DataRec Case, float* pOutConfidence);

    /**
      Show rules that were used to classify the last case.
      Classify() will have set RulesUsed[] to
      number of active rules for trial 0,
      first active rule, second active rule, ..., last active rule,
      number of active rules for trial 1,
      first active rule, second active rule, ..., last active rule,
      and so on.
    */
    inline void showRules(int Spaces);

    /**
      Open file with given extension for read/write with the actual file stem.
    */
    inline FILE* GetFile(String Extension, String RW);

    /**
      Read a raw case from file Df.

      For each attribute, read the attribute value from the file.
      If it is a discrete valued attribute, find the associated no.
      of this attribute value (if the value is unknown this is 0).

      Returns the array of attribute values.
    */
    inline DataRec GetDataRec(FILE *Df, Boolean Train);
    inline DataRec GetDataRecFromVec(float* pfVals, Boolean Train);
    inline float TranslateStringField(int Att, const char* Name);

    inline void Error(int ErrNo, String S1, String S2);

    inline int getMaxClass() const;
    inline int getClassAtt() const;
    inline int getLabelAtt() const;
    inline int getCWtAtt() const;
    inline unsigned int getMaxAtt() const;
    inline const char* getClassName(int nClassNo) const;
    inline char* getIgnoredVals();

    inline void FreeLastCase(void* DVec);
}

, , .

+2

++ C4.5, YaDT, , " ":
http://www.di.unipi.it/~ruggieri/software.html

:
http://www.di.unipi.it/~ruggieri/YaDT/YaDT1.2.5.zip

, :

[...] ++ , C4.5. YaDT, . , , . , , . [...]

.

+2

... , API C, C. , .

, , , , :

  • ++ ...

  • ++, , .

(1), , . , "", ++ ( ).

(2)... , , C Java - , . , , - , . , , C ++, , .

, , " " , "---", .


. . , / , . , , , . , , marshalling .

, , ... , . , , , , .

+1

All Articles