Back
ExamFull examExam paper only

09 02 2021 E T LAB

Full exam for Numerical Analysis for Machine Learning in the Mathematical Engineering degree programme at Politecnico di Milano. The document covers: Course: Numerical Analysis for Machine Learning Prof. E. Miglio - February 9th 2021 Duration of the exam: 2.5 hours. Exercise 1 We consider a database containing six characterizing measurements for batches of plastic pellets. The outcome when using this material, either ”Poor”

Numerical Analysis for Machine LearningFull exam

Document information

What's included in this study material

Full exam for Numerical Analysis for Machine Learning in the Mathematical Engineering degree programme at Politecnico di Milano. The document covers: Course: Numerical Analysis for Machine Learning Prof. E. Miglio - February 9th 2021 Duration of the exam: 2.5 hours. Exercise 1 We consider a database containing six characterizing measurements for batches of plastic pellets. The outcome when using this material, either ”Poor”

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

Course: Numerical Analysis for Machine Learning Prof. E. Miglio - February 9th 2021 Duration of the exam: 2.5 hours. Exercise 1 We consider a database containing six characterizing measurements for batches of plastic pellets. The outcome when using this material, either ”Poor” or ”Adequate”, is also provided. The goal is to classify material lots according to quality, starting from the measurements. The dataset can be created with the following commands: import pandas as pd import numpy as np import matplotlib.pyplot as plt dataframe = pd.read_csv(’https://openmv.net/file/raw-material-characterization.csv’) data = dataframe.to_numpy() A = data[:,2:].astype(np.float64) labels = data[:,1] groups = (’Adequate’, ’Poor’) Each row of the matrix A refers to a sample (i.e. to a material lot). Each column corresponds to a feature. The vector labels contains the material quality of the sample with corresponding index. 1. How many samples are there in the dataset? How many poor quality and adequate quality samples are there? 2. By exploiting the SVD decomposition, perform PCA on the provided data. Then, plot the trend of the singular valuesσk in logarithmic scale. 3. Compute a matrix containing the principal components associated with the dataset. 4. Generate a scatterplot of the first two principal components of the dataset, grouped by label. 5. Propose a simple classifier to discriminate among poor and adequate quality materials, based on the second principal component. Then compute the accuracy of the classifier (i.e. the fraction of correctly classified samples). Exercise 2 Consider the function f(x) =f1(x) +f2(x), (1) where f1(x) = (x− 1)2 and f2(x) = (x + 1)2. Use the Stochastic Gradient Descent (SGD) method to find the minimum of f(x); each iteration of the SGD is given by xk+1…

Preview

First page of the document.

First page: 09 02 2021 E T LAB