Reference no: EM132405977
IASP520 Data Mining and Knowledge Discovery Assignment, Mercy College, USA
1. Import the numpy package under the name np.
2. Import the matplotlib.pyplot package under the name plt.
3. Create a zero vector of size 10.
4. Create an constant vector with value 5 of size 10 but the fifth value which is 10.
5. Create a vector with values ranging from 10 to 49.
6. Reverse a vector from question 4 (first element becomes last).
7. Create a 4x4 matrix with values ranging from 0 to 10.
8. Create a 4x4 identity matrix.
9. Create a 4x4x4 array with random values.
10. Find the mean, median, sum of each column and row of the array from question 8.
11. Create a 5x5 matrix with value 10, diagonal values are 100, 200, 300, 400, and 500.
12. Create two matrices with random values. Multiply a 3x2 matrix by a 2x3 matrix.
13. Create a 4x4 array by multiplying coordinate of each element.
14. Create two 4x4 random array A and B, then create an array with the equal elements.
15. Stack array A and B from question 12 together both vertically and horizontally.
16. Evenly split the resulting arrays from A and B both vertically and horizontally.
17. Create a random array with shape (3, 5) and extract the second column and third row as separate arrays.
18. Create a random 4x4 array and get the transpose and inverse of the matrix.
19. Calculate L1, L2 and L8 norm distance given a coordinate matrix represented as a numpy array
Plot the coordinate matrix.
20. Calculate Mahalanobis Distance.
21. Calculate SMC / Jaccard coeffient of two attributes.
22. Read data from data.txt into a numpy array and calculate mean, std, var, cov and corr of two attributes.
Instructions:
1. Write a function for each problem. Add all the functions to one module. Save it as Lastname_Firstname_hw2.py, e.g. John Adam's file name should be Adam_John_hw1.py.
Attachment:- Data File.rar