Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Re: How to write Entropy class in java?

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to write Entropy class in java?

    please help me in calling the entropy method
    I don't know how to call this method inside my code, I have read a file (arff) file in my code and I am using weka package to run some classifiers over my file but I don't know how to calculate a class entropy for the classes inside my file
    please help


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,103
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: How to write Entropy class in java?

    Please don't hijack someone else's post. I have moved your post to its own thread.

    Now to your problem, what have you tried? You don't give us much information, and weka is a 3rd party library that probably few of us here have experience with. I'd recommend posting an SSCCE, a link to the 3rd party API, and in specific terms describe what you are trying to accomplish.

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Trying to calculate class entropy for classes defind file using weka package

    Can Any body help me in this
    I need to implement all classifiers that are defined in weka on my file
    I have read the file:
    // Read all the instances in the file (ARFF, CSV, XRFF, ...)
     DataSource source = new DataSource("iris.arff");
       Instances instances = source.getDataSet();
     
      // Make the last attribute be the class
      instances.setClassIndex(instances.numAttributes() - 1);

    // now I need to calculate the class entropy of the classes which is already known to the java enviroment (becuase I assigned the index as the last one of the attribute) ????

    please help me as I need it for my work urgently

  4. #4
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,103
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: How to write Entropy class in java?

    Please don't start new threads referring to the same question. I have merged your two threads. And please don't mention urgency - it is all relative...everyone's post is urgent to them, and saying your is more so appears selfish and does not do you any favors in receiving help

    To address your question - take a look at the ContingencyTables class in weka.

Similar Threads

  1. How to write Entropy class in java?
    By colerelm in forum Object Oriented Programming
    Replies: 2
    Last Post: October 22nd, 2012, 10:31 AM
  2. How can I write a class or something so I can run and test the following code?
    By michael305rodri in forum Java Theory & Questions
    Replies: 3
    Last Post: October 18th, 2012, 10:46 PM
  3. Replies: 3
    Last Post: June 17th, 2012, 06:22 PM
  4. help me write java program
    By stevisto in forum Member Introductions
    Replies: 1
    Last Post: September 13th, 2011, 03:44 PM
  5. How would I write this in Java?
    By Arkeshen in forum Java Theory & Questions
    Replies: 3
    Last Post: May 15th, 2011, 11:30 AM