Consider a single perceptron model that is being trained to diagnose the flu in patients based on three simple markers. Suppose the next data point in the training set is , and suppose that the correct classification for this combination of markers is (flu diagnosed). With current weights and bias , does the perceptron correctly diagnose the patient as having the flu? If not, use the perceptron learning rule with to update the weights and bias. Is there an improvement in classifying this data point?
2.
For each scenario, determine whether a standard neural network, a recurrent neural network (RNN), or a convolutional neural network (CNN) would be most suitable. Explain your choice, detailing the advantages and disadvantages of each type of network for the given scenario.
a.
A company wants to analyze customer reviews to determine whether they are positive, negative, or neutral. The reviews are provided as text data, and the company is interested in understanding the general sentiment of each review.
b.
An investment firm is developing a model to predict future stock prices based on historical price data. The firm wants to account for trends, patterns, and time-based dependencies in the data.
c.
A technology company is building a model to classify images into various categories, such as “cat,” “dog,” and “car.” The input data consists of individual images.
d.
A company wants to predict whether a customer is likely to cancel their subscription based on a variety of features, such as customer demographics, subscription duration, customer interactions, and usage patterns.
3.
The characters in some computer fonts are represented by arrays of color values or grayscale values, called bitmaps. See the following 9-by-9 bitmap representing the Japanese hiragana character “a” in which each number indicates one of two color values, 0 for white and 1 for black, for each pixel.
Here is how the character might look when rendered:
Partition the bitmap array into 2-by-2 blocks and use the pooling method of averaging to reduce the size of the bitmap. Note: Since the original array’s dimensions are not divisible by 2, you should pad the array by appending a column of zeros to the right and a row of zeros on the bottom. How might the resulting bitmap be interpreted visually?
4.
Which loss functions would be most appropriate to use in training a neural network for the following tasks? Why?
a.
Predicting the temperature based on day of the year, recent wind speeds, precipitation, and prior temperatures
b.
Classifying emails as spam or not spam based on their content
c.
Classifying an image into one of several categories, such as animals, vehicles, or plants
d.
Diagnosing cancer in patients based on multiple indicators
Reuse and redistribution of this content in digital or print format:
This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's prior written permission.
This book uses the
Creative Commons Attribution-NonCommercial-ShareAlike License, which means that you can reuse and modify the material only for noncommercial purposes, must attribute OpenStax, and must distribute any derivative works under the same license.
Any commercial printing of this textbook, including using a local or custom printer, must be approved by OpenStax, and proper citation provided.
OpenStax-copyrighted images, activities, assessments, and similar components of this book are subject to the same licensing – CC-BY-NC-SA. They can be used for noncommercial purposes with attribution. Commercial use requires permission.
Permission requests: Anyone who intends to incorporate this content (including text, images, and other components) into large language models, use it in AI offerings, use it commercially (including in print), and/or has questions about another use case is welcome to complete our
reuse request form.
Attribution information
If you are redistributing all or part of this book in a noncommercial print format,
then you must include on every physical page the following attribution:
Access for free at https://openstax.org/books/principles-data-science/pages/1-introduction
If you are redistributing all or part of this book in a noncommercial digital format,
then for every page that includes OpenStax content, you must license the derivative work
under the same CC-BY-NC-SA license as the original, and include on every digital page
view the following attribution:
The information below includes the information needed to generate citations in most
major styles (APA, MLA, etc.); you must reformat and organize the information as needed
to fit the requirements of the style. Use the information below to generate a citation.
We recommend using a citation tool such as
this one.
Authors: Dr. Shaun V. Ault, Dr. Soohyun Nam Liao, Larry Musolino