Matlab Project
[Content_Types].xml
_rels/.rels
mathml/eqn1.mml
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow><mi mathvariant="normal">distance</mi><mo>=</mo><msqrt><mrow><mrow><munderover><mrow><mo>∑</mo></mrow><mrow><mi mathvariant="italic">i</mi><mo>=</mo><mn>1</mn></mrow><mrow><mi mathvariant="italic">n</mi></mrow></munderover><mrow><msup><mrow><mrow><mo>(</mo><mrow><msub><mrow><mi mathvariant="normal">Train</mi></mrow><mrow><mi mathvariant="italic">i</mi></mrow></msub><mo>-</mo><msub><mrow><mi mathvariant="normal">Test</mi></mrow><mrow><mi mathvariant="italic">i</mi></mrow></msub></mrow><mo>)</mo></mrow></mrow><mrow><mn>2</mn></mrow></msup></mrow></mrow></mrow></msqrt></mrow></math>
matlab/_rels/document.xml.rels
matlab/document.xml
Final Project: Starter Code Table of Contents Load the Dataset Visualize images Split the Dataset Images Labels Closest Match Visualize the Results Estimate performance and accuracy Load the Dataset In this section, load the dataset provided along with the project. % Insert lines of code to clear the variables, close all figures and clear % screen % Load the dataset load digit_data; % As mentioned in the Project, this will load dataset containing images % and labels. Labels indicate the category that images belongs to. Visualize images We are going to visualize the images present in the dataset. % In this code, I'm visualizing one image. You can modify this % code such that you are able to visualize every 500th image - Write a for loop % such that we can visualize every 500th image figure; imagesc(images(:,:,1001)); colormap(gray(256)) Split the Dataset In this section, we split the dataset into training and testing groups. Images Test indices: Create an array such that it increments in steps of 60 from 1 to 5000 - 84 values Train indices: All values from 1 to 5000 except the values present in the test indices - 4916 values in total - I would recommend setdiff() Note the images of train and test as well Create a variable test_images - this should contain 84 images : 20 x 20 x 84 using test indices. Create a variable train_images - this should contain 4916 images : 20 x 20 x 4916 using train indices. Labels Note the corresponding test labels i.e. labels(test_idx) should contain labels of test images - 84 x 1 Note the corresponding train labels i.e. labels(train_idx) should contain labels of train images - 4916 x 1 Closest Match Write a nested 'for' loop: One loop for test cases and one loop for train cases Compute the Euclidean distance between one train and test images - repeat this process for all possible combinations. Each test image should be compared with every train image. Euclidean distance is given by: Train represents an image for train dataset. Test represents an image from test dataset. 'n' represents the number of pixels. In our case, we have about 400 pixels as the images are 20 x 20. Make sure to repeat this process for every train and test image combination. \textrm{distance}=\sqrt{\sum_{i=1}^n {\left({\textrm{Train}}_i -{\textrm{Test}}_i \right)}^2 } Image and index with minimum distance will be the closest match Visualize the Results Create subplots with 2 columns, 1 column shows the original test image and 2nd column shows the corresponding best match. Your results should match the video uploaded along with the project. Estimate performance and accuracy Compare the actual test label with the predicted label. Predicted label can be determined by using the closest match index and train labels. Determine the number of cases where the predicted label is equal to actual test label and divide it by the number of test images to compute accuracy. Expected Accuracy: 92.86% Type a formal report in word and convert it to PDF. Please don't submit any zip files. Please submit the 3 files (Live Script (.mlx), Live Script exported to PDF and Report in PDF).
matlab/output.xml
manual code ready 0.37412296429610487 true true load digit_data; 0 9 9
metadata/coreProperties.xml
2020-11-06T19:08:44Z 2020-11-06T20:04:29Z
metadata/mwcoreProperties.xml
application/vnd.mathworks.matlab.code MATLAB Code R2020a
metadata/mwcorePropertiesExtension.xml
9.8.0.1298242 8c952706-92a2-431d-9502-f3c7a3299f89
metadata/mwcorePropertiesReleaseInfo.xml
9.8.0.1451342 R2020a Update 5 Aug 06 2020 2043697952