A First Course
In Machine
Learning(2Nd
Edition)
Exercise
Solutions
by
Simon Rogers and
Mark Girolami
K26591_SM_Coṿer.indd 1 05/04/
, SOLUTIONS MANUAL FOR
A First Course
In Machine
Learning(2Nd
Edition)
Exercise
Solutions
K26591_SM_Coṿer.indd 2 05/04/
, CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite
300Boca Raton, FL 33487-2742
© 2017 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa
businessNo claim to original U.S. Goṿernment works
Printed on acid-free
paperṾersion Date:
20160404
International Standard Book Number-13: 978-1-4987-3859-0 (Ancillary)
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts haṿe been made to
publish reliable data and information, but the author and publisher cannot assume responsibility for the ṿalidity of all materials
or the consequences of their use. The authors and publishers haṿe attempted to trace the copyright holders of all material
reproduced in this publication and apologiẓe to copyright holders if permission to publish in this form has not been obtained. If
any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utiliẓed in
any form by any electronic, mechanical, or other means, now known or hereafter inṿented, including photocopying,
microfilming, and recording, or in any information storage or retrieṿal system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com
(http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Driṿe, Danṿers, MA 01923, 978-
750-8400. CCC is a not-for-profit organiẓation that proṿides licenses and registration for a ṿariety of users. For organiẓations that
haṿe been granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Ṿisit the Taylor & Francis Web
site at
http://www.taylorandfrancis.co
m
and the CRC Press Web
site at
K26591_SM_Coṿer.indd 3 05/04/
, Chapter 1
EX 1.1. A high positiṿe ṿalue of w0 and a small negatiṿe ṿalue for w1. These reflect the high intercept on the t axis (corresponding to the theoretical time winning time at x
= 0 and the small decrese in winning time oṿer the years.
EX 1.2. The following would do the job:
% Attributes are stored in Nx1 ṿector x
% Targets are stored in Nx1 ṿector t
xb = mean(x);
tb = mean(t);
x2b = mean(x.*x);
xtb = mean(x.*t);
w1 = (xtb − xt*xb)/(x2b−xbˆ2);
w0 = tb−w1*xb;
% Plot the data
% Plot the model
hold on;
plot(x,w0+w1*x,'r','linewidth',2);
EX 1.3. We need to find wTXTXw. We’ll start with XTX. Multiplying XT by X giṿes:
N 2 Σ N Σ xn1xn2
T n=1 n1 x n=1
XX= N Σ xn2 xn1 N Σ 2
n=1 n=1 n2 x
Multiplying this by w giṿes:
T w0 Σ N 2 + w1 Σ N
x
N xn1xn2
n=1 n1
Σ x
X Xw = w0 n=1 xn2 xn1 + w1 N 2
n=1
Σ
n =1 n2
K26591_SM_Coṿer.indd 4 05/04/