← Indietro
EsameEsame completoTesto d’esame

20 01 2023 E TS

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 - January 20th 2023 Duration of the exam: 2.5 hours. Exercise 1 Consider the following dataset (Petricoin et al., Lancet, 2002). Each column of A represents measurements taken from a patient. There are 216 columns representing 216 patients, out of which 121 have ovarian cancer. Each row represents the concentration of a different protein in the genomic signature of the patient. You can download the dataset using the following commands in Colab: !wget https://www.dropbox.com/s/bal044f83ezxiia/ovariancancer_obs.csv !wget https://www.dropbox.com/s/r52sn5gmkd3y797/ovariancancer_grp.csv Then you can create the matrix as follows: import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D ovariancancer_obs_path = './ovariancancer_obs.csv' ovariancancer_grp_path = './ovariancancer_grp.csv' A = np.genfromtxt(ovariancancer_obs_path, delimiter=',').transpose() f = open(ovariancancer_grp_path) grp = np.array(f.read().split("\n")) grp = grp[grp != ''] n_features = A.shape[0] n_patients = A.shape[1] print('%d patients' % n_patients) print('%d features' % n_features) 1. Implement the randomized SVD. 2. Perform PCA on the data, by using the exact SVD algorithm. Then, plot the trend w.r.t. i of the singular values σi. Now, repeat the computation by considering the randomized SVD algorithm of rank k = 1 , 5, 10, 50 and 100. Plot the approximate singular values together with the exact singular values. Comment what you see. 3. Use PCA (with exact SVD) to perform dimensionality reduction on the dataset for rank k = 1, 5, 10, 50 and 100. Compute the reconstruction error of the dataset as a function of k. Repeat the same exercise by using the randomized SVD algorithm. Repeat the same exercise by…

Anteprima

Prima pagina del documento.

Prima pagina: 20 01 2023 E TS