Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment - Dimensionality Reduction (assignment.ipynb) This assignment is based on content discussed in module 6 and will work with the famous MNIST dataset, which is a set of images of handwritten...

1 answer below »
Assignment - Dimensionality Reduction (assignment.ipynb)
This assignment is based on content discussed in module 6 and will work with the famous MNIST dataset, which is a set of images of handwritten digits https:
en.wikipedia.org/wiki/MNIST_database.
The dataset has been provided to you in a .csv file. – (mnist_dataset.csv)
Learning outcomes
· Apply a Random Forest classification algorithm to MNIST dataset
· Perform dimensionality reduction of features using PCA and compare classification on the reduced dataset to that of original one
· Apply dimensionality reduction techniques: t-SNE and LLE
Questions (15 points total)
Question 1 (1 point). Load the MNIST dataset and split it into a training set and a test set (take the first 60,000 instances for training, and the remaining 10,000 for testing).
Question 2 (2 points). Train a Random Forest classifier on the dataset and time how long it takes, then evaluate the resulting model on the test set.
Question 3 (4 points). Next, use PCA to reduce the dataset’s dimensionality, with an explained variance ratio of 95%. Train a new Random Forest classifier on the reduced dataset and see how long it takes. Was training much faster? Next evaluate the classifier on the test set: how does it compare to the previous classifier?
Question 4 (4 points). Use t-SNE to reduce the MNIST dataset, show result graphically.
Question 5 (4 points). Compare with other dimensionality methods: Locally Linear Embedding (LLE) or Multidimensional scaling (MDS).
Answered Same Day Jul 02, 2021

Solution

Neha answered on Jul 08 2021
164 Votes
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Assignment 3 - Dimensionality Reduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This assignment is based on content discussed in module 6 and will work with the famous MNIST dataset, which is a set of images of handwritten digits https:
en.wikipedia.org/wiki/MNIST_database.\n",
"The dataset has been provided to you in a .csv file."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Learning outcomes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Apply a Random Forest classification algorithm to MNIST dataset\n",
"- Perform dimensionality reduction of features using PCA and compare classification on the reduced dataset to that of original one\n",
"- Apply dimensionality reduction techniques: t-SNE and LLE"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Questions (15 points total)\n",
"\n",
"__Question 1 (1 point).__ Load the MNIST dataset and split it into a training set and a test set (take the first 60,000 instances for training, and the remaining 10,000 for testing)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE\n",
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"from sklearn.ensemble import...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here