Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8030507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:47:31+00:00 2026-06-05T00:47:31+00:00

I’ve been looking for a C++ implementation of the C4.5 algorithm , but I

  • 0

I’ve been looking for a C++ implementation of the C4.5 algorithm, but I haven’t been able to find one yet. I found Quinlan’s C4.5 Release 8, but it’s written in C… has anybody seen any open source C++ implementations of the C4.5 algorithm?

I’m thinking about porting the J48 source code (or simply writing a wrapper around the C version) if I can’t find an open source C++ implementation out there, but I hope I don’t have to do that! Please let me know if you have come across a C++ implementation of the algorithm.

Update

I’ve been considering the option of writing a thin C++ wrapper around the C implementation of the C5.0 algorithm (C5.0 is the improved version of C4.5). I downloaded and compiled the C implementation of the C5.0 algorithm, but it doesn’t look like it’s easily portable to C++. The C implementation uses a lot of global variables and simply writing a thin C++ wrapper around the C functions will not result in an object oriented design because each class instance will be modifying the same global parameters. In other words: I will have no encapsulation and that’s a pretty basic thing that I need.

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

Update 2.0

Here are some specific requirements:

  1. Each classifier instance must encapsulate its own data (i.e. no global variables aside from constant ones).
  2. Support the concurrent training of classifiers and the concurrent evaluation of the classifiers.

Here is a good scenario: suppose I’m doing 10-fold cross-validation, I would like to concurrently train 10 decision trees with their respective slice of the training set. If I just run the C program for each slice, I would have to run 10 processes, which is not horrible. However, if I need to classify thousands of data samples in real time, then I would have to start a new process for each sample I want to classify and that’s not very efficient.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:47:32+00:00Added an answer on June 5, 2026 at 12:47 am

    I may have found a possible C++ “implementation” of C5.0 (See5.0), but I haven’t been able to dig into the source code enough to determine if it really works as advertised.

    To reiterate my original concerns, the author of the port states the following about the C5.0 algorithm:

    Another drawback with See5Sam [C5.0] is the impossibility to have more than
    one application tree at the same time. An application is read from
    files each time the executable is run and is stored in global
    variables here and there.

    I will update my answer as soon as I get some time to look into the source code.

    Update

    It’s looking pretty good, here is the C++ interface:

    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);
    }
    

    I would say that this is the best alternative I’ve found so far.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.