辅导案例-COMP7703/DATA7703
COMP4702/COMP7703/DATA7703 - Machine Learning Homework 0 - Background Knowledge Review Marcus Gallagher Semester 1, 2020 Task Machine Learning is a subject which draws on specific background knowledge from a variety of different disciplines, including computer science, statistics and mathematics. The purpose of this task is to pro- vide some examples of useful background knowledge for machine learning. If you have the recommended background knowledge, this may be a refresher for you. It is still possible to successfully complete the course if you do not already have all the background knowledge, as long as you are prepared to review this knowledge as it becomes useful during the course. Questions 1. Find the sample mean and sample standard deviation1 of the following data set: (to 2 decimal places) X = [13, 15, 24, -100, 4, 9, 10, 14, 18, 19] 2. If M is a 3 × 6 matrix, RT is a 7 × 6 matrix and S is a 7 × 4 matrix, how many rows and columns are in (M × (R× S))? 3. Given the following three 5-D vectors: u = [0.1576, 0.9706, 0.9572, 0.4854, 0.8003] v = [0.1419, 0.4218, 0.9157, 0.7922, 0.9595] w = [0.6557, 0.0357, 0.8491, 0.9340, 0.6787] (a) Which two vectors are most orthogonal to each other? (b) Calculate the angle between these two vectors. (in degrees and to two decimal places) 4. Given the following matrix, answer the questions below. M = 4 5 8 2 8 4 3 1 8 6 7 5 2 7 7 10 1more specifically the square root of the unbiased estimator of the variance! 1 (a) What is the largest eigenvalue of M? (round to 2 decimal places) (b) What is the determinant of M? (c) What is the product of the eigenvalues? (round to the nearest whole number) 5. The rand() function in Matlab produces a pseudo-random number that is uniformly distributed in (0, 1). How would you transform the output from this function if you wanted numbers uniformly distributed between 7 and 13? 6. Determine the output (Q) of the following logic circuit, given the following input: (A = 1, B = 1) Note: The only gate included in the circuit above is the NAND gate, which behaves as follows: A B Q 0 0 1 1 0 1 0 1 1 1 1 0 7. Select the correct set of inputs and outputs for the following (Matlab) function: function output = example ( arr , n ) output = [ ] ; idx = n ; while length ( output ) ˜= length ( a r r ) while idx > length ( a r r ) idx = idx − length ( a r r ) ; end disp ( idx ) ; output = cat (2 , output , a r r ( idx ) ) ; n = n + 1 ; idx = idx + n ; end (a) arr = [1, 2, 4, 0, 7], n = 3, output = [4, 2, 2, 4, 7] arr = [6, 3, 5, 1], n = 4, output = [1, 6, 5, 3] arr = [4, 3, 8, 6], n = 5, output = [4, 6, 3, 8] 2 (b) arr = [3, 2, 4, 6, 7], n = 3, output = [4, 2, 2, 4, 7] arr = [6, 3, 5, 1], n = 8, output = [1, 6, 5, 3] arr = [5, 1, 6, 8], n = 5, output = [5, 6, 1, 1] (c) arr = [4, 2, 4, 2, 7], n = 3, output = [4, 2, 2, 4, 7] arr = [6, 3, 5, 1], n = 4, output = [1, 6, 5, 3] arr = [8, 2, 6, 5], n = 5, output = [8, 6, 2, 6] 8. Given the following data: x y z 3 4 1 6 7 3 1 4 8 9 3 2 1 6 5 2 2 2 1 7 6 4 5 4 What is the Pearson correlation coefficient between the two columns with the smallest correlation (in absolute value)? (to 2 decimal places) 9. Correctly order ((a) through (h)) the following computational complexities from (asymptotically) slowest to fastest: (a) O(n3) (b) O(1) (c) O(log(n) + n) (d) O(nlog(n)) (e) O( √ n+ log(n)) (f) O(n2 + nlog(n)) (g) O(n!) (h) O(2n) 3