Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is Q1-c for reference. c. The following dataset contains 7 transactions of 6 items: apple, bread, carrot, donut, egg, and fish. Calculate (i) support(
This is Q1-c for reference.
c. The following dataset contains 7 transactions of 6 items: apple, bread, carrot, donut, egg, and fish. Calculate (i) support( apple } ), (ii) support( { donut } ), (iii) support( apple }=> donut } ), and (iv) confidence( { apple }=>{ donut } ). (Note that this dataset is also used in some later questions.) [5] - T0: apple, bread, egg, fish - T1: apple, bread, carrot, donut, egg - T2: bread, egg - T3: bread, donut, egg - T4: apple, bread, egg - T5: apple, bread, egg, fish - T6: apple, carrot, donut, egg Question 3 - Programming PCA and Apriori [25 marks] a. Given a dataset created from the code fragment below, write code to apply PCA and linear regression on the dataset for various numbers of principal components, and plot the test scores and total variance explained ratios versus the number of principal components used. Do not use cross-validation. [12] from sklearn.datasets import make_regression x,y= make_regression(n_samples =500, n_features =30, n informative =20, effective_rank =10, noise =4, tail_strength =0.1, random_state =42 ) b. Write code to visualise the dataset in part (a) in a scatter plot using the first two principal components. Show the first principal component in the x-axis, the second principal component in the y-axis, and the target values in colours with the "bwr" Matplotlib colormap. [5] c. Write code to apply Apriori to the dataset in Q1-c for the minimum support value of 0.4. Display the support values and the contents of the frequent itemsetsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started