关键词 > Python代写

Spring 2022: Int. to Statistical Machine Learning

发布时间:2022-01-27

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Spring 2022: Int. to Statistical Machine Learning


Problem Set -1

Please read all of the guidelines carefully before submitting the problem set. Each question is 20 points and there are 100 points in total.

Due date: Wednesday, January 26, 11:59 PM. Late submissions will be accepted with a

penalty! (10% reduction per day no submissions accepted two days after the deadline .)


Guidelines Before You Start

1) You should complete the problem set on your own. Discussing ideas is fine; but, sharing answers and sharing code will be considered as plagiarism.

2)   You will be using the Python programming language. You need to write your codes in an empty .ipynb file.

3)   Make sure that you provide many comments to describe your code and the variables that you created.

4)   Please use LaTeX or MS Word to submit your written responses (hand-written responses will not be graded).

5)   For some of the coding exercises, you may need to do a little bit of “Googling” or review the documentation.


Deliverables:

1)   The code of the problem set in .ipynb format (one file)

2)   Short answers written with LaTeX or MS Word and exported in .pdf format (one file)


Questions


1)   Write a program using Python that does the following:

-     Takes two matrices of any size as the input

-     Returns their dot product as the output


Note: You cannot use pre-packaged algorithms for matrix operations for this question. You can use numpy or pandas to store your data (not for calculations).

Please do the following:

a.   Please test the following matrix multiplications using your hand-written code and report the result:

b.   Compare the result to the packaged dot product numpy.dot. Are they same?

c.    Please add your codeto your .pdf file and also save it as an .ipynb file



2)   Assume that we have two (2) d-dimensional real vectors x and y. And denote by xi (or yi) the value in the i-th coordinate of x (or y). Prove or disprove the following statements by checking non-negativity, definiteness, homogeneity, and triangle inequality.


a.   The following distance function is a metric. (5 points)

b.   The following distance function is a metric. (5 points)

c.   The following distance function is a metric. (10 points)


3) Calculating by hand, find the characteristic polynomial, eigenvalues and the eigenvectors of the following matrix:


4)   Provide a proof for the following: Let A, B, and C be any n x n matrices:

a. Show that trace(ABC) = trace(CAB) = trace(BCA) (10 points)

b. trace(ABC) = trace(BAC). Provide a proof or a counterexample (10 points)


5)   Let A and B be n x n matrices with AB = 0.


Each question below is 5 points. Provide a proof or counterexample for each of the following:

a) BA = 0

b)   Either A = 0 or B = 0 (or both)

c)   If det(A) = -3, then B = 0

d) There is a vector v 0 such that BAv = 0