Machine Learning Design Patterns Solutions To Common Challenges in Data Preparation Model Building and Mlops Valliappa Lakshmanan
Machine Learning Design Patterns Solutions To Common Challenges in Data Preparation Model Building and Mlops Valliappa Lakshmanan
com
https://textbookfull.com/product/machine-learning-design-
patterns-solutions-to-common-challenges-in-data-preparation-
model-building-and-mlops-valliappa-lakshmanan/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/practical-python-design-patterns-
pythonic-solutions-to-common-problems-badenhorst/
textbookfull.com
https://textbookfull.com/product/data-science-on-the-google-cloud-
platform-1st-edition-valliappa-lakshmanan/
textbookfull.com
https://textbookfull.com/product/kubernetes-for-mlops-scaling-
enterprise-machine-learning-deep-learning-and-ai-2nd-edition-sam-
charrington/
textbookfull.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/
textbookfull.com
https://textbookfull.com/product/design-patterns-by-tutorials-third-
edition-learning-design-patterns-in-swift-raywenderlich-tutorial-team/
textbookfull.com
https://textbookfull.com/product/data-science-solutions-on-azure-
tools-and-techniques-using-databricks-and-mlops-julian-soh/
textbookfull.com
https://textbookfull.com/product/machine-learning-and-big-data-
analytics-paradigms-analysis-applications-and-challenges-aboul-ella-
hassanien/
textbookfull.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
i. Numerical Inputs
ii. Categorical Inputs
i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
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
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
i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
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
i. Problem
ii. Solution
iii. Why It Works
iv. Trade-Offs and Alternatives
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
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
i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
d. Design Pattern 24: Windowed Inference
i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
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
i. Problem
ii. Solution
iii. Trade-Offs and Alternatives
h. Summary
8. 7. Responsible AI
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
10. Index
Machine Learning Design
Patterns
Solutions to Common Challenges in Data
Preparation, Model Building, and MLOps
See http://oreilly.com/catalog/errata.csp?isbn=9781098115784
for release details.
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.
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 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.
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.
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.
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.
TIP
This element signifies a tip or suggestion.
NOTE
This element signifies a general note.
WARNING
This element indicates a warning or caution.
NOTE
For more than 40 years, O’Reilly Media has provided technology and
business training, knowledge, and insight to help companies succeed.
How to Contact Us
Please address comments and questions concerning this book
to the publisher:
707-829-0104 (fax)
For news and information about our books and courses, visit
http://oreilly.com.
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.
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.
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….
Language: English
BY
DR. RUDOLF STEINER
EDITED BY H. COLLISON
The Authorized English Translation
COPYRIGHT, 1915, BY H. COLLISON
The copyright, the publishing rights, and the editorial responsibility
for the translation of the works of Rudolf Steiner, Ph.D., with the
exception of those already under the editorial supervision of Max
Gysi, are now vested in Mr. Harry Collison, M.A., Oxon.
PREFACE
In the following pages are reproduced the contents of some
lectures delivered by me at Copenhagen in June last, in connection
with the General Meeting of the Scandinavian Theosophical Society.
What is here set forth was therefore spoken to an audience
acquainted with occult science, or theosophy. A similar acquaintance
is assumed in this work. It is throughout based on the foundations
given in my books, “Theosophy” and “An Outline of Occult Science.”
To anyone taking up the present work who is unacquainted with
these premises, it must needs appear the strange outpouring of
mere fancy, but the above-named books point out the scientific basis
of everything stated in this one.
I have completely re-written the shorthand report of the lectures;
nevertheless it has been my intention on publishing them, to
preserve the character given in oral delivery. This is specially
mentioned because it is in general my opinion that the form of work
intended for reading should be quite different from that used in
speaking. I have expressed this principle of mine in all my earlier
writings, as far as they were intended for the press. If in this
instance I have worked out my subject in closer connection with the
spoken word, it is because I have reasons for letting the work
appear at this juncture, and an adaptation completely in accordance
with the above rule would take a great deal of time.
Rudolf Steiner.
Munich, August 20, 1911.
The Spiritual Guidance of Man
and of Mankind
LECTURE I.
A man reflecting on his own nature soon becomes conscious that
there is within him a second and more powerful self than the one
bounded by his thoughts, his feelings and the fully-conscious
impulses of his will. He becomes aware that he is subject to that
second self, as to a higher power. It is true that at first he will feel it
to be a lower entity as compared with the one limited by his
intelligent and fully-conscious soul, with its inclinations towards the
Good and True. And at first he will strive to overcome that lower
entity.
But closer self-examination may reveal something else about the
second self. If we often, in the course of our lives, make a kind of
survey of our acts and experiences, we make a singular discovery
about ourselves. And the older we are, the more significant do we
think that discovery. If we ask ourselves what we did or said at a
particular period of our lives, it turns out that we have done very
many things which are only really understood in later years. Seven
or eight, or perhaps twenty years ago, we did certain things, and we
know quite well that only now, long afterwards, is our intelligence
ripe enough to understand what we did or said at that earlier period.
Many people do not make such discoveries about themselves,
because they do not lay themselves out to do so. But it is extremely
profitable to hold such communion frequently with one’s own soul.
For directly a man becomes aware that he has done things in former
years which he is only now beginning to understand, that formerly
his intelligence was not ripe enough to understand them,—at a
moment such as this, something like the following feeling arises in
the soul: The man feels himself protected by a good power, which
rules in the depths of his own being; he begins to have more and
more confidence in the fact that really, in the highest sense of the
word, he is not alone in the world, and that everything which he
understands, and is consciously able to do, is after all but a small
part of what he really accomplished in the world.
If this observation is often made, it is possible to carry out in
practical life something which is very easy to see theoretically. It is
easy to see that we should not make much progress in life if we had
to accomplish everything we have to do, in full consciousness, with
our intelligence taking note of every circumstance affecting us. In
order to see this theoretically, we have only to reflect as follows: In
what section of his life does a human being perform those acts
which are really most important as regards his own existence? When
does he act most wisely for himself? He does this from about the
time of his birth up to that period to which his memory goes back
when in later life he surveys his earthly existence. If he recalls what
he did three, four or five years ago, and then goes farther and
farther back, he comes at last to a certain point in childhood, beyond
which memory cannot go. What lies beyond it may be told by
parents or others, but a man’s own recollection only extends to a
certain point in the past. That point is the moment at which the
individual felt himself to be an ego. In the lives of people whose
memory is limited to the normal, there must always be such a point,
but previously to it, the human soul has worked in the wisest
possible manner on the individual, and never afterwards, when man
has gained consciousness, can he accomplish such vast and
magnificent work on himself as he carries out, from subconscious
motives, during the first years of childhood.
For we know that at birth man takes into the physical world what
he has brought with him as the result of his former earthly lives.
When he is born, his physical brain, for instance, is but a very
imperfect instrument. The soul has to work a finer organization into
that instrument, in order to make it the agent of everything which
the soul is capable of performing. In point of fact the human soul,
before it is fully conscious, works upon the brain so as to make it an
instrument for exercising all the abilities, aptitudes, qualities, etc.,
which appertain to the soul as the result of its former earthly lives.
This work on a man’s own body is directed from points of view which
are wiser than anything which he can subsequently do for himself
when in possession of full consciousness.
Moreover, man during this period not only elaborates his brain
plastically, but has to learn three most important things for his
earthly existence. The first is the equilibrium of his own body in
space. The man of the present day entirely overlooks the meaning of
this statement, which touches upon one of the most essential
differences between man and animals. An animal is destined from
the outset to develop its equilibrium in space in a certain way; one
animal is destined to be a climber, another a swimmer, etc. An
animal is so organized from the beginning as to be able to bear itself
rightly in space, and this is the case with all animals up to and
including the mammals most resembling man. If zoologists would
ponder this fact, they would lay less emphasis on the number of
similar bones and muscles in man and animals, etc., for this is of
much less account than the fact that man is not endowed at the
outset with the complete equipment for his conditions of equilibrium.
He has first to form them out of the sum total of his being. It is
significant that man should have to work upon himself, in order to
make, out of a being that cannot walk at all, one that can walk
erect. It is man himself who gives himself his vertical position, or his
equilibrium in space. He brings himself into relation with the force of
gravitation. It will obviously be easy for anyone taking a superficial
view of the matter to question this statement, with apparently good
reason. It may be said that man is just as much organized for his
erect walk as, for instance, a climbing animal for climbing. But more
accurate observation will show that it is the peculiarity of the
animal’s organization that causes its position in space. In man it is
the soul which brings itself into relation with space and controls the
organization.
The second thing which man teaches himself, and that by means
of the entity which proceeds from one incarnation to another as the
same being, is speech. Through speech he comes into relation with
his fellow-men. This relation makes him the vehicle of that spiritual
life which interpenetrates the world primarily through man. Emphasis
has often been laid, with good reason, on the fact that a human
being removed, before he could speak, to a desert island, and kept
apart from his fellows, would not learn to talk. On the other hand,
what we receive by inheritance, what is implanted in us for use in
later years and is subject to the principles of heredity, does not
depend on a man’s dwelling with his fellows. For instance, his
inherited conditions oblige him to change his teeth in his seventh
year. If it were possible for him to grow up on a desert island, he
would still change them then. But he only learns to talk, when his
soul’s inner being, i.e., that which is carried on from one life to
another, is stimulated. The germ, however, for the development of
the larynx must be formed during the period at which man has not
yet acquired his ego-consciousness. Before the time to which his
memory goes back, he must plant the germ for developing his
larynx, in order that this may become the organ of speech.
And then there is a third thing: It is not so well known that man
learns this of himself, from that part of his inner being which he
carries on from one incarnation to another. It is the life within the
world of thought itself. The elaboration of the brain is undertaken
because the brain is the instrument of thought. At the beginning of
life, this organ is still plastic, because the individual has to form it for
himself as an instrument of thought, in accordance with the
intention of the entity which is carried on from one life to another.
The brain immediately after birth is, as it was bound to be, in
accordance with the forces inherited from parents and other
ancestors. But the individual has to express in his thought what he is
as an individual being, in accordance with his former earthly lives.
Therefore he must re-model the inherited peculiarities of his brain,
after birth, when he has become physically independent of his
parents and other ancestors.
We thus see that man accomplishes momentous things during the
first years of his life. He is working on himself in the spirit of the
highest wisdom. In point of fact, if it were a question of his own
cleverness, it is possible that he might not accomplish what he does
without that cleverness during the first period of his life. Why is all
this accomplished in those depths of the soul which lie outside
consciousness? This happens because the human soul and entire
being are, during the first years of earthly life, in much closer
connection with the spiritual worlds of the higher hierarchies than is
afterwards the case. A clairvoyant who has gone through sufficient
spiritual development to be able to witness actual spiritual events,
sees something exceedingly significant at the moment when the ego
acquires consciousness, i.e., the earliest point to which the memory
of later years goes back. Whereas what we call the child’s aura floats
round it in its earliest years like a wonderful human and superhuman
power, and, being really the higher part of the child, is everywhere
continued on into the spiritual world,—at the moment to which
memory goes back, this aura sinks more into the inner being of the
child. A human being is able to feel himself a continuous ego as far
back as that point of time, because then that which was previously
in close connection with the higher worlds, passed into his ego.
Henceforward the consciousness is at every point brought into
connection with the external world. This is not the case with a very
young child, to whom things appear only as a surrounding world of
dreams.
Man works on himself by means of a wisdom which is not within
him. That wisdom is mightier and more comprehensive than any
conscious wisdom of later years. The higher wisdom becomes
obscured in the human soul, which in exchange receives
consciousness.
The higher wisdom works from out of the spiritual world deep into
the bodily part of man, so that man is able by its means to form his
brain out of spirit. It is rightly said that even the wisest may learn
from a child, for in the child is working the wisdom which does not
pass later into consciousness. Through that wisdom man has
something like telephonic connection with the spiritual beings in
whose world he lives between death and re-birth. From that world
there is something still streaming into the aura of a child, which is,
as an individual being, immediately under the guidance of the entire
spiritual world to which it belongs. Spiritual forces from that world
continue to flow into a child. They cease so to flow at the point of
time to which memory goes back. It is these forces which enable a
child to bring itself into a definite relation to gravitation. They form
the larynx, and so mould the brain that it becomes a living
instrument for the expression of thought, feeling and will.
What is present in childhood to a supreme degree, so that the
individual is then working out of a self which is still in direct
connection with higher worlds, continues to some extent even in
later years, although the conditions change in the manner indicated
above. If at a later stage of life we feel that we did something years
before which we are only now able to understand, it is just because
we previously let ourselves be guided by higher wisdom, and only
after the lapse of years have we attained to an understanding of the
reasons of our conduct.
From all this we can feel that, immediately after birth, we had not
escaped so very far from the world in which we were before entering
upon physical existence, and that we can never really escape from it
wholly. Our share in higher spirituality enters our physical life and
accompanies us throughout it. We often feel that what is within us is
not only a higher self which is gradually being evolved, but is
something higher which is there already, and is the motive cause of
our so often developing beyond ourselves.
All ideals and artistic creations which man is able to produce, as
well as all the natural healing forces in his own body, by means of
which he is continually able to adjust the injuries that befall him in
life,—all these powers do not proceed from ordinary intellect, but
from those deeper forces which in our earliest years are at work on
our equilibrium in space, on the formation of our larynx and on the
brain. For these same forces are still at work in man in later years.
When sickness attacks us, it is often said that external forces cannot
help us, but that our organism must develop the healing powers
latent within it: by this is meant that there is a profoundly wise
activity present in humanity. Moreover, it is from the same source
that proceed these best forces whereby knowledge of the spiritual
world is attained, i.e., true clairvoyance.
The question now suggests itself, why do the higher forces which
have been described work upon human nature only during early
childhood? One-half of the answer may be easily given as follows: If
those higher forces went on working in the same way, man would be
always a child. He would not attain the full ego-consciousness. From
within his own being must proceed the motive power which
previously worked on him from without. But there is a more
important reason, which explains still more about the mysteries of
human life than what has just been said, and that is the following:
It is possible to learn through occult science, that the human
body, as it exists at its present stage of evolution, must be regarded
as having arrived at its present form under different circumstances.
It is known to the occultist that this evolution was effected by means
of the working of various forces on the sum-total of man’s being;
certain forces worked on the physical body, others on the etheric,
others on the astral body. Human nature has arrived at its present
form through the action of those beings whom we call the Luciferic
and Ahrimanic. By their means it has, in a certain way, become
worse than it need have been if those forces only had been active
within it which proceed from the spiritual rulers of the cosmos who
desire to evolve man along straight lines. The causes of sorrow,
disease and even of death are to be sought in the fact that, besides
the beings who are evolving man in a straight line forwards, there
are also ruling the Luciferic and Ahrimanic spirits, who are
continually crossing the line of straightforward, progressive
development.
There is something in what man brings into existence at birth,
which is better than what he can make out of it in later life. This is
so, because the Luciferic and Ahrimanic forces have but little
influence over man during early childhood; they are virtually only
operative in what man makes out of himself by his conscious life. If
he were to retain in full force beyond early childhood that part of his
being which is better than the rest, he would be unable to endure its
influence, because his whole being is weakened by the opposite
forces of Lucifer and Ahriman. Man’s organism in the physical world
is so constituted that it is only when he is, so to speak, as soft and
pliable as a child, that he can endure within him those direct forces
of the spiritual world which operate within him during early
childhood. He would be shattered, if during his later life there were
still directly working in him those forces which underlie the faculty of
equilibrium in space, and the formation of the larynx and the brain.
Those forces are so tremendous that, if they were to go on working,
our organism would pine away under the influence of their holiness.
Man must only have recourse to such forces for the purpose of that
kind of activity which brings him into conscious connection with the
supersensible world.
But out of this there arises a thought which is of great
significance, if rightly understood. It is expressed in the New
Testament in the words “Except ye become as little children, ye
cannot enter into the Kingdom of Heaven.” What then becomes
manifest as man’s highest ideal, if what has just been said be rightly
received? Surely this,—the drawing ever nearer and nearer to what
we may call a conscious relation to the forces which work in man
unknown to him during early childhood. Only it must be borne in
mind that man would collapse under the power of those forces, if
they were at once to operate in his conscious life. For this reason,
careful preparation is necessary for the attainment of those faculties
which induce the perception of supersensible worlds. The object of
such preparation is to qualify man to bear what he is unable to bear
in ordinary life.
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.
textbookfull.com