Consider the following dataset of 10 training examples: (a) Convert the continuo
ID: 3836446 • Letter: C
Question
Consider the following dataset of 10 training examples: (a) Convert the continuous target attribute (CPI) to categorical using equal-width binning into two bins (e.g., 1 and 2); and convert the continuous descriptive attribute (A_1, A_2) to categorical using equal-depth binning into three bins or each attribute (e.g., 1, 2, and 3). Rewrite the results in the table to the right. (b) If a Bayesian Belief Networks shows the conditional independence between the attributes and target as follows: Given a new query (A_1 = 40.81, A_2 = 13.10), based on the Bayesian Belief Networks and the converted d, what categorical target class of CPI will it be classified? Show all calculations.Explanation / Answer
import java.util.*;
class btheo
;
static char temperature[]=;
static char humidity[]=;
static char windy[]=;
static char class1[]=;
static double prob[][]=new double[4][2];
static double pp=9.0/14.0;
static double npp=5.0/14.0;
static int flag=0;
static int flag1=0;
static double play_N=1;
static double notplay_N=1;
static void cal_N(int a)
else if(flag==1)
else if(flag==2)
else
if(flag==3)
return prob;
}
static double cal_noplay_prob(char ch)
else if(flag1==1)
else if(flag1==2)
else
if(flag1==3)
return prob;
}
public static void main(String args[])
cal_N(1);
cal_N(2);
double pt=play_N+notplay_N;
double prob_of_play=0;
double prob_of_noplay=0;
prob_of_play=play_N/pt;
prob_of_noplay=notplay_N/pt;
System.out.println(" Probability of play "+prob_of_play);
System.out.println(" Probability of NO play "+prob_of_noplay );
if(prob_of_play>prob_of_noplay)
System.out.println(" The new tuple classified below "PLAY" class.Hence there'll be play!!!");
else
System.out.println(" The new tuple classified below "NO PLAY" class.Hence there'll be NO play.");
}
}