Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Task 5 *. Complete the EntropyEvaluator class Following the explanation given earlier about the calculation of entropy, complete the static EntropyEvaluator.evaluate(...) method. In this assignment,...

1 answer below »
Task 5 *. Complete the EntropyEvaluator class Following the explanation given earlier about the calculation of entropy, complete the static EntropyEvaluator.evaluate(...) method. In this assignment, you need to use binary logarithm (that is, logarithm to base 2) for calculating entropy. For this, you can use the static EntropyEvaluator.log2(...) method provided to you. Task 6. Complete the GainInfoItem class Implement all the methods in GainInfoItem, except for the toString() method which is already provided to you. Implementing GainInfoItem is an easy task.Task 7 *. Complete the InformationGainEvaluator class Follow the instructions given earlier about the calculation of information gain scores to complete the static InformationGainCalculator.calculateAndSortInformationGains(...). In the InformationGainEvaluator class, you will also find a main(...) method. This main(...) method is provided in full. You do not need to make any changes to it. The name of the CSV file to process is given as a command-line parameter. Specifically, the following command line should be used to run A3:

just these three task need to be done everything else is there
Answered Same Day Mar 18, 2021

Solution

Valupadasu answered on Mar 19 2021
144 Votes
EntropyEvaluator.java
EntropyEvaluator.java
import java.util.*;
**
 * This class enables calculating (weighted-average) entropy values for a set of
 * datasets
 * 
 * @author Mehrdad Sabetzadeh, University of Ottawa
 * @author Guy-Vincent Jourdan, University of Ottawa
 *
 *
public class EntropyEvaluator {
    /**
     * A static method that calculates the weighted-average entropy of a given set
     * (a
ay) of datasets. The assignment description provides a detailed
     * explanation of this calculation. In particular, note that all logarithms are
     * to base 2. For your convenience, we provide a log2 method. You can use this
     * method wherever you need to take logarithms in this assignment.
     * 
     * @param partitions is the a
ay of datasets to compute the entropy of
     * @return Shannon's logarithmic entropy (to base 2) for the partitions
     *
    public static double evaluate(DataSet[] partitions) {
        String classValue = null;
        String fileName = ((VirtualDataSet) partitions[0]).getSourceDataSet().getSourceId();
        if (fileName != null && fileName.equals("credit-i...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here