# SD212 HW 33

## [name] Type your name on the next line


## [Q1]

> How much did you read carefully?
>
> a)  The entire chapter
> b)  The beginning up to the last section on digit recognition
> c)  Some of it
> d)  None of it too carefully
>
> (Answer with just the letter of your choice.)


## [Q2]

> What does each *row* of the input array to a machine learning
>
> model represent?
>
> a)  The algorithm parameters
> b)  The algorithm hyperparameters
> c)  A single observation or sample
> d)  A single feature or attribute
> e)  The labels for each observation


## [Q3]

> What does each *column* represent?
>
> a)  The algorithm parameters
> b)  The algorithm hyperparameters
> c)  A single observation or sample
> d)  A single feature or attribute
> e)  The labels for each observation


## [Q4]

> Suppose I have three variables:
>
> *   A 2D array `tested` containing information about a bunch of
>     drugs that have been tested in the lab,
> *   A 1D array `results` with an indication (1 or 0) on whether each
>     tested drug was effective, and
> *   Another 2D array `untested` containing the same information
>     about a few drugs that haven't been tried out yet.
>
> We want to use machine learning to predict whether each untested
> drug will be effective.
>
> What kind of machine learning problem is this?
>
> (Select all letters that apply.)
>
> a)  Supervised learning
> b)  Unsupervised learning
> c)  Classification
> d)  Regression
> e)  Clustering


## [Q5]

> In the same setup as the previous problem, complete the code below
>
> that would actually do it. There are three missing steps; for the
> next three problems, you select which line of code should go in
> for each step.
>
> Here is the incomplete code:
>
>     from sklearn.naive_bayes import GaussianNB
>     tested = ... # big 2D array of numbers
>     results = ... # 1D array of 1/0
>     untested = ... # smaller 2D array of numbers
>
>     # QUESTION 4 step
>     # QUESTION 5 step
>     # QUESTION 6 step
>
>     print(predictions)
>
> What line of code should be filled in for `QUESTION 4 STEP`?
>
> a)  `model = GaussianNB()`
> b)  `fit = naive_bayes()`
> c)  `model = np.linspace(-1, 11)`
> d)  `model = PCA(n_components=2)`


## [Q6]

> What line of code should be filled in for `QUESTION 5 STEP`?
>
> a)  `model.fit(tested)`
> b)  `fit.model(results)`
> c)  `model.fit(tested, untested)`
> d)  `model.fit(tested, results)`
> e)  `model.fit(untested, tested)`


## [Q7]

> What line of code should be filled in for `QUESTION 6 STEP`?
>
> a)  `predictions = model.labels_`
> b)  `predictions = fit.predict(results)`
> c)  `predictions = fit.predict(untested, results)`
> d)  `predictions = model.predict(untested)`
> e)  `predictions = model.predict(results)`


