text "which object it contains. in each case, the model returns a vector of size n that contains the probabilities of the n categories. 1.1.2 inputs the input data in figure 1.2 varies widely. in the house pricing example, the input is a fixed-length vector containing values that characterize the property. this is an example of tabular data because it has no internal structure; if we change the order of the inputs and build a new model, then we expect the model prediction to remain the same. conversely, the input in the restaurant review example is a body of text. this may be of variable length depending on the number of words in the review, and here input this work is subject to a creative commons cc-by-nc-nd license. (c) mit press.1.1 supervised learning 3 figure1.2regressionandclassificationproblems. a)thisregressionmodeltakes a vector of numbers that characterize a property and predicts its price. b) this multivariate regression model takes the structure of a chemical molecule and predictsitsmeltingandboilingpoints. c)thisbinaryclassificationmodeltakesa restaurantreviewandclassifiesitaseitherpositiveornegative. d)thismulticlass classificationproblemassignsasnippetofaudiotooneofn genres. e)asecond multiclassclassificationprobleminwhichthemodelclassifiesanimageaccording to which of n possible objects it might contain. draft: please send errata to udlbookmail@gmail.com.4 1 introduction figure1.3machinelearningmodel. themodelrepresentsafamilyofrelationships thatrelatetheinput(ageofchild)totheoutput(heightofchild). theparticular relationship is chosen using training data, which consists of input/output pairs (orange points). when we train the model, we search through the possible re- lationships for one that describes the data well. here, the trained model is the cyan curve and can be used to compute the height for any age. order is important; my wife ate the chicken is not the same as the chicken ate my wife. the text must be encoded into numerical form before passing it to the model. here, we use a fixed vocabulary of size 10,000 and simply concatenate the word indices. forthemusicclassificationexample, theinputvectormightbeoffixedsize(perhaps a 10-second clip) but is very high-dimensional. digital audio is usually sampled at 44.1 khzandrepresentedby16-bitintegers, soaten-secondclipconsistsof441,000integers. clearly, supervised learning models will have to be able to process sizeable inputs. the inputintheimageclassificationexample(whichconsistsoftheconcatenatedrgbvalues at every pixel) is also enormous. moreover, its structure is naturally two-dimensional; twopixelsaboveandbelowoneanotherarecloselyrelated, eveniftheyarenotadjacent in the input vector. finally,considertheinputforthemodelthatpredictsthemeltingandboilingpoints ofthemolecule. amoleculemaycontainvaryingnumbersofatomsthatcanbeconnected in different ways. in this case, the model must ingest both the geometric structure of the molecule and the constituent atoms to the model. 1.1.3 machine learning models untilnow,wehavetreatedthemachinelearningmodelasablackboxthattakesaninput vector and returns an output vector. but what exactly is in this black box? consider a model to predict the height of a child from their age (figure 1.3). the machine learning this work is subject to a creative commons cc-by-nc-nd license. (c) mit press.1.1 supervised learning 5 model is a mathematical equation that describes how the average height varies as a function of age (cyan curve in figure 1.3). when we run the age through this equation, itreturnstheheight. forexample, iftheageis10years, thenwepredictthattheheight will be 139 cm. more precisely, the model represents a family of equations mapping the input to the output (i.e., a family of different cyan curves). the particular equation (curve) is chosen using training data (examples of input/output pairs). in figure 1.3, these pairs arerepresentedbytheorangepoints,andwecanseethatthemodel(cyanline)describes thesedatareasonably. whenwetalkabouttrainingorfittingamodel, wemeanthatwe"