← Indietro
EsameEsame completoTesto d’esame

09 02 2021 E T LAB

Esame completo di Numerical Analysis for Machine Learning per il corso di Mathematical Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Numerical Analysis for Machine LearningEsame completo

Informazioni sul documento

Cosa trovi in questo materiale

Esame completo di Numerical Analysis for Machine Learning per il corso di Mathematical Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.

Contenuti estratti dal documento

Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.

Pagina 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…

Anteprima

Prima pagina del documento.

Prima pagina: 09 02 2021 E T LAB