5

I am attempting to do some evaluation of the relative rates of different algorithms in the C# and F# realms using WekaSharp and one of the algorithms I was interested in was Markov Chains. I know Weka has an HMM application but I have not been able to implement this into WekaSharp and was wondering if there was a way to modify the J48 Algorithm to suit this purpose. I know there is some similarity between J48 and first order Markov chains but am trying to determine what needs to be modified and if this is a reasonable thing to do. Here is the J48 as implemented in Yin Zhu's WekaSharp:

type J48() =
    static member DefaultPara =  "-C 0.25 -M 2"
    static member MakePara(?binarySplits, ?confidenceFactor, ?minNumObj, ?unpruned, ?useLaplace) =
        let binarySplitsStr = 
            let b = match binarySplits with
                    | Some (v) -> v
                    | None -> false
            if not b then "-B" else ""
        let confidenceFactorStr = 
            let c = match confidenceFactor with
                    | Some (v) -> v
                    | None -> 0.25 // default confi
            "-C " + c.ToString()
        let minNumObjStr = 
            let m = match minNumObj with
                    | Some (v) -> v
                    | None -> 2
            "-M " + m.ToString()
        let unprunedStr = 
            let u = match unpruned with
                    | Some (v) -> v
                    | None -> false
            if u then "-U" else ""
        let useLaplaceStr = 
            let u = match useLaplace with
                    | Some (v) -> v
                    | None -> false
            if u then "-A" else ""
        binarySplitsStr + " " + confidenceFactorStr + " " + minNumObjStr + " " + unprunedStr + " " + useLaplaceStr

Thank you very much.

  • I think J48 is a statistical classifier that make use of statistical distributions, but Markov Chains is a FSM that can be trained using statistics – Khaled.K Mar 19 '14 at 08:33
  • @KhaledAKhunaifer by FSM you mean Finite State Machine? – Vitaly Olegovitch Mar 20 '14 at 16:29
  • @VitalijZadneprovskij Yes, it's implemented using a 1D array alpha for starting state, and Beta 2D array for transition between states – Khaled.K Mar 23 '14 at 04:37
  • @RedMassiveStar I think J48 works in a different way, but in the application of prediction, Markov Chains are much better utilizing Redux and Dynamic Programming to find the optimal prediction .. although the J48 can be tweaked to predict well – Khaled.K Mar 23 '14 at 04:41

1 Answers1

1

J48 is just an implementation of the C4.5 algorithm that learns decision trees by considering the entropy of each attribute (dimension) and taking the attribute that has maximum entropy as root of the current subtree. This algorithm does not need reinforcement.

I guess that by Markov Chains you mean Hidden Markov Model that is used in reinforcement learning.

You should take a look to HMMWeka.

A related question is: What is the equivalent for a Hidden Markov Model in the WEKA toolkit?

Community
  • 1
  • 1
Vitaly Olegovitch
  • 3,509
  • 6
  • 33
  • 49