CECS456 Midterm 1 Review

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Simplified loss function: Figure 4. If the target is y^(i) = 1, then what does this expression simplify to? A) -log(f_wb(x^(i)) B) -log(1 - f_wb(x^(i))

A) -log(f_wb(x^(i))

What kind of array has dimensions in this format: (10, )? A) A rank 1 array B) A rank 0 array C) An identity array

A) A rank 1 array

Which of the following numpy line of code would sum the values in a matrix A vertically? A) A.sum(axis = 0) B) A.sum(axis = 1) C) A.sum(axis)

A) A.sum(axis = 0)

Of the circumstances below, for which one is feature scaling particularly helpful? A) Feature scaling is helpful when one feature is much larger (or smaller) than another feature. B) Feature scaling is helpful when all the features in the original data ( before scaling is applied) range from 0 to 1.

A) Feature scaling is helpful when one feature is much larger (or smaller) than another feature.

You are helping a grocery store predict its revenue, and have data on its items sold per week, and price per item. What could be a useful engineered feature? A) For each product, calculate the number of items sold times price per item. B) For each product, calculate the number of items sold divided by the price per item.

A) For each product, calculate the number of items sold times price per item.

Of the following examples, which would you address using an unsupervised learning algorithm? (check all that apply) A) Given a set of news articles found on the web, group them into sets of articles about the same stories B) Given a dataset of patients diagnosed as either having diabetes or not, learn to classify new patients as having diabetes or not C) Given email labeled as spam/not spam, learn a spam filter D) Given a database of customer data, automatically discover market segments and group customers into different market segments

A) Given a set of news articles found on the web, group them into sets of articles about the same stories D) Given a database of customer data, automatically discover market segments and group customers into different market segments

For linear regression, if you find parameters w and b so that J(w,b) is very close to zero, what can you conclude? A) The selected values of the parameters w and b cause the algorithm to fit the training set really well. B) The selected values of the parameters w and b cause the algorithm to fit the training set really poorly... C) This is never possible -- there must be a bug in the code.

A) The selected values of the parameters w and b cause the algorithm to fit the training set really well.

(Figure 6) Which of the following statements is a more accurate statement about gradient descent for logistic regression? A) The update steps look like the update steps for linear regression, but the definition of f_wb(x(i)) is different B) The updates are identical to the update steps for linear regression

A) The update steps look like the update steps for linear regression, but the definition of f_wb(x(i)) is different

Which are the two common types of supervised learning? (Choose 2) A) classification B) clustering C) regression

A) classification, C) regression

Recall the sigmoid function is g(z) = 1 / (1 + e^-z). If z is a large negative number then: A) g(z) is near zero B) g(z) is near negative one

A) g(z) is near zero

Supervised learning is when we give our learning algorithm the right answer y for each example to learn from. Which is an example for supervised learning? A) spam filtering B) calculating the average age of a group of customers

A) spam filtering

import numpy as np A = np.asarray([[j for j in range(1*10, (i+1)*10)] for i in range(7)]) B = A[1, :] print (B.shape) A) (7, ) B) (10, ) C) (7, 1) D) (10, 1)

B) (10, )

To make gradient descent converge about twice as fast, a technique that almost always works is to double the learning rate alpha. A) True B) False

B) False

The cost function used for linear regression is shown in Figure 2, which of these are the parameters of the model that can be adjusted? A) w only, because we should choose b = 0 B) w and b C) f_wb(x^(i)) D) y hat

B) w and b

When does the model fit the data relatively well, compared to other choices for parameter w? A) when x is at or near a minimum B) when the cost J is at or near a minimum C) when w is close to zero D) when f_w(x) is at or near a minimum for all the values of x in the training set

B) when the cost J is at or near a minimum

For linear regression, the model is f_wb(x) = wx + b. Which of the following are the inputs, or features, that are fed into the model and with which the model is expected to make a prediction? A) m B) x C) w and b D) (x,y)

B) x

In the training set, Figure 3, what is x_4^(3)? A) 45 B) 40 C) 30 D) 36

C) 30

(Figure 5) In the class, "cost" and "loss" have distinct meanings. Which one applies to a single training example? A) Cost B) Neither loss nor cost C) Loss D) Both loss and cost

C) Loss

Figure 1 is the example of dataset, we call it 'data.csv'. Please use the function from pandas to collect all the columns excluding the last column. hint: pandas allows us to import dataset and create the matrix import pandas as pd dataset = pd.read_csv('data.csv') please select the following program that can construct a matrix 'X' contains all the first three columns A) X = dataset.iloc[:,1:3].values B) X = dataset.iloc[:, :].values C) X= dataset.iloc[:, :-1].values D) X= dataset.iloc[:-1, :].values

C) X= dataset.iloc[:, :-1].values

Which of these is a type of unsupervised learning? A) classification B) regression C) clustering

C) clustering

For linear regression, the model is f_wb(x) = wx + b. Which of the following is the output or "target" variable? A) y hat B) m C) y D) x

C) y

import numpy as np a = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]) b = np.array ([1,1,2,0]) c = a[np.arange(4), b] + 10 print(c) A) [12 16 20] B) [11 15 20 23] C) [11 15 21 23] D) [12 16 21 23]

D) [12 16 21 23]


संबंधित स्टडी सेट्स

Module 2.1: Mass Storage Devices

View Set

ACCT 2301 - Final Review (draft)

View Set