## Introduction to Artifificial Intelligence

Assignment 10

AIMA Chapter 19, 21: Machine Learning

Date Due: Monday 7 December 2020, 11:59pm Total Marks: 60

### General Instructions

• This assignment is individual work. You may discuss questions and problems with anyone, but the work you hand in for this assignment must be your own work.
• If you intend to use resources not supplied by the instructor, please request permission prior to starting. In any case, you must provide an attribution for any external resource (library, API, etc) you use. You should not use any resource that substantially solves the problems in this assignment.If there’s any doubt, ask! No harm can come from asking, even if my answer is no.
• Each question indicates what to hand in.
• Assignments must be submitted to Moodle.

### Overview

In this assignment, we’ll exercise a few ideas, but there is no signicant programming.

The work here consist of some exercises exploring linear classiers. Most of the work is done for you, but it has to be completed using Jupyter Notebook. This is a way of working with scripts in various languages,combining documentation, code, and output.  加拿大计算机科学网课代修

Jupyter Notebook is easy to install on your own computers, especially if you use the Anaconda 3 installation tools for Python 3. If you installed Python using Anaconda 3, it may already be installed for you. If not, Google for help. This might take an extra 15 or 20 minutes. For reference, all that I had to do was:

• Pull up a terminal and type conda install -c conda-forge jupyterlab
• (to more easily export to PDF, I also then did: python -m pip install -U notebook-as-pdf followed by pyppeteer-install)
• Put the directory containing the provided Notebook les somewhere into my Home directory
• Search for and startthe Jupyter Notebook app that was now available on my machine (could also be started from terminal)
• Navigate to the Notebook les in the web browser window that pops up

### Question 1 (15 points):

Purpose: To explore the method of Gradient Descent for Linear Regression.

For this question, you’ll explore how linear regression can be used to model data.

On the class webpage, you’ll nd a Jupyter notebook named a10q1.ipynb. To work with this notebook, you will need to work with an installation of Jupyter Notebook, or Jupyter Lab.

The notebook contains a combination of examples, instructions and questions for you to answer. There are notebook cells that require you to modify some Python code, and to observe the effects.  加拿大计算机科学网课代修

There is a section near the bottom of the page with some Questions that prompt you to experiment and figure some things out. Your answers to these questions can be typed into the notebook itself. Please follow the example here:

Questions

1. How many Python programmers does it take to drive a truck?

> This is a very interesting question, and after much thought, the answer appears to be 7.

> The answer requires several lines to explain it, and they all start with the

1. Why is the sky?

> Because it’s not.

Use the > for your answer to set your answers apart from the question text. This will make it easier to mark.

### What to Hand In

Answer the questions posed in the Jupyter Notebook, export the document as PDF, and submit to Moodle as a10q1.pdf.

Be sure to include your name, NSID, student number, and course number at the top of all documents.

### Evaluation

Each question shows the number of marks. For full marks, your answer is correct and concise.

### Question 2 (15 points):  加拿大计算机科学网课代修

Purpose: To explore the Perceptron Learning Rule for Linear Classiers.

For this question, you will explore how a linear classier can be used to classify data points.

On the class webpage, you’ll nd a Jupyter notebook named a10q2.ipynb. To work with this notebook, you will need to work with an installation of Jupyter Notebook, or Jupyter Lab.

The notebook contains a combination of examples, instructions and questions for you to answer. There are notebook cells that require you to modify some Python code, and to observe the effects.

There is a section near the bottom of the page with some Questions that prompt you to experiment and figure some things out. Your answers to these questions can be typed into the notebook itself.

### What to Hand In

Answer the questions posed in the Jupyter Notebook, export the document as PDF, and submit to Moodle as a10q2.pdf.

Be sure to include your name, NSID, student number, and course number at the top of all documents.

Evaluation

Each question shows the number of marks. For full marks, your answer is correct and concise.

### Question 3 (15 points):

Purpose: To explore Gradient Descent for Logistic Classifiers.

For this question, you will explore how a logistic classifier can be used to classify data points.

On the class webpage, you’ll nd a Jupyter notebook named a10q3.ipynb. To work with this notebook, you will need to work with an installation of Jupyter Notebook, or Jupyter Lab.

The notebook contains a combination of examples, instructions and questions for you to answer. There are notebook cells that require you to modify some Python code, and to observe the effects.  加拿大计算机科学网课代修

There is a section near the bottom of the page with some Questions that prompt you to experiment and figure some things out. Your answers to these questions can be typed into the notebook itself.

What to Hand In

Answer the questions posed in the Jupyter Notebook, export the document as PDF, and submit to Moodle as a10q3.pdf.

Be sure to include your name, NSID, student number, and course number at the top of all documents.

Evaluation

Each question shows the number of marks. For full marks, your answer is correct and concise.

### Question 4 (15 points):  加拿大计算机科学网课代修

Purpose: To explore simple Artificial Neural Networks.

For this question, you will explore how a simple articial neural network can be built out of either linear or logistic classfiers.

On the class webpage, you’ll nd a Jupyter notebook named a10q4.ipynb. To work with this notebook, you will need to work with an installation of Jupyter Notebook, or Jupyter Lab.

The notebook contains a combination of examples, instructions and questions for you to answer. There are notebook cells that require you to modify some Python code, and to observe the eects.

There is a section near the bottom of the page with some Questions that prompt you to experiment and figure some things out. Your answers to these questions can be typed into the notebook itself.

What to Hand In

Answer the questions posed in the Jupyter Notebook, export the document as PDF, and submit to Moodle as a10q4.pdf.

Be sure to include your name, NSID, student number, and course number at the top of all documents.

Evaluation

Each question shows the number of marks. For full marks, your answer is correct and concise.