100% found this document useful (3 votes)
155 views

Machine Learning Design Patterns Solutions to Common Challenges in Data Preparation Model Building and MLOps 1st Edition Valliappa Lakshmanan Sara Robinson Michael Munn download pdf

Challenges

Uploaded by

rukiaolmoskn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
155 views

Machine Learning Design Patterns Solutions to Common Challenges in Data Preparation Model Building and MLOps 1st Edition Valliappa Lakshmanan Sara Robinson Michael Munn download pdf

Challenges

Uploaded by

rukiaolmoskn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Machine Learning Design Patterns Solutions to


Common Challenges in Data Preparation Model
Building and MLOps 1st Edition Valliappa
Lakshmanan Sara Robinson Michael Munn
https://textbookfull.com/product/machine-learning-design-
patterns-solutions-to-common-challenges-in-data-preparation-
model-building-and-mlops-1st-edition-valliappa-lakshmanan-
sara-robinson-michael-munn/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Machine Learning Design Patterns Solutions to Common


Challenges in Data Preparation Model Building and MLOps
Valliappa Lakshmanan
https://textbookfull.com/product/machine-learning-design-patterns-
solutions-to-common-challenges-in-data-preparation-model-building-and-
mlops-valliappa-lakshmanan/
textboxfull.com

Data Science on the Google Cloud Platform 1st Edition


Valliappa Lakshmanan

https://textbookfull.com/product/data-science-on-the-google-cloud-
platform-1st-edition-valliappa-lakshmanan/

textboxfull.com

Practical Python Design Patterns: Pythonic Solutions to


Common Problems Badenhorst

https://textbookfull.com/product/practical-python-design-patterns-
pythonic-solutions-to-common-problems-badenhorst/

textboxfull.com

Kubernetes for MLOps Scaling Enterprise Machine Learning


Deep Learning and AI 2nd Edition Sam Charrington

https://textbookfull.com/product/kubernetes-for-mlops-scaling-
enterprise-machine-learning-deep-learning-and-ai-2nd-edition-sam-
charrington/
textboxfull.com
Design Patterns by Tutorials Learning design patterns in
Swift 4 2 Joshua Greene

https://textbookfull.com/product/design-patterns-by-tutorials-
learning-design-patterns-in-swift-4-2-joshua-greene/

textboxfull.com

Design Patterns by Tutorials Third Edition Learning Design


Patterns in Swift Raywenderlich Tutorial Team

https://textbookfull.com/product/design-patterns-by-tutorials-third-
edition-learning-design-patterns-in-swift-raywenderlich-tutorial-team/

textboxfull.com

Hands On Unsupervised Learning Using Python How to Build


Applied Machine Learning Solutions from Unlabeled Data 1st
Edition Ankur A. Patel
https://textbookfull.com/product/hands-on-unsupervised-learning-using-
python-how-to-build-applied-machine-learning-solutions-from-unlabeled-
data-1st-edition-ankur-a-patel/
textboxfull.com

Data Science Solutions on Azure: Tools and Techniques


Using Databricks and MLOps Julian Soh

https://textbookfull.com/product/data-science-solutions-on-azure-
tools-and-techniques-using-databricks-and-mlops-julian-soh/

textboxfull.com

Data Processing with Optimus: Supercharge big data


preparation tasks for analytics and machine learning with
Optimus using Dask and PySpark Leon
https://textbookfull.com/product/data-processing-with-optimus-
supercharge-big-data-preparation-tasks-for-analytics-and-machine-
learning-with-optimus-using-dask-and-pyspark-leon/
textboxfull.com
1. Preface

a. Who Is This Book For?


b. What’s Not in the Book
c. Code Samples
d. Conventions Used in This Book
e. O’Reilly Online Learning
f. How to Contact Us
g. Acknowledgments

2. 1. The Need for Machine Learning Design Patterns


a. What Are Design Patterns?
b. How to Use This Book
c. Machine Learning Terminology

i. Models and Frameworks


ii. Data and Feature Engineering
iii. The Machine Learning Process
iv. Data and Model Tooling
v. Roles
d. Common Challenges in Machine Learning
i. Data Quality
ii. Reproducibility
iii. Data Drift
iv. Scale
v. Multiple Objectives

e. Summary

3. 2. Data Representation Design Patterns


a. Simple Data Representations

i. Numerical Inputs
ii. Categorical Inputs
b. Design Pattern 1: Hashed Feature

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

c. Design Pattern 2: Embeddings

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

d. Design Pattern 3: Feature Cross


i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
e. Design Pattern 4: Multimodal Input

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
f. Summary

4. 3. Problem Representation Design Patterns

a. Design Pattern 5: Reframing

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

b. Design Pattern 6: Multilabel


i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

c. Design Pattern 7: Ensembles

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

d. Design Pattern 8: Cascade


i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
e. Design Pattern 9: Neutral Class
i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

f. Design Pattern 10: Rebalancing


i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

g. Summary

5. 4. Model Training Patterns


a. Typical Training Loop

i. Stochastic Gradient Descent


ii. Keras Training Loop
iii. Training Design Patterns

b. Design Pattern 11: Useful Overfitting

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
c. Design Pattern 12: Checkpoints

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

d. Design Pattern 13: Transfer Learning

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

e. Design Pattern 14: Distribution Strategy

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

f. Design Pattern 15: Hyperparameter Tuning

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

g. Summary
6. 5. Design Patterns for Resilient Serving

a. Design Pattern 16: Stateless Serving Function


i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
b. Design Pattern 17: Batch Serving

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
c. Design Pattern 18: Continued Model Evaluation

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
d. Design Pattern 19: Two-Phase Predictions

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

e. Design Pattern 20: Keyed Predictions

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
f. Summary
7. 6. Reproducibility Design Patterns

a. Design Pattern 21: Transform


i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

b. Design Pattern 22: Repeatable Splitting

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

c. Design Pattern 23: Bridged Schema


i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

d. Design Pattern 24: Windowed Inference


i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

e. Design Pattern 25: Workflow Pipeline

i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives

f. Design Pattern 26: Feature Store


i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
g. Design Pattern 27: Model Versioning

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

h. Summary

8. 7. Responsible AI
a. Design Pattern 28: Heuristic Benchmark

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
b. Design Pattern 29: Explainable Predictions

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives

c. Design Pattern 30: Fairness Lens

i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
d. Summary

9. 8. Connected Patterns
a. Patterns Reference
b. Pattern Interactions
c. Patterns Within ML Projects
i. ML Life Cycle
ii. AI Readiness
d. Common Patterns by Use Case and Data Type

i. Natural Language Understanding


ii. Computer Vision
iii. Predictive Analytics
iv. Recommendation Systems
v. Fraud and Anomaly Detection

10. Index
Machine Learning Design
Patterns
Solutions to Common Challenges in Data
Preparation, Model Building, and MLOps

Valliappa Lakshmanan, Sara Robinson, and


Michael Munn
Machine Learning Design Patterns

by Valliappa Lakshmanan, Sara Robinson, and Michael Munn

Copyright © 2021 Valliappa Lakshmanan, Sara Robinson, and Michael


Munn. All rights reserved.

Printed in the United States of America.

Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,


Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales


promotional use. Online editions are also available for most titles
(http://oreilly.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.

Acquisitions Editor: Rebecca Novack Indexer: nSight, Inc.

Developmental Editor: Corbin Collins Interior Designer: David Futato

Production Editor: Beth Kelly Cover Designer: Karen Montgomery

Copyeditor: Charles Roumeliotis Illustrator: Kate Dullea

Proofreader: Holly Bauer Forsyth

October 2020: First Edition


Revision History for the First Edition
2020-10-15: First Release

See http://oreilly.com/catalog/errata.csp?isbn=9781098115784 for


release details.

The O’Reilly logo is a registered trademark of O’Reilly Media, Inc.


Machine Learning Design Patterns, the cover image, and related trade
dress are trademarks of O’Reilly Media, Inc.

The views expressed in this work are those of the authors, and do not
represent the publisher’s views. While the publisher and the authors have
used good faith efforts to ensure that the information and instructions
contained in this work are accurate, the publisher and the authors disclaim
all responsibility for errors or omissions, including without limitation
responsibility for damages resulting from the use of or reliance on this
work. Use of the information and instructions contained in this work is at
your own risk. If any code samples or other technology this work contains
or describes is subject to open source licenses or the intellectual property
rights of others, it is your responsibility to ensure that your use thereof
complies with such licenses and/or rights.

978-1-098-11578-4

[LSI]
Preface
Who Is This Book For?
Introductory machine learning books usually focus on the what and how of
machine learning (ML). They then explain the mathematical aspects of
new methods from AI research labs and teach how to use AI frameworks
to implement these methods. This book, on the other hand, brings together
hard-earned experience around the “why” that underlies the tips and tricks
that experienced ML practitioners employ when applying machine
learning to real-world problems.

We assume that you have prior knowledge of machine learning and data
processing. This is not a fundamental textbook on machine learning.
Instead, this book is for you if you are a data scientist, data engineer, or
ML engineer who is looking for a second book on practical machine
learning. If you already know the basics, this book will introduce you to a
catalog of ideas, some of which you (an ML practitioner) may recognize,
and give those ideas a name so that you can confidently reach for them.

If you are a computer science student headed for a job in industry, this
book will round out your knowledge and prepare you for the professional
world. It will help you learn how to build high-quality ML systems.

What’s Not in the Book


This is a book that is primarily for ML engineers in the enterprise, not ML
scientists in academia or industry research labs.

We purposefully do not discuss areas of active research—you will find


very little here, for example, on machine learning model architecture
(bidirectional encoders, or the attention mechanism, or short-circuit layers,
for example) because we assume that you will be using a pre-built model
architecture (such as ResNet-50 or GRUCell), not writing your own image
classification or recurrent neural network.

Here are some concrete examples of areas that we intentionally stay away
from because we believe that these topics are more appropriate for college
courses and ML researchers:

ML algorithms
We do not cover the differences between random forests and neural
networks, for example. This is covered in introductory machine
learning textbooks.

Building blocks
We do not cover different types of gradient descent optimizers or
activation functions. We recommend using Adam and ReLU—in our
experience, the potential for improvements in performance by making
different choices in these sorts of things tends to be minor.

ML model architectures
If you are doing image classification, we recommend that you use an
off-the-shelf model like ResNet or whatever the latest hotness is at the
time you are reading this. Leave the design of new image classification
or text classification models to researchers who specialize in this
problem.

Model layers
You won’t find convolutional neural networks or recurrent neural
You won’t find convolutional neural networks or recurrent neural
networks in this book. They are doubly disqualified—first, for being a
building block and second, for being something you can use off-the-
shelf.

Custom training loops


Just calling model.fit() in Keras will fit the needs of
practitioners.

In this book, we have tried to include only common patterns of the kind
that machine learning engineers in enterprises will employ in their day-to-
day work.

As an analogy, consider data structures. While a college course on data


structures will delve into the implementations of different data structures,
and a researcher on data structures will have to learn how to formally
represent their mathematical properties, the practitioner can be more
pragmatic. An enterprise software developer simply needs to know how to
work effectively with arrays, linked lists, maps, sets, and trees. It is for a
pragmatic practitioner in machine learning that this book is written.

Code Samples
We provide code for machine learning (sometimes in Keras/TensorFlow,
and other times in scikit-learn or BigQuery ML) and data processing (in
SQL) as a way to show how the techniques we are discussing are
implemented in practice. All the code that is referenced in the book is part
of our GitHub repository, where you will find fully working ML models.
We strongly encourage you to try out those code samples.
The code is secondary in importance to the concepts and techniques being
covered. Our aim has been that the topic and principles should remain
relevant regardless of changes to TensorFlow or Keras, and we can easily
imagine updating the GitHub repository to include other ML frameworks,
for example, while keeping the book text unchanged. Therefore, the book
should be equally informative if your primary ML framework is PyTorch
or even a non-Python framework like H20.ai or R. Indeed, we welcome
your contributions to the GitHub repository of implementations of one or
more of these patterns in your favorite ML framework.

If you have a technical question or a problem using the code examples,


please send email to bookquestions@oreilly.com.

This book is here to help you get your job done. In general, if example
code is offered with this book, you may use it in your programs and
documentation. You do not need to contact us for permission unless
you’re reproducing a significant portion of the code. For example, writing
a program that uses several chunks of code from this book does not
require permission. Selling or distributing examples from O’Reilly books
does require permission. Answering a question by citing this book and
quoting example code does not require permission. Incorporating a
significant amount of example code from this book into your product’s
documentation does require permission.

We appreciate, but generally do not require, attribution. An attribution


usually includes the title, author, publisher, and ISBN. For example:
“Machine Learning Design Patterns by Valliappa Lakshmanan, Sara
Robinson, and Michael Munn (O’Reilly). Copyright 2021 Valliappa
Lakshmanan, Sara Robinson, and Michael Munn, 978-1-098-11578-4.” If
you feel your use of code examples falls outside fair use or the permission
given above, feel free to contact us at permissions@oreilly.com.

Conventions Used in This Book


The following typographical conventions are used in this book:

Italic
Indicates new terms, URLs, email addresses, filenames, and file
extensions.

Constant width
Used for program listings, as well as within paragraphs to refer to
program elements such as variable or function names, databases, data
types, environment variables, statements, and keywords.

Constant width bold


Shows commands or other text that should be typed literally by the
user.

Constant width italic


Shows text that should be replaced with user-supplied values or by
values determined by context.

TIP
This element signifies a tip or suggestion.

NOTE
This element signifies a general note.
WARNING
This element indicates a warning or caution.

O’Reilly Online Learning

NOTE
For more than 40 years, O’Reilly Media has provided technology and business training,
knowledge, and insight to help companies succeed.

Our unique network of experts and innovators share their knowledge and
expertise through books, articles, and our online learning platform.
O’Reilly’s online learning platform gives you on-demand access to live
training courses, in-depth learning paths, interactive coding environments,
and a vast collection of text and video from O’Reilly and 200+ other
publishers. For more information, visit http://oreilly.com.

How to Contact Us
Please address comments and questions concerning this book to the
publisher:

O’Reilly Media, Inc.

1005 Gravenstein Highway North

Sebastopol, CA 95472

800-998-9938 (in the United States or Canada)


707-829-0515 (international or local)

707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any
additional information. You can access this page at https://oreil.ly/MLDP.

Email bookquestions@oreilly.com to comment or ask technical questions


about this book.

For news and information about our books and courses, visit
http://oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://youtube.com/oreillymedia

Acknowledgments
A book like this would not be possible without the generosity of numerous
Googlers, especially our colleagues in the Cloud AI, Solution Engineering,
Professional Services, and Developer Relations teams. We are grateful to
them for letting us observe, analyze, and question their solutions to the
challenging problems they encountered in training, improving, and
operationalizing ML models. Thanks to our managers, Karl Weinmeister,
Steve Cellini, Hamidou Dia, Abdul Razack, Chris Hallenbeck, Patrick
Cole, Louise Byrne, and Rochana Golani for fostering the spirit of
openness within Google, giving us the freedom to catalog these patterns,
and publish this book.
Salem Haykal, Benoit Dherin, and Khalid Salama reviewed every pattern
and every chapter. Sal pointed out nuances we had missed, Benoit
narrowed down our claims, and Khalid pointed us to relevant research.
This book would be nowhere near as good without your inputs. Thank
you! Amy Unruh, Rajesh Thallam, Robbie Haertel, Zhitao Li, Anusha
Ramesh, Ming Fang, Parker Barnes, Andrew Zaldivar, James Wexler,
Andrew Sellergren, and David Kanter reviewed parts of this book that
align with their areas of expertise and made numerous suggestions on how
the near-term roadmap would affect our recommendations. Nitin
Aggarwal and Matthew Yeager brought a reader’s eye to the manuscript
and improved its clarity. Special thanks to Rajesh Thallam for prototyping
the design of the very last figure in Chapter 8. Any errors that remain are
ours, of course.

O’Reilly is the publisher of choice for technical books, and the


professionalism of our team illustrates why. Rebecca Novak shepherded
us through putting together a compelling outline, Kristen Brown managed
the entire content development with aplomb, Corbin Collins gave us
helpful guidance at every stage, Elizabeth Kelly was a delight to work
with during production, and Charles Roumeliotis brought a sharp eye to
the copyediting. Thanks for all your help!

Michael: Thanks to my parents for always believing in me and


encouraging my interests, both academic and otherwise. You will be able
to appreciate as much as I do the surreptitious cover. To Phil, thank you
for patiently bearing with my less-than-bearable schedule while working
on this book. Now, I’mma be asleep.

Sara: Jon—you’re a big reason this book exists. Thank you for
encouraging me to write this, for always knowing how to make me laugh,
appreciating my weirdness, and for believing in me especially when I
didn’t. To my parents, thank you for being my biggest fans since day one
and encouraging my love of technology and writing for as long as I can
remember. To Ally, Katie, Randi, and Sophie—thank you for being a
constant source of light and laughter in these uncertain times.

Lak: I took on this book thinking I’d get to work on it while waiting in
airports. COVID-19 made it so that much of the work was done at home.
Thanks Abirami, Sidharth, and Sarada for all your forbearance as I
hunkered down to write yet again. More hikes on weekends now!

The three of us are donating 100% of the royalties from this book to Girls
Who Code, an organization whose mission is to build a large pipeline of
future female engineers. Diversity, equity, and inclusion are particularly
important in machine learning to ensure that AI models don’t perpetuate
existing biases in human society.
Chapter 1. The Need for
Machine Learning Design
Patterns

In engineering disciplines, design patterns capture best practices and


solutions to commonly occurring problems. They codify the knowledge
and experience of experts into advice that all practitioners can follow. This
book is a catalog of machine learning design patterns that we have
observed in the course of working with hundreds of machine learning
teams.

What Are Design Patterns?


The idea of patterns, and a catalog of proven patterns, was introduced in
the field of architecture by Christopher Alexander and five coauthors in a
hugely influential book titled A Pattern Language (Oxford University
Press, 1977). In their book, they catalog 253 patterns, introducing them
this way:

Each pattern describes a problem which occurs over and over again in
our environment, and then describes the core of the solution to that
problem, in such a way that you can use this solution a million times
over, without ever doing it the same way twice.

Each solution is stated in such a way that it gives the essential field of
relationships needed to solve the problem, but in a very general and
abstract way—so that you can solve the problem for yourself, in your
own way, by adapting it to your preferences, and the local conditions at
the place where you are making it.

For example, a couple of the patterns that incorporate human details when
building a home are Light on Two Sides of Every Room and Six-Foot
Balcony. Think of your favorite room in your home, and your least-
favorite room. Does your favorite room have windows on two walls?
What about your least-favorite room? According to Alexander:

Rooms lit on two sides, with natural light, create less glare around
people and objects; this lets us see things more intricately; and most
important, it allows us to read in detail the minute expressions that
flash across people’s faces….

Having a name for this pattern saves architects from having to continually
rediscover this principle. Yet where and how you get two light sources in
any specific local condition is up to the architect’s skill. Similarly, when
designing a balcony, how big should it be? Alexander recommends 6 feet
by 6 feet as being enough for 2 (mismatched!) chairs and a side table, and
12 feet by 12 feet if you want both a covered sitting space and a sitting
space in the sun.

Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides brought
the idea to software by cataloging 23 object-oriented design patterns in a
1994 book entitled Design Patterns: Elements of Reusable Object-
Oriented Software (Addison-Wesley, 1995). Their catalog includes
patterns such as Proxy, Singleton, and Decorator and led to lasting impact
on the field of object-oriented programming. In 2005 the Association of
Computing Machinery (ACM) awarded their annual Programming
Languages Achievement Award to the authors, recognizing the impact of
their work “on programming practice and programming language design.”
Building production machine learning models is increasingly becoming an
engineering discipline, taking advantage of ML methods that have been
proven in research settings and applying them to business problems. As
machine learning becomes more mainstream, it is important that
practitioners take advantage of tried-and-proven methods to address
recurring problems.

One benefit of our jobs in the customer-facing part of Google Cloud is that
it brings us in contact with a wide variety of machine learning and data
science teams and individual developers from around the world. At the
same time, we each work closely with internal Google teams solving
cutting-edge machine learning problems. Finally, we have been fortunate
to work with the TensorFlow, Keras, BigQuery ML, TPU, and Cloud AI
Platform teams that are driving the democratization of machine learning
research and infrastructure. All this gives us a rather unique perspective
from which to catalog the best practices we have observed these teams
carrying out.

This book is a catalog of design patterns or repeatable solutions to


commonly occurring problems in ML engineering. For example, the
Transform pattern (Chapter 6) enforces the separation of inputs, features,
and transforms and makes the transformations persistent in order to
simplify moving an ML model to production. Similarly, Keyed
Predictions, in Chapter 5, is a pattern that enables the large-scale
distribution of batch predictions, such as for recommendation models.

For each pattern, we describe the commonly occurring problem that is


being addressed and then walk through a variety of potential solutions to
the problem, the trade-offs of these solutions, and recommendations for
choosing between these solutions. Implementation code for these solutions
is provided in SQL (useful if you are carrying out preprocessing and other
ETL in Spark SQL, BigQuery, and so on), scikit-learn, and/or Keras with
a TensorFlow backend.

How to Use This Book


This is a catalog of patterns that we have observed in practice, among
multiple teams. In some cases, the underlying concepts have been known
for many years. We don’t claim to have invented or discovered these
patterns. Instead, we hope to provide a common frame of reference and set
of tools for ML practitioners. We will have succeeded if this book gives
you and your team a vocabulary when talking about concepts that you
already incorporate intuitively into your ML projects.

We don’t expect you to read this book sequentially (although you can!).
Instead, we anticipate that you will skim through the book, read a few
sections more deeply than others, reference the ideas in conversations with
colleagues, and refer back to the book when faced with problems you
remember reading about. If you plan to skip around, we recommend that
you start with Chapter 1 and Chapter 8 before dipping into individual
patterns.

Each pattern has a brief problem statement, a canonical solution, an


explanation of why the solution works, and a many-part discussion on
tradeoffs and alternatives. We recommend that you read the discussion
section with the canonical solution firmly in mind, so as to compare and
contrast. The pattern description will include code snippets taken from the
implementation of the canonical solution. The full code can be found in
our GitHub repository. We strongly encourage you to peruse the code as
you read the pattern description.
Machine Learning Terminology
Because machine learning practitioners today may have different areas of
primary expertise—software engineering, data analysis, DevOps, or
statistics—there can be subtle differences in the way that different
practitioners use certain terms. In this section, we define terminology that
we use throughout the book.

Models and Frameworks


At its core, machine learning is a process of building models that learn
from data. This is in contrast to traditional programming where we write
explicit rules that tell programs how to behave. Machine learning models
are algorithms that learn patterns from data. To illustrate this point,
imagine we are a moving company and need to estimate moving costs for
potential customers. In traditional programming, we might solve this with
an if statement:

if num_bedrooms == 2 and num_bathrooms == 2:


estimate = 1500
elif num_bedrooms == 3 and sq_ft > 2000:
estimate = 2500

You can imagine how this will quickly get complicated as we add more
variables (number of large furniture items, amount of clothing, fragile
items, and so on) and try to handle edge cases. More to the point, asking
for all this information ahead of time from customers can cause them to
abandon the estimation process. Instead, we can train a machine learning
model to estimate moving costs based on past data on previous households
our company has moved.

Throughout the book, we primarily use feed-forward neural network


models in our examples, but we’ll also reference linear regression models,
decision trees, clustering models, and others. Feed-forward neural
networks, which we will commonly shorten as neural networks, are a type
of machine learning algorithm whereby multiple layers, each with many
neurons, analyze and process information and then send that information
to the next layer, resulting in a final layer that produces a prediction as
output. Though they are in no way identical, neural networks are often
compared to the neurons in our brain because of the connectivity between
nodes and the way they are able to generalize and form new predictions
from the data they process. Neural networks with more than one hidden
layer (layers other than the input and output layer) are classified as deep
learning (see Figure 1-1).

Machine learning models, regardless of how they are depicted visually, are
mathematical functions and can therefore be implemented from scratch
using a numerical software package. However, ML engineers in industry
tend to employ one of several open source frameworks designed to
provide intuitive APIs for building models. The majority of our examples
will use TensorFlow, an open source machine learning framework created
by Google with a focus on deep learning models. Within the TensorFlow
library, we’ll be using the Keras API in our examples, which can be
imported through tensorflow.keras. Keras is a higher-
level API for building neural networks. While Keras
supports many backends, we’ll be using its TensorFlow backend. In other
examples, we’ll be using scikit-learn, XGBoost, and PyTorch, which are
other popular open source frameworks that provide utilities for preparing
your data, along with APIs for building linear and deep models. Machine
learning continues to become more accessible, and one exciting
development is the availability of machine learning models that can be
expressed in SQL. We’ll use BigQuery ML as an example of this,
Random documents with unrelated
content Scribd suggests to you:
[235] Mr. Fox had been lent Chiswick House by the Duke of
Devonshire, and was moved there at the end of July.
[236] Near Malmesbury, in Wilts.
[237] The funeral was fixed for October 10, by a curious
coincidence the anniversary of his first election for Westminster.
[238] The new appointments were, Lord Howick, Secretary of
State for Foreign Affairs; Mr. T. Grenville, Admiralty, in place of
Lord Howick; Mr. Tierney, President of Board of Control, in
succession to Mr. Grenville; Lord Sidmouth, President of the
Council, in place of Lord Fitzwilliam; and Lord Holland, Lord Privy
Seal, in place of Lord Sidmouth.
[239] Lord Holland states fully his reasons for accepting office
in a letter to Lord Lauderdale, dated September 22. It is
published in Memoirs of the Whig Party, ii. 53.
[240] Early in March Murat was given the Duchy of Berg and
Cleves, ceded to Napoleon by Bavaria, and other territories
claimed by Prussia were occupied by French troops a month later
—this without any communication to the Prussian Cabinet.
These and other arbitrary actions, following closely on the
formation of the Confederation of the Rhine, opened the eyes of
the Prussians to the true policy of the French Emperor, but the
final blow to their amour propre was the discovery of their
Ambassador in France, Lucchesini, that Napoleon had cheated
them over Hanover, by his willingness to restore it to England,
and that he threw no obstacles in the way of the immediate re-
establishment of the Kingdom of Poland.
[241] Prince Louis Ferdinand, nephew of Frederick the Great,
was born in 1772. He served with distinction against Napoleon
and was killed at Saalfeld in 1806 in command of the advance
guard.
[242] ‘They want ordnance, and yet would begin by spiking
one of their great guns.’ Lord Holland relates this as another
remark of Windham’s upon the proposal.
[243] Sir Home Popham’s expedition to South America, where
he effected the capture of Buenos Ayres on June 28. He had been
originally despatched to the Cape of Good Hope, where he met
with complete success and annexed that colony to the British
Empire. Fired with this triumph he made his way to the Rio Plate,
without any instructions from Government, who on hearing of his
destination took steps to stop him, but their orders arrived too
late. Buenos Ayres remained in his hands until August 4, when it
was retaken by the Spaniards, with severe loss to the British.
[244] Lord Morpeth was sent to Berlin to offer the assistance
of England conditionally upon the immediate restoration of
Hanover. He arrived at headquarters two days before the battle of
Jena, and found Haugwitz, with whom he was to negotiate,
unwilling to meet him in any way. The intriguing Prussian still
hoped to retain Hanover, and expected after the battle to be able
to say so. The result, however, was contrary to his expectations,
and as no diplomatic negotiations were possible in the confusion
after the battle Lord Morpeth returned to London.
[245] Bartholomew Frere (1778–1851), a younger brother of
John Hockham Frere, and son of John Frere, M.P. for Norwich. He
was Secretary of Legation to his brother in Spain and held various
minor diplomatic posts.
[246] M. Jacobi, the Prussian Minister, had left England when
diplomatic relations between the two countries were broken off in
the spring. He passed Lord Morpeth on the sea, and reached
England early in October.
[247] In the interval which elapsed since Lady Holland’s last
entry in her journal the whole position of Europe had again
changed. The Prussian army, decimated in one day at Jena and
Auerstadt, had practically ceased to exist; Frederick William was a
fugitive at the eastern end of his dominions in Königsberg.
Napoleon had occupied Berlin, and in two months had become
master of many of the Prussian fortresses, which it should have
taken him years to reduce. Lucchesini in the course of his
negotiations for peace in Berlin was even ready to give up those
strongholds which had not surrendered, but the patriotic party
were too strong to allow the King to consent to further ignominy.
Russia was prepared to give her assistance, and this nerved
Frederick William to continue the war. Haugwitz resigned, but the
King rendered this lucky event ineffective by also dismissing
Count Stein, the only really able man in his councils.
[248] War was formally declared between Russia and the Porte
towards the end of December.
[249] Gustavus IV. succeeded, at the age of fourteen, to the
crown of Sweden after his father’s assassination in 1792. His
hatred of Napoleon and inclination towards an English alliance
were the leading features of his reign—features to which he so
obstinately adhered as to cause his country much unrest and
suffering, and his own downfall. He was deposed in 1809 in
favour of his uncle.
[250] The dissolution took place in October, and the new
Parliament met on December 15. Tierney was defeated at
Southwark by Sir Thomas Turton. He obtained a seat, however, at
Athlone.
[251] Sir Samuel Auchmuty (1756–1822), born in New York, of
Scotch descent. He served the crown in America as a volunteer,
obtaining a commission. He went to India, where he saw much
service. He took Monte Video, and showed considerable skill on
this expedition until superseded by General Whitelocke, who
arrived with further reinforcements. He later returned to India,
and was also employed in the East Indian islands.
Sir Home Popham, who was court-martialled in March, and
reprimanded for his share in the unauthorised expedition to
Buenos Ayres, remained with his fleet off the Rio Plate after the
loss of the town. The Government were much disconcerted by the
whole affair, but the enthusiasm of the public forced them to send
reinforcements instead of orders of recall. Three thousand men
were despatched with Sir Samuel.
[252] General Robert Craufurd (1764–1812). He served under
Lord Cornwallis in India, and was Quartermaster-General in
Ireland during the insurrection of 1798. His force was joined to
General Whitelocke’s. He commanded a light brigade in the
Peninsula and was killed at the storming of Ciudad Rodrigo. This
expedition was intended for the conquest of Chili, but was
diverted to Buenos Ayres.
[253] Aaron Burr’s (1756–1836) conspiracy was a sequel to his
defeat for the Presidency of the United States by Jefferson in
1801. This was mainly brought about by General Hamilton’s
influence, which was again brought to bear against him in 1804
when he stood for the Governorship of New York. A duel took
place in which General Hamilton was shot dead. Burr after this
went to the West and established himself on the Mississippi. He
gained over General Wilkinson, the commander of the United
States army at New Orleans, to assist him in his schemes, though
nobody appeared to know their exact trend. Jefferson, however,
grew alarmed, Wilkinson recanted, Burr was arrested, and the
whole plot fell to the ground. Burr was acquitted of actual
treason, and went to Europe. There he remained, first in one
country, then in another, till 1812, when he returned to America.
He took no further active part in politics, and died in extreme
poverty.
[254] Lord Mulgrave was Secretary for Foreign Affairs, 1805–6.
[255] Preparations for this expedition ceased with the fall of
the Ministry. Their successors again took the project into
consideration, but the troops destined to take part in it under Sir
Arthur Wellesley were sent instead to Portugal.
[256] Charles, third Duke of Richmond; born in 1735, died on
December 29, 1806. He was succeeded by his nephew, Colonel
Lennox.
[257] The charges of immorality raised against the Princess of
Wales by Sir John and Lady Douglas were laid before a
Committee of the Cabinet in 1806 for investigation. It was
composed of four members, the Lord Chancellor, the Lord Chief
Justice (Lord Ellenborough), and Lords Grenville and Spencer,
with Sir Samuel Romilly, the Solicitor-General, as legal adviser.
Their report acquitted her of the more serious charges, but
animadverted with severity on the levity of her conduct. The
Princess replied with a letter to the King ‘the joint composition of
Lord Eldon, Mr. Perceval, and Mr. Plomer; the first furnishing the
law, the second the argument, and the third the prolixity. It
concluded with a request to be restored to the comfort and
honour of his Majesty’s royal presence’ (Memoirs of the Whig
Party, ii. 151). This the King referred to the Cabinet, and after
many deliberations, with the exception of Mr. Windham, they
concurred in the report.
It is curious that Lord Eldon, who it is here suggested was the
secret adviser of George III., was also the confidential adviser of
George IV. at the time of the trial in 1820.
[258] This incident is fully described in Coke of Norfolk, ii. 69–
73. Mrs. Berney and her friend were in the habit of parading the
town every day in a carriage decked in Colonel Wodehouse’s (the
Tory candidate) colours. One day, however, the Whigs produced a
carriage arranged to closely resemble theirs in every particular,
but flaunting the rival hue. A riot ensued, for which the Berney
family held Coke and Windham responsible, though they had in
no way countenanced the trick. All three candidates were
convicted of treating, but as no petition was brought against
Colonel Wodehouse, he retained the seat. Mr. Coke’s brother,
Edward Coke, resigned his seat for Derby, for which the former
was elected; while the latter took the vacant seat at Norwich. Mr.
Windham was returned for Higham Ferrers by Lord Fitzwilliam.
[259] ‘A clear and precise rule was laid down for the regulation
of the circuitous trade by the enemy to the colonies, which
defined the difference between a continuous and intercepted
voyage’ (Alison, History of Europe, v. 677). The discussion of the
question of impressment of seamen was postponed till some
future occasion, owing to the difficulties which surrounded it. The
British Government pledged themselves in the meantime to use
their powers with the utmost moderation. President Jefferson,
however, refused to ratify the treaty.
[260] At the rupture of the Treaty of Amiens.
[261] Lord Minto had been appointed Governor-General of
India. He at first refused to accept office, and only did so at the
earnest desire of Lord Grenville. That he was loath to do so is
shown by letters, published in vol. iii. of his Life and Letters, to
Lady Minto, who on the score of health was precluded from
accompanying him. Fox first offered the appointment to Lord
Lauderdale, but the Court of Directors refused to receive him. He
therefore consented to waive his claim to the dignity.
[262] In answer to Lord Howick Mr. Perceval explained that the
word ‘attached’ was taken from a letter of Mr. Fox to Talleyrand
published in the Correspondence, in which he had ‘subscribed
himself “with the most perfect attachment”’ (Hansard).
[263] William Roscoe (1753–1831), the author of the Lives of
Lorenzo de’ Medici and Leo X. He was elected in the Whig interest
as member for Liverpool in 1806, but was defeated at the
succeeding election.
[264] William Frederick, second Duke of Gloucester (1776–
1834), son of William Henry, Duke of Gloucester, and Maria,
Countess of Waldegrave. He married, in 1816, Princess Mary,
George III.’s daughter.
[265] Adolphus Frederick, Duke of Cambridge (1774–1850),
seventh son of George III.
[266] This is probably the paper printed in Memorials and
Correspondence of C. J. Fox, ii. 340, &c. It was to be delivered to
the King in 1789, with the memorial, also drawn up by Minto and
Burke, containing a justification of the Prince’s and Duke of York’s
conduct during their father’s illness. Both documents were
discussed at a meeting of the Whig leaders held at Carlton House,
and it was decided not to present the memorial with this paper,
but to accompany it only with a short explanatory letter.
[267] Lord-Lieutenant of Ireland.
When the Grenville Ministry first took office on Mr. Pitt’s death
no stipulation was made to the King regarding the Catholic
question. The Irish Catholics, seeing Ministers in power most of
whom they knew to be favourably inclined to their claims, began
at once to agitate for the removal of disadvantages under which
they laboured. The greatest anomaly was, that by the Act of 1793
Irish Catholics could become officers in the army there (though
still unable to rise to certain staff appointments), but could not
hold that rank in England. A promise, however, had been made at
the time that matters would be speedily readjusted. This and
other points were brought to Mr. Fox’s notice soon after he had
taken office, but he advised a postponement of the suggested
petition to Parliament, as likely for the present to be of no
permanent advantage. He stated, however, that he was quite
willing to risk a dissolution of the Ministry on the question, if they
so wished it. Better counsels prevailed; but after Mr. Fox’s death
the matter again came to the front. Ministers were in a dilemma.
On one side they risked the King’s displeasure, on the other they
would be obliged to proclaim certain parts of Ireland where
agitation was breaking out, on a question with which they
themselves sympathised. The former evil was considered the
least, and it was decided by a clause in the Mutiny Act to allow
Irish Catholics and Dissenters to serve in the English army. To this
the King was agreeable; but Ministers desired to go further. It
was found easier to bring forward the matter in the form of a Bill,
and one was drafted which opened the staff appointments to the
Catholics, and also allowed English Dissenters to serve in the
army and navy. Lord Howick thought he had received the King’s
consent to this, but subsequently the latter flatly refused to
confirm it. The Bill was dropped, but the Ministers reserved for
themselves the right to bring forward the question again, should
circumstances so demand. This the King requested them to
withdraw; they refused, and were at once dismissed.
The Correspondence and Minutes of the Cabinet, referred to
here and subsequently, are printed in the Appendix to Lord
Holland’s Memoirs of the Whig Party.
[268] Lieut.-General Whitelocke (1757–1833). He distinguished
himself in St. Domingo in 1793–4, but failed signally before
Buenos Ayres. In his attack on the town he showed himself
incompetent to deal with an unexpectedly determined resistance,
and agreed to a convention whereby the English troops were
obliged to withdraw. On his return to England he was tried by
court martial and cashiered. Lord Holland states in the Memoirs of
the Whig Party that this appointment was due to Windham’s
dislike of General Whitelocke (who held the post of Inspector-
General) and his desire to appoint someone as his successor who
would be more willing to carry out his schemes.
[269] Elizabeth, Countess of Sutherland in her own right, Lord
Granville Leveson-Gower’s sister-in-law, only daughter of William,
eighteenth Earl of Sutherland. She was born in 1765, and
married, in 1785, George Granville, Earl Gower, who succeeded
his father as second Marquess of Stafford in 1803, and was raised
to a Dukedom in 1833. The Duchess died in 1839.
[270] This was in accordance with the resolution which Mr.
Rose says in his Diary he had taken never to say a word or give a
vote on the subject. He disapproved not of the abolition of the
Slave Trade itself, but of the methods pursued in putting it down,
which he considered were unfair to the colonists.
[271] Arthur James, eighth Earl of Fingall (1759–1836), who
succeeded his father in the titles in 1793. He was one of the
leaders of the Catholic movement at this time.
[272] John, second Baron Ponsonby, of Imokilly (1770?–1855),
son of William Brabazon Ponsonby, first Baron Ponsonby, who
died in 1806. He was Ambassador in Constantinople and Vienna
and was created a viscount in 1839. His only sister married Lord
Howick.
[273] William Elliot, of Wells, the Chief Secretary. He died in
1818.
[274] William Conyngham Plunket (1764–1854), created Baron
Plunket in 1827. He was appointed Attorney-General for Ireland in
1805 by Pitt, and retained this office under the Whig Government.
[275] Mr. Charles Kendal Bushe.
[276] See ante, ii. 174. Mr. Eden was Secretary to the
American Commission and Mr. Allen Assistant-Secretary.
[277] A Committee was appointed on February 10, on the
motion of Mr. Biddulph, member for Denbigh Borough, to
examine the efficiency of regulations and checks, already
introduced, to control public expenditure; to consider what
further steps were advisable for the same object, and to diminish
‘the amount of salaries and emoluments without detriment to the
public service.’
[278] William Garrow (1760–1840), barrister, who sat in
several Parliaments in the Whig interest. He was knighted in
1812; made Attorney-General in 1813, and Baron of the
Exchequer 1817–32.
[279] This was the pamphlet drawn up by Perceval, and known
as ‘the Book.’ It was never given to the world, for just as the
Princess’s friends resolved upon its circulation, the Ministry was
dismissed and the Tories returned to power. A few copies escaped
from the printers’ hands, and were bought back for large sums by
the Government.
[280] Owing to the infraction of treaty obligations in Moldavia
and Wallachia by Turkey, largely instigated by Sebastiani the
French Ambassador at Constantinople, Russia thought fit to
declare war with the Porte late in 1806. Alexander, however, had
need of all his forces to meet the French in Central Europe, and
he suggested to the English Government that a fleet should be
sent to Constantinople to secure their joint interests, and to
demand the dismissal of Sebastiani. This was done, and
Arbuthnot, the British Minister, was ordered to insist on the latter
point, on the pain of instant bombardment. Unfortunately
Arbuthnot had to leave owing to ill health, and Sir Thomas
Duckworth, the British Admiral, allowed himself to be drawn into
fruitless negotiations, and finally withdrew without accomplishing
his object.
The force sent to Egypt under General Mackenzie captured
Alexandria, but lost a large number of prisoners in an attack on
Rosetta. Nothing further was effected, and the troops were
removed in the autumn.
[281] John Armstrong (1758–1843), American Minister in
France and Spain 1804–10.
[282] The Right Hon. Charles Long (1761–1838), afterwards
created Lord Farnborough (1820), Secretary of State for Ireland
1806, and Paymaster of the Forces for many years.
[283] George Rose (1744–1818), a devoted adherent of Pitt.
He was for many years Secretary of the Treasury, and held
various minor offices under the Tories.
[284] This is amusing and interesting, in light of Lord
Malmesbury’s conversation with Canning, which he quotes in his
diary as having taken place on March 14. Canning ‘said, what he
had told me before, that he had received and rejected overtures
from Lord Grenville.... He declared with a threat that he never
would sit in the same Cabinet as Addington.’
[285] Sir William Drummond, born about 1770; died in 1828.
He was appointed Minister at the Court of Naples in 1801, and
again in 1806, and Ambassador to the Porte in 1803.
[286] No action was taken in these matters owing to the fall of
the Ministry, and Canning allowed the question to lapse.
[287] Alexander Hamilton, Marquess of Douglas (1767–1852),
British Ambassador at St. Petersburg. He succeeded his father as
tenth Duke of Hamilton in 1819.
[288] He stated in a letter to Lord Holland, dated April 27, that
he wished to attach himself completely to the Prince.
[289] Right Hon. Charles Bragge, who married Lord Sidmouth’s
sister, and took the additional surname of Bathurst in 1804. He
sat in the House of Commons 1790–1823, and died in 1831.
[290] Philip, third Earl of Hardwicke (1757–1834), son of the
Right Hon. Charles Yorke. He succeeded his uncle in 1790, and
was Lord-Lieutenant of Ireland from 1801 to 1806.
[291] Lord Hardwicke’s half-brother, Charles Philip Yorke
(1764–1834). He was Secretary at War, 1801–3; Home Secretary,
1803–4; and First Lord of the Admiralty, 1810–11.
[292] March 18.
[293] Charles Manners-Sutton (1755–1828), raised to the See
of Canterbury in 1805, and father of Viscount Canterbury (for
many years Speaker of the House of Commons).
[294] Lord Auckland was President of the Board of Trade. His
letter is printed in Lord Auckland’s Journal and Correspondence,
iv. 300.
[295] Charles William, Viscount Milton (1786–1857), only son
of William, fourth Earl Fitzwilliam, on whose death in 1833 Lord
Milton succeeded to the titles. He remained member for Yorkshire
until 1831.
[296] The figures were: Wilberforce 11,806, Milton 11,177,
Lascelles 10,989, the two first being therefore returned.
Wilberforce’s expenses, after many of his supporters had paid
their own, amounted to 28,600l., while those of his opponents
were reckoned to be 200,000l. (Dictionary of Nat. Biog.).
[297] Mary Elizabeth, born in 1806. She married, in 1830,
Thomas Atherton, third Baron Lilford, and died in 1891.
[298] Peter Leopold Louis Francis Nassau, fifth Earl Cowper
(1778–1837), who succeeded his brother in 1799. He married, in
1805, Amelia, daughter of Peniston, first Viscount Melbourne.
After Lord Cowper’s death she married Lord Palmerston in 1839.
[299] The Hon. Sir Arthur Paget (1771–1840), second son of
Henry, first Earl of Uxbridge. He held various diplomatic posts,
and was appointed, in 1807, Ambassador to the Porte. He retired
from the service two years later.
[300] David Richard Morier (1784–1877), son of Isaac Morier,
Consul-General of the Levant Company at Constantinople.
Commencing at the age of twenty, he held various diplomatic
posts in the East, was secretary to Lord Castlereagh at Châtillon,
&c., and was for many years Minister at Berne.
[301] Mr. Adam brought a motion in the House of Commons on
July 2, 1807, in defence of the warrant for a pension to the
Scotch Judge, Lord Cullen, of 400l. a year, with a reversion of
200l. for life to his wife. He argued that it was fair, if a judge was
not sufficiently well off to keep up his position. Lord Cullen was
devoting two-thirds of his income to pay his father’s debts.
[302] It was burnt in 1831 by the mob, on account of the
opposition of its owner to the Reform Act.
[303] ‘Conversation’ Sharp.
[304] The History of Brazil was the only part published.
[305] George William, sixth Duke of Argyll (1766–1839), who
succeeded his father in 1806. He married, in 1810, Caroline
Elizabeth, daughter of George, fourth Earl of Jersey, and
previously wife of the Earl of Uxbridge (afterwards Marquess of
Anglesey), whom she divorced.
[306] Lord John Russell.
[307] Lewis, describing this visit in a letter to his mother, says,
‘I happened to wake about six o’clock, and hearing the billiard
balls in motion, I put on my dressing-gown and went into the
gallery, from whence looking down into the great hall, I descried
Tom Sheridan and Mr. Chester (who had not been to bed all
night) playing with great eagerness. Fortunately, Tom was in the
act of making a stroke on which the fate of the whole game
depended; when I shouted to him over the balustrade, “Shame!
Shame! A married man!” on which he started back in a fright,
missed his stroke, and lost the game’ (Life and Correspondence of
M. G. Lewis, ii. 5).
[308] Hon. Henry Edward Fox (1802–59), afterwards fourth
Lord Holland; always a weakly child from birth. He was afflicted
with a form of hip disease, which gave him much trouble all his
life.
[309] Lord Holland says in the Memoirs of the Whig Party: ‘Mr.
Ponsonby was brought into Parliament at the beginning of the
session for the purpose of assuming an ascendency over a large,
intelligent, and independent body of gentlemen with scarcely
twenty of whom he was personally acquainted. A preposterous
scheme!’
[310] William Belsham (1752–1827), author of a series of
works, which he combined to form a History of Great Britain to
the Conclusion of the Peace of Amiens.
[311] Napoleon’s insistence on one of the secret articles of the
Treaty of Tilsit, requiring Russia to close her ports against English
vessels, was the actual reason for the Czar’s declaration of war
against England. Lord Granville Leveson left St. Petersburg early
in November 1807.
[312] Prince Stahremberg was Austrian Minister in London.
Lord Holland states that he did not consider his information
reliable except where it was substantiated by documents.
Metternich was Austrian Ambassador at Paris. The declaration of
war of both Austria and Prussia was entirely due to Napoleon’s
instigation, as one step in his campaign against British commerce.
Both countries had the sense to give no reason for their action.
[313] These letters, Mr. Fox asserted in a speech in the House
of Commons, were the origin of the rupture of the peace of
Amiens. Certainly they were the means of rousing Napoleon’s ire,
for Coleridge had to leave Rome in 1806 in all haste, after a
friendly warning that the Emperor intended his arrest. He was
Secretary to the Governor of Malta, Sir Alexander Ball, 1804–5, a
post which was rather the result of a chance visit to the island
than an official appointment. He wrote for the Courier for several
years at this period of his life.
[314] George, second Lord Kenyon (1776–1855), who
succeeded his father in 1802. Lord Kenyon seconded the Address,
but his speech was delivered in so low a tone as to be inaudible
below the bar (Hansard).
[315] The British expedition to Copenhagen in September
1807, which resulted in the seizure of the Danish fleet and the
bombardment of that city. Canning had private information of the
secret clauses of the Treaty between Napoleon and Alexander at
Tilsit. His refusal to produce papers which would incidentally have
brought his secret agent to light, coupled with what they
considered his shabby behaviour in joining the Tory Government,
caused him much odium amongst the Whigs.
[316] Milnes?
[317] Mr. R. Campbell came over in the Revenge, man-of-war,
with the deputies who had arrived to ask for English assistance
against the French. Napoleon invaded Spain late in 1807, and set
up his brother Joseph on the throne. This was too much for the
amour propre of the Spaniards; they rose in arms, and in every
town occupied by the invader outbreaks of the most ferocious
description took place.
[318] Solano was Governor of Cadiz. The French fleet
consisted of five ships of the line and one frigate, which had
escaped to that port after Trafalgar, and had lain there ever since.
They were forced to surrender a fortnight later to the Spaniards,
as they were unable to leave the harbour on account of Lord
Collingwood’s fleet, which was waiting for them outside.
[319] Don Gonzalo O’Farrill (1754–1831), Spanish General,
who sided with Joseph Bonaparte, and became his War Minister.
[320] At Madrid on May 2 Murat put a large number of people
to death without trial for supposed participation in riots which had
taken place there that day.
[321] The French General, Count Pierre Dupont, who was in
command of the French forces in Andalusia. He was defeated by
Castaños at Baylen in July 1808, and forced to lay down his arms
with 18,000 men.
[322] The Duke of Infantado was implicated, as Lady Holland
relates, in the supposed plot of Ferdinand, Prince of the Asturias,
against his father, Charles IV, in October 1807. The whole
conspiracy was looked upon in many quarters as a device of
Godoy’s to ruin his rival Escoiquiz. The Duke accompanied
Ferdinand to Bayonne the following April, and after his master’s
deposition offered his services to Joseph Bonaparte. On the first
favourable occasion, however, he turned against him and was
given a Spanish command.
[323] The picture was painted in 1763, and is now at Mount
Stuart, Lord Bute’s residence in the Isle of Bute.
[324] Second daughter of Alexander, Duke of Gordon, and
sister of Charlotte, fourth Duchess of Richmond.
[325] At Baylen.
[326] Afterwards better known as Count Torreno. He was a
member of the first Cortes at Cadiz, and had to leave Spain at
Ferdinand’s return. He lived in Paris until 1820, when he came
back to Spain.
[327] Manuel Freyne (1765–1834), general, who served with
distinction throughout the war. He refused employment under
Ferdinand.
[328] From Spain, where he went as Ambassador early in
1809. He succeeded Canning as Foreign Secretary.
[329] John, second Marquess of Lansdowne, previously
referred to in these pages as Lord Wycombe.
[330] By a former family arrangement Lord Lansdowne was
enabled, should his brother die childless, to draw up a deed of
appointment as to the disposition of the property.
[331] Georgina Anne, who died in 1819.
[332] George, ninth Earl of Winchilsea, and fourth Earl of
Nottingham (1752–1826), who succeeded his uncle in 1769.
[333] Joseph Berington (1746–1827), an Englishman educated
at the College of St. Omer. He became a priest, and was one of
the first of that persuasion to wear black clothes in England, from
which others had up to then refrained for fear of persecution. He
was the author of a number of works, historical and philosophical.
[334] Canning’s statement was published in the papers on
November 28. It took the form of a letter to Lord Camden laying
the blame on him for the misunderstanding with Lord
Castlereagh.
[335] Lady Elizabeth Foster married William, fifth Duke of
Devonshire, on October 19, 1809.
[336] For the Chancellorship of the University, rendered vacant
by the death of the Duke of Portland on October 30. Lord
Grenville, Lord Eldon, and the Duke of Beaufort were the rival
candidates.
[337] Martin Davy (1763–1839). He was elected Master of
Caius in 1803, and held that position until his death. He was a
staunch Whig, and was given a living near Cambridge in 1827.
[338] A town in Portugal, one of the sights of which is a
magnificent cathedral.
[339] Lady Anne Fitzpatrick, and her father, Lord Upper Ossory.
[340] An amendment to the Address was moved in both
Houses, deploring the ill-success of the late expeditions, and
demanding an inquiry into the reasons of their failure. Creevey
says in his journal (Creevey Papers, i. 123): ‘Notwithstanding
Tierney’s calculations and prophecy that we should be in a
majority, we were beat by ninety-six.’
[341] The figures were 144 to 92, against the Amendment.
[342] His motion was, ‘To appoint a Committee to inquire into
the policy and conduct of the late expedition to the Scheldt.’
[343] William Frederick Eden, eldest son of William, first Lord
Auckland. He was born in 1782, and was, at the time of his
death, Deputy-Teller of the Exchequer.
[344] Domingo Antonio de Souza, Marquis de Funchal (1765–
1832), Portuguese Ambassador in England.
[345] William Windham died on June 4, 1810, from the effects
of a severe operation for a tumour on his hip. About a year before
he had sustained an injury from some falling woodwork, when
engaged in trying to save from fire a valuable library belonging to
his friend the Hon. Frederick North, and on this the disease
fastened.
Windham’s father, Colonel Windham, married, after his first
wife’s death, Sarah Hicks, widow of Robert Lukin, of Dunmow. To
a nephew by this connection, Captain (afterwards Admiral) Lukin,
Windham left his property on condition he took the family name.
His diary was published by Mrs. Henry Baring in 1866.
[346] As Chancellor of Oxford University.
[347] Henrietta Elizabeth, eldest daughter of the Hon. Edward
Bouverie. She married, in 1790, James St. Clair Erskine, second
Earl of Rosslyn.
[348] John Clerk, of Eldin (1728–1812), seventh son of Sir
John Clerk, of Penicuik. He lived about six miles from Edinburgh.
He was the author of An Essay on Naval Tactics, which he claimed
had much effect on the warfare of the day.
[349] Queen Mary’s remains were removed to Westminster in
1612.
[350] Holland House.
[351] General Fox was appointed Governor of Portsmouth in
1808, on his return from Sicily, and died there three years later.
[352] General Sir Ronald Craufurd Ferguson (1773–1841), son
of William Ferguson, of Raith. He saw much service, and sat for
many years as a Whig in the House of Commons. The
appointment, which he was obliged to relinquish at Cadiz, was
that of second-in-command.
[353] Charles Fox entered the Navy in 1809, but disliked the
life so much that he left in 1813, and entered the sister service
two years later.
[354] The whole building was restored and remodelled by
Street in 1866, and now forms the garrison church.
[355] Captain Graham Moore (1764–1843), afterwards Admiral
Sir Graham Moore, G.C.B., third son of Dr. John Moore. He was in
command of the English squadron which escorted the Regent of
Portugal to Brazil, and was for some years a Lord of the
Admiralty.
[356] James Moore (1763–1834), second son of Dr. John
Moore. He was a surgeon, and wrote two books on his brother’s
life and campaign.
[357] Dom John was appointed Regent of Portugal in 1799, on
account of his mother Queen Maria I.’s insanity. In conformance
with Napoleon’s orders he proclaimed in November 1807, that he
was about to detain all British subjects and property in Lisbon,
upon which the British Minister, Lord Strangford, at once went on
board the fleet, and broke off diplomatic relations. On
consideration, however, the Regent preferred to remain friendly
with the English and move the Court to Brazil; consequently Lord
Strangford returned, but not till after the Portuguese royal family
had already embarked. This is the point here insisted upon, for
Lord Strangford was accused of inferring in his despatch that the
departure of the Court was chiefly due to his own
representations.
[358] Mariano Luis Urquijo (1768–1817), Spanish statesman,
who acted in opposition to the Prince of the Peace and was
imprisoned by him for two years. After the detention of the Royal
family, he gave up hope for Spain, and sided with Joseph, with
whom he fled to France.
[359] Admiral Lord Amelius Beauclerk, G.C.B. (1771–1846),
third son of Aubrey, fifth Duke of St. Albans, and Catherine,
daughter of William, Earl of Bessborough.
[360] Admiral Sir Roger Curtis, Bart. (1746–1816), naval
commander-in-chief at Portsmouth.
[361] Ferdinand of Naples withdrew to Sicily in 1805, and there
established himself with his Court under British protection.
[362] Lord Amherst was Commander-in-Chief in Sicily.
[363] Attorney-General in Lord Grenville’s Administration.
[364] The French army of 72,000 men under Masséna invaded
Portugal early in September. Wellington had only 50,000 men at
his disposal; half of whom were Portuguese. He retreated before
the invaders, but was able to deliver a severe check to their
advance, at Busaco, on September 27, with but little loss to his
own force.
[365] The critical state of the King’s mind was adversely
affected by the illness of Princess Amelia. After her death, on
November 2, he became permanently insane.
[366] Yet Masséna represented to Napoleon some weeks later
that the frontal attack on the British position was only a feint,
which had developed from over-keenness into a general
engagement. His dispatches, however, captured after the action,
made no mention of this fact (Sir Herbert Maxwell’s Life of
Wellington).
[367] Afterwards Sir Thomas Tyrwhitt, and Black Rod.
[368] George Ponsonby.
[369] It is impossible to trace so extended an interpretation in
the report of the speech given in Hansard, though a veiled
meaning is possible in some of his carefully worded allusions to
the royal power.
[370] The ordinary composition of the Cortes was a three-
chamber assembly consisting of clergy, nobility, and commons.
The Central Junta, in whom the power of calling together the
Cortes rested, decided that as a compromise with the extreme
party of reform, only two chambers (the higher clergy and nobility
sitting together in one) should be summoned to assemble early in
March. The advance of the French, however, postponed the
meeting, and the supreme government was placed in the hands
of a Regency of five. These took good care to keep the power as
long as possible, and when the Cortes was at last found
necessary, only one chamber could be elected, and that within
the boundaries of Cadiz, for the French were almost at their
gates. See Appendix B, p. 297.
[371] General Sir Robert Wilson (1777–1849), author of The
History of the British Expedition to Egypt. He served both in the
British army and in various continental corps. He was dismissed
the service in 1820 for his supposed conduct at Queen Caroline’s
funeral, but was reinstated by William IV.
His Lusitanian Legion was amalgamated with the Portuguese
army during its reorganisation.
General Drouet joined Masséna with the Ninth corps, forcing
Wilson across the Mondego, from fear of being surrounded.
[372] Sir Robert’s affair at Puerto de Baños was an attempt to
check Ney, at the head of a large force, with a number of Spanish
and Portuguese levies. He lost a thousand men in the attempt.
[373] Huskisson resigned his post at the Treasury in 1809, and
followed Canning into retirement. His pamphlet entitled ‘The
Depreciation of the Currency’ received much notice.
[374] One of the gentlemen in attendance on the Prince of
Wales. ‘That warlike scaramouch Macmahon,’ of Peter Pindar. He
died in 1817.
[375] The Committee of the House of Lords was appointed by
ballot, each Peer having the right to send in a list of twenty-one
names. That of the House of Commons was named by the
Chancellor of the Exchequer.
[376] The report of the Bullion Committee, of which Horner
was President, was that paper issues were liable to depreciation
unless convertible at any time into money.
[377] The appointment was not filled up till 1812, when Lord
Hertford accepted the post.
[378] Gustavus IV. (1778–1837), who succeeded his father as
King of Sweden in 1792. His tactless and inconsequent behaviour
so irritated his people that they deposed him in 1809, and gave
the crown to his uncle. After leaving Sweden Gustavus lived
chiefly in Switzerland.
[379] Lucien Bonaparte’s second wife was Madame
Jouberthon, the widow of a stockbroker. He quarrelled with his
brother over this marriage, and after the Duc d’Enghien’s death
went to Italy. He attempted to reach America, but was captured
by an English ship, and after a detention at Malta, was brought to
England. There he remained until 1814.
[380] William, fourth Duke of Queensberry (1724–1810), the
celebrated courtier and roué, known as ‘Old Q.’ The larger portion
of his money was left to Lord and Lady Yarmouth, the latter being
Maria Fagniani, whom the Duke always considered was his
daughter. George Selwyn believed that this lady was his child and
not the Duke’s, and also left her money.
[381] Henry, Duke of Buccleugh became fifth Duke of
Queensberry; Sir Charles Douglas, Marquess of Queensberry; and
Lord Wemyss, Earl of March.
[382] The Duke of York had been compelled to resign this post
in 1809, owing to the scandalous charges brought against him by
Mrs. Clarke.
[383] See Further Memoirs of the Whig Party, p. 39.
[384] Grenville.
[385] Lord William Cavendish Bentinck (1774–1839), second
son of William Henry, third Duke of Portland, who saw much
service in various parts of the world and rose to the rank of
major-general in 1808. He was appointed Envoy and Commander-
in-Chief in Sicily in 1811, and for three years was practically
governor of the island. His sudden departure, after a stay of only
ten days, had the desired effect of alarming the Sicilian Court,
which became much more amenable, after his return, to the
reforms he proposed to introduce. The King was notoriously
incapable of reigning, and the power was in the hands of the
Queen, who detested the English, and was intriguing with the
French.
[386] They were imprisoned for a protest against the illegal
taxation which was being enforced by the Court, but were
released and recalled in January 1812.
[387] Hon. Frederick James Lamb (1782–1853), who was
created Lord Beauvale in 1839, and succeeded his brother as
third and last Viscount Melbourne in 1848.
[388] Afterwards Admiral Sir George Cockburn (1772–1853).
He took Napoleon to St. Helena in 1815, and remained there for a
year as Governor until relieved by Sir Hudson Lowe.
The Commission was to attempt to mediate between Spain and
her American Colonies. The Cortes, however, proved intractable,
and the expedition returned to England in August 1812.
[389] See ante, i. 130.

Transcriber’s Notes:

1. Obvious printers’, punctuation and spelling errors have been corrected


silently.

2. Where hyphenation is in doubt, it has been retained as in the original.

3. Some hyphenated and non-hyphenated versions of the same words have


been retained as in the original.
*** END OF THE PROJECT GUTENBERG EBOOK THE JOURNAL OF
ELIZABETH LADY HOLLAND (1791-1811) VOLUME 2 (OF 2) ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like