Data Analytics: Assignment Questions
1.Avehiclemanufacturingcompanyisanalyzingitsstolenvehicledatasettopredictwhetheranewvehicle
is likely to be stolen based on certain attributes. The following table presents historical data about
vehicles, including their color , type, origin, and whether they were stolen. Using Naive Bayes
classification,classify the new data {Color: Red, Type: SUV, Origin:Domestic}.
Color Type Origin tole
S
n
Red Sports Domestic Yes
Red Sports Domestic No
Red Sports Domestic Yes
Yellow Sports Domestic No
Yellow Sports Imported Yes
Yellow SUV Imported No
Yellow SUV Imported Yes
Yellow SUV Domestic No
Red SUV Imported No
Red Sports Imported Yes
2.Consider the dataset of 10 data points in a two-dimensional space, as represented below:
Point X- coordinate -
Y
coordinate
P1 1 4
P2 5 1
P3 5 2
P4 5 4
P5 10 4
P6 25 4
P7 25 6
P8 25 7
P9 25 8
P10 29 7
Apply K-means to cluster the data assuming K=2. Use Manhattan distance.
3.Comment on following
a) “Sampling algorithm (variation of Apriori) uses NB( ) function to generate optimal association rules,
Justify.
b) “Confidence and Support may not be sufficient in few cases to generate optimal rules” Additional
parameter may be required, Explain
c) “CLARA and CLARANS are variations of K-Means/PAM” Discuss.
d) “Consider C4.5, Why do we use gain ratio in place of simple gain measure?” Justify
.Consider the following dataset, where we want to decide whether the customer is likely to buy a computer or
4
not for 14 records:
Age Income Studen Credit Buys
t ating
R Computer
Youth High No Fair No
Youth High No Excellent No
Middle-aged High No Fair Yes
Senior Medium No Fair Yes
Senior Low Yes Fair Yes
Senior Low Yes Excellent No
Middle-aged Low Yes Excellent Yes
Youth Medium No Fair No
Youth Low Yes Fair Yes
Senior Medium Yes Fair Yes
Youth Medium Yes Excellent Yes
Middle-a Medium No Excellent Yes
ged High Yes Fair Yes
Middle-a
ged
Senior Medium No Excellent No
●Calculate the Gini index (CART) for the given dataset considering the target variable
buys_computer.
● Among the attributes age, income, student, and credit_rating, calculate the Gini index for each
possible split and select the best attribute for the root node of the decision [Link] all the
splits you considered and their corresponding Gini [Link] your selection of the root split.
●ConstructthefulldecisiontreebyfirstselectingthebestrootsplitbasedontheGiniindex,thencontinue
recursivelysplittingthedataateachnodeuntileachleafnodecontainsonlyasingleclass(either"Yes"
or"No").Ateachstage,listallthepossiblesplitsconsideredalongwiththeirrespectiveGiniindicesand
a ssign the corresponding class ("Yes" or "No") to each leaf node based on the majority class of the
records in that leaf.
●Use the final tree to classify the record(youth, low, no, excellent).
. Perform hierarchical clustering using the agglomerative approach withtheCompleteandAverageLinkage
5
methodforthegivendistancematrixoffivedatapoints(A,B,C,D,E).Computeallintermediatesteps,showing
the formation of clusters at each stage, and construct a clear and labelled dendrogram to represent the clustering
process.
A B C D E
A 0 1 2 5 3
B 1 0 2 3 4
C 2 2 0 3 6
D 5 3 3 0 6
E 3 4 6 6 0
6.Consider a simple feedforward neural network withthe following parameters:
( Input: x1=0.05 andx2=0.10),(Weights:w1=0.15,w2=0.20,w3=0.25,w4=0.30,w5=0.40,w6=0.45,w7=0.50,
and w8=0.55), (Biases: b1=0.35 and b2=0.60), and (TargetValues:T1=0.01andT2=0.99).Performaforward
passthroughthenetworkusingthesigmoidactivationfunction,followedbyasinglebackwardpassusingthe
backpropagation algorithm to update the weights and biases, and then draw the neural network architecture
with the updated weights after the backward pass.
7.
8.
9.Find linear regression equation for the followingtwo sets of data:
X 2 4 6 8
Y 3 7 5 10
0.Given the points A(3, 7), B(4, 6), C(5, 5), D(6, 4), E(7, 3), F(6, 2), G(7, 2) and H(8, 4), Find the core
1
points and outliers using DBSCAN. Take Eps = 2.5 and MinPts = 3.