100% found this document useful (1 vote)
16 views54 pages

(Ebook) Supervised Learning with Python: Concepts and Practical Implementation Using Python by Vaibhav Verdhan ISBN 9781484261552, 9781484261569, 1484261550, 1484261569 download

The document is an overview of the ebook 'Supervised Learning with Python' by Vaibhav Verdhan, which covers concepts and practical implementations of supervised learning using Python. It includes information about various supervised learning algorithms, regression and classification techniques, and advanced algorithms for machine learning. The ebook is available for download in multiple formats and includes case studies and technical toolkits for readers.

Uploaded by

kxwabgbxu315
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 (1 vote)
16 views54 pages

(Ebook) Supervised Learning with Python: Concepts and Practical Implementation Using Python by Vaibhav Verdhan ISBN 9781484261552, 9781484261569, 1484261550, 1484261569 download

The document is an overview of the ebook 'Supervised Learning with Python' by Vaibhav Verdhan, which covers concepts and practical implementations of supervised learning using Python. It includes information about various supervised learning algorithms, regression and classification techniques, and advanced algorithms for machine learning. The ebook is available for download in multiple formats and includes case studies and technical toolkits for readers.

Uploaded by

kxwabgbxu315
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/ 54

(Ebook) Supervised Learning with Python:

Concepts and Practical Implementation Using


Python by Vaibhav Verdhan ISBN 9781484261552,
9781484261569, 1484261550, 1484261569install
download
https://ebooknice.com/product/supervised-learning-with-python-
concepts-and-practical-implementation-using-python-22417506

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Supervised Learning with Python: Concepts and Practical Implementation Using
Python by Vaibhav Verdhan ISBN 9781484261569, 1484261569

https://ebooknice.com/product/supervised-learning-with-python-concepts-and-
practical-implementation-using-python-24688908

ebooknice.com

(Ebook) Computer Vision Using Deep Learning: Neural Network Architectures with
Python and Keras by Vaibhav Verdhan ISBN 9781484266151, 1484266153

https://ebooknice.com/product/computer-vision-using-deep-learning-neural-
network-architectures-with-python-and-keras-24606292

ebooknice.com

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018

ebooknice.com

(Ebook) Mastering Machine Learning with Python in Six Steps: A Practical


Implementation Guide to Predictive Data Analytics Using Python by Manohar
Swamynathan (auth.) ISBN 9781484228654, 9781484228661, 1484228650, 1484228669

https://ebooknice.com/product/mastering-machine-learning-with-python-in-six-
steps-a-practical-implementation-guide-to-predictive-data-analytics-using-
python-5880904

ebooknice.com

(Ebook) Unsupervised Learning with Generative AI (MEAP V09) by Vaibhav Verdhan ISBN
9781617298721, 1617298727

https://ebooknice.com/product/unsupervised-learning-with-generative-ai-
meap-v09-56785444

ebooknice.com

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math
Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042

https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-master-
the-sat-subject-test-math-levels-1-2-2326094

ebooknice.com

(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United
States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047

https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

ebooknice.com
Supervised
Learning with
Python
Concepts and Practical
Implementation Using Python

Vaibhav Verdhan
Foreword by Dr. Eli Yechezkiel Kling (PhD)
Supervised Learning
with Python
Concepts and Practical
Implementation Using Python

Vaibhav Verdhan
Foreword by Dr. Eli Yechezkiel Kling (PhD)
Supervised Learning with Python: Concepts and Practical
Implementation Using Python

Vaibhav Verdhan
Limerick, Ireland

ISBN-13 (pbk): 978-1-4842-6155-2 ISBN-13 (electronic): 978-1-4842-6156-9


https://doi.org/10.1007/978-1-4842-6156-9

Copyright © 2020 by Vaibhav Verdhan


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole
or part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical
way, and transmission or information storage and retrieval, electronic adaptation,
computer software, or by similar or dissimilar methodology now known or hereafter
developed.
Trademarked names, logos, and images may appear in this book. Rather than use a
trademark symbol with every occurrence of a trademarked name, logo, or image we use the
names, logos, and images only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms,
even if they are not identified as such, is not to be taken as an expression of opinion as to
whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the
date of publication, neither the authors nor the editors nor the publisher can accept any
legal responsibility for any errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: James Markham
Coordinating Editor: Shrikant Vishwakarma
Cover designed by eStudioCalamar
Cover image designed by Pexels
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201)
348-4505, e-mail [email protected], or visit www.springeronline.com. Apress
Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business
Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for
reprint, paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our
Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub via the book’s product page, located at www.apress.com/
978-1-4842-6155-2. For more detailed information, please visit http://www.apress.com/
source-code.
Printed on acid-free paper
To Yashi, Pakhi and Rudra.
Table of Contents
About the Author���������������������������������������������������������������������������������xi
About the Technical Reviewer�����������������������������������������������������������xiii
Foreword��������������������������������������������������������������������������������������������xv
Acknowledgments����������������������������������������������������������������������������xvii
Introduction���������������������������������������������������������������������������������������xix

Chapter 1: Introduction to Supervised Learning�����������������������������������1


What Is ML?����������������������������������������������������������������������������������������������������������2
Relationship Between Data Analysis, Data Mining, ML, and AI������������������������3
Data, Data Types, and Data Sources����������������������������������������������������������������5
How ML Differs from Software Engineering��������������������������������������������������������10
ML Projects����������������������������������������������������������������������������������������������������12
Statistical and Mathematical Concepts for ML���������������������������������������������������15
Supervised Learning Algorithms�������������������������������������������������������������������������25
Regression vs. Classification Problems���������������������������������������������������������28
Steps in a Supervised Learning Algorithm����������������������������������������������������30
Unsupervised Learning Algorithms���������������������������������������������������������������������34
Cluster Analysis���������������������������������������������������������������������������������������������35
PCA����������������������������������������������������������������������������������������������������������������36
Semi-supervised Learning Algorithms����������������������������������������������������������������37
Technical Stack���������������������������������������������������������������������������������������������������37

v
Table of Contents

ML’s Popularity����������������������������������������������������������������������������������������������������39
Use Cases of ML�������������������������������������������������������������������������������������������������41
Summary������������������������������������������������������������������������������������������������������������44

Chapter 2: Supervised Learning for Regression Analysis������������������47


Technical Toolkit Required����������������������������������������������������������������������������������48
Regression analysis and Use Cases��������������������������������������������������������������������49
What Is Linear Regression����������������������������������������������������������������������������������51
Assumptions of Linear Regression����������������������������������������������������������������56
Measuring the Efficacy of Regression Problem��������������������������������������������������59
Example 1: Creating a Simple Linear Regression������������������������������������������68
Example 2: Simple Linear Regression for Housing Dataset���������������������������71
Example 3: Multiple Linear Regression for Housing Dataset�������������������������78
Nonlinear Regression Analysis����������������������������������������������������������������������������84
Identifying a Nonlinear Relationship�������������������������������������������������������������������88
Assumptions for a Nonlinear Regression������������������������������������������������������89
Challenges with a Regression Model������������������������������������������������������������������91
Tree-Based Methods for Regression�������������������������������������������������������������������94
Case study: Petrol consumption using Decision tree������������������������������������������98
Ensemble Methods for Regression�������������������������������������������������������������������103
Case study: Petrol consumption using Random Forest�������������������������������������106
Feature Selection Using Tree-Based Methods��������������������������������������������������110
Summary����������������������������������������������������������������������������������������������������������113

Chapter 3: Supervised Learning for Classification Problems�����������117


Technical Toolkit Required��������������������������������������������������������������������������������118
Hypothesis Testing and p-Value������������������������������������������������������������������������118
Classification Algorithms����������������������������������������������������������������������������������121
Logistic Regression for Classification���������������������������������������������������������124

vi
Table of Contents

Assessing the Accuracy of the Solution������������������������������������������������������������129


Case Study: Credit Risk�������������������������������������������������������������������������������������136
Additional Notes������������������������������������������������������������������������������������������149
Naïve Bayes for Classification���������������������������������������������������������������������������150
Case Study: Income Prediction on Census Data�����������������������������������������������154
k-Nearest Neighbors for Classification�������������������������������������������������������������163
Case Study: k-Nearest Neighbor�����������������������������������������������������������������������169
The Dataset�������������������������������������������������������������������������������������������������170
Business Objective��������������������������������������������������������������������������������������170
Tree-Based Algorithms for Classification����������������������������������������������������������178
Types of Decision Tree Algorithms��������������������������������������������������������������������182
Summary����������������������������������������������������������������������������������������������������������188

Chapter 4: Advanced Algorithms for Supervised Learning���������������191


Technical Toolkit Required��������������������������������������������������������������������������������192
Boosting Algorithms������������������������������������������������������������������������������������������193
Using Gradient Boosting Algorithm��������������������������������������������������������������198
SVM�������������������������������������������������������������������������������������������������������������������208
SVM in 2-D Space����������������������������������������������������������������������������������������210
KSVM�����������������������������������������������������������������������������������������������������������213
Case Study Using SVM��������������������������������������������������������������������������������215
Supervised Algorithms for Unstructured Data��������������������������������������������������221
Text Data�����������������������������������������������������������������������������������������������������������222
Use Cases of Text Data��������������������������������������������������������������������������������223
Challenges with Text Data���������������������������������������������������������������������������226
Text Analytics Modeling Process�����������������������������������������������������������������228
Text Data Extraction and Management��������������������������������������������������������230

vii
Table of Contents

Preprocessing of Text Data��������������������������������������������������������������������������233


Extracting Features from Text Data�������������������������������������������������������������236
Case study: Customer complaints analysis using NLP��������������������������������������243
Word Embeddings���������������������������������������������������������������������������������������246
Case study: Customer complaints analysis using word embeddings���������������248
Image Data��������������������������������������������������������������������������������������������������������252
Use Cases of Image Data�����������������������������������������������������������������������������253
Challenges with Image Data������������������������������������������������������������������������256
Image Data Management Process���������������������������������������������������������������258
Image Data Modeling Process���������������������������������������������������������������������260
Fundamentals of Deep Learning�����������������������������������������������������������������������261
Artificial Neural Networks���������������������������������������������������������������������������261
Activation Functions������������������������������������������������������������������������������������265
Loss Function in a Neural Network�������������������������������������������������������������268
Optimization in a Neural Network����������������������������������������������������������������268
Neural Network Training Process����������������������������������������������������������������272
Case Study 1: Create a Classification Model on Structured Data����������������������276
Case Study 2: Image Classification Model��������������������������������������������������������281
Summary����������������������������������������������������������������������������������������������������������287

Chapter 5: End-to-End Model Development��������������������������������������291


Technical Toolkit Required��������������������������������������������������������������������������������292
ML Model Development������������������������������������������������������������������������������������292
Step 1: Define the Business Problem����������������������������������������������������������������294
Step 2: Data Discovery Phase���������������������������������������������������������������������������296
Step 3: Data Cleaning and Preparation�������������������������������������������������������������301
Duplicates in the Dataset����������������������������������������������������������������������������302
Categorical Variable Treatment in Dataset���������������������������������������������������304
Missing Values Present in the Dataset��������������������������������������������������������307

viii
Table of Contents

Imbalance in the Dataset����������������������������������������������������������������������������������316


Outliers in the Dataset��������������������������������������������������������������������������������������321
Other Common Problems in the Dataset�����������������������������������������������������������325
Step 4: EDA�������������������������������������������������������������������������������������������������������328
Step 5: ML Model Building��������������������������������������������������������������������������������335
Train/Test Split of Data��������������������������������������������������������������������������������336
Finding the Best Threshold for Classification Algorithms����������������������������342
Overfitting vs. Underfitting Problem������������������������������������������������������������343
Key Stakeholder Discussion and Iterations�������������������������������������������������350
Presenting the Final Model��������������������������������������������������������������������������350
Step 6: Deployment of the Model����������������������������������������������������������������������351
Step 7: Documentation��������������������������������������������������������������������������������������363
Step 8: Model Refresh and Maintenance����������������������������������������������������������363
Summary����������������������������������������������������������������������������������������������������������364

Index�������������������������������������������������������������������������������������������������367

ix
About the Author
Vaibhav Verdhan has 12+ years of experience
in data science, machine learning, and
artificial intelligence. An MBA with
engineering background, he is a hands-on
technical expert with acumen to assimilate
and analyze data. He has led multiple
engagements in ML and AI across geographies
and across retail, telecom, manufacturing,
energy, and utilities domains. Currently
he resides in Ireland with his family and is
working as a Principal Data Scientist.

xi
About the Technical Reviewer
Irfan Elahi is a full stack customer-focused
cloud analytics specialist bearing the unique
and proven combination of diverse consulting
and technical competencies (cloud, big
data, and machine learning) with a growing
portfolio of successful projects delivering
substantial impact and value in multiple
capacities across telecom, retail, energy,
and health-care sectors. Additionally, he is
an analytics evangelist as is evident from
the published book, Udemy courses, blogposts, trainings, lectures, and
presentations with global reach.

xiii
Foreword
How safe is home birthing? That is a good question. Pause a moment and
let yourself contemplate it.
I am sure you can see how the answer to this question can affect
personal decisions and policy choices. The answer could be given as a
probability, a level classification, or an alternative cost. Another natural
reaction is “it depends.” There are many factors that could affect the safety
of home birthing.
I took you through this thought exercise to show you that you naturally
think like a data scientist. You understood the importance of stipulating
clearly the focus of the analysis and what could explain different outcomes.
The reason you are embarking on a journey through this book is that you
are not sure how to express these instinctive notions mathematically and
instruct a computer to “find” the relationship between the “Features” and
the “Target.”
When I started my career 30-odd years ago, this was the domain
of statisticians who crafted a mathematical language to describe
relationships and noise. The purpose of predictive modeling was in its
essence to be a tool for separating a signal or a pattern out of seemingly
chaotic information and reporting how well the partition was done.
Today, machine learning algorithms harnessing computing brute force
add a new paradigm. This has created a new profession: the data scientist.
The data scientist is a practitioner who can think in terms of statistical
methodology, instruct a computer to carry out the required processing,
and interpret the results and reports.

xv
Foreword

Becoming a good data scientist is a journey that starts with learning the
basics and mechanics. Once you are done exploring this book you might
also be able to better see where you will want to deepen your theoretical
knowledge. I would like to suggest you might find it interesting to look into
the theory of statistical modeling in general and the Bayesian paradigm
specifically. Machine learning is computational statistics after all.
Dr. Eli. Y. Kling (BSc. Eng. MSc. PHD) London, UK. June 2020.

xvi
Acknowledgments
I would like to thank Apress publications, Celestin John, Shrikant
Vishwarkarma, and Irfan Elahi for the confidence shown and the support
extended. Many thanks to Dr. Eli Kling for the fantastic forward to the
book. Special words for my family—Yashi, Pakhi, and Rudra—without their
support it would have been impossible to complete this work.

xvii
Introduction
“It is tough to make predictions, especially about the future.”
—Yogi Berra

In 2019, MIT’s Katie Bouman processed five petabytes of data to develop


the first-ever image of a black hole. Data science, machine learning, and
artificial intelligence played a central role in this extraordinary discovery.
Data is the new electricity, and as per HBR, data scientist is the
“sexiest” job of the 21st century. Data is fueling business decisions and
making its impact felt across all sectors and walks of life. It is allowing us
to create intelligent products, improvise marketing strategies, innovate
business strategies, enhance safety mechanisms, arrest fraud, reduce
environmental pollution, and create path-breaking medicines. Our
everyday life is enriched and our social media interactions are more
organized. It is allowing us to reduce costs, increase profits, and optimize
operations. It offers a fantastic growth and career path ahead, but there is a
dearth of talent in the field.
This book attempts to educate the reader in a branch of machine
learning called supervised learning. This book covers a spectrum of
supervised learning algorithms and respective Python implementations.
Throughout the book, we are discussing building blocks of algorithms,
their nuts and bolts, mathematical foundations, and background process.
The learning is complemented by developing actual Python code from
scratch with step-by-step explanation of the code.

xix
Introduction

The book starts with an introduction to machine learning where


machine learning concepts, the difference between supervised, ­
semi-­supervised, and unsupervised learning approaches, and practical
use cases are discussed. In the next chapter, we examine regression
algorithms like linear regression, multinomial regression, decision tree,
random forest, and so on. It is then followed by a chapter on classification
algorithms using logistic regression, naïve Bayes, knn, decision tree, and
random forest. In the next chapter, advanced concepts of GBM, SVM, and
neural network are studied. We are working on structured data as well
as text and image data in the book. Pragmatic Python implementation
complements the understanding. It is then followed by the final chapter on
end-to-end model development. The reader gets Python code, datasets,
best practices, resolution of common issues and pitfalls, and pragmatic
first-hand knowledge on implementing algorithms. The reader will be able
to run the codes and extend them in an innovative manner, as well as will
understand how to approach a supervised learning problem. Your prowess
as a data science enthusiast is going to get a big boost, so get ready for
these fruitful lessons!
The book is suitable for researchers and students who want to
explore supervised learning concepts with Python implementation. It
is recommended for working professionals who yearn to stay on the
edge of technology, clarify advanced concepts, and get best practices
and solutions to common challenges. It is intended for business leaders
who wish to gain first-hand knowledge and develop confidence while
they communicate with their teams and clientele. Above all, it is meant
for a curious person who is trying to explore how supervised learning
algorithms work and who would like to try Python.
Stay blessed, stay healthy!
—Vaibhav Verdhan
Limerick,
Ireland. June 2020

xx
CHAPTER 1

Introduction to
Supervised Learning
“The future belongs to those who prepare for it today.”
— Malcom X

The future is something which always interests us. We want to know


what lies ahead and then we can plan for it. We can mold our business
strategies, minimize our losses, and increase our profits if we can predict
the future. Predicting is traditionally intriguing for us. And you have just
taken the first step to learning about predicting the future. Congratulations
and welcome to this exciting journey!
You may have heard that data is the new oil. Data science and machine
learning (ML) are harnessing this power of data to generate predictions for
us. These capabilities allow us to examine trends and anomalies, gather
actionable insights, and provide direction to our business decisions. This
book assists in developing these capabilities. We are going to study the
concepts of ML and develop pragmatic code using Python. You are going
to use multiple datasets, generate insights from data, and create predictive
models using Python.
By the time you finish this book, you will be well versed in the concepts
of data science and ML with a focus on supervised learning. We will
examine concepts of supervised learning algorithms to solve regression

© Vaibhav Verdhan 2020 1


V. Verdhan, Supervised Learning with Python,
https://doi.org/10.1007/978-1-4842-6156-9_1
Chapter 1 Introduction to Supervised Learning

problems, study classification problems, and solve different real-life case


studies. We will also study advanced supervised learning algorithms and
deep learning concepts. The datasets are structured as well as text and
images. End-to-end model development and deployment process are
studied to complete the entire learning.
In this process, we will be examining supervised learning algorithms,
the nuts and bolts of them, statistical and mathematical equations and the
process, what happens in the background, and how we use data to create
the solutions. All the codes use Python and datasets are uploaded to a
GitHub repository (https://github.com/Apress/supervised-learning-­
w-python) for easy access. You are advised to replicate those codes
yourself.
Let’s start this learning journey.

What Is ML?
When we post a picture on Facebook or shop at Amazon, tweet or watch
videos on YouTube, each of these platforms is collecting data for us. At
each of these interactions, we are leaving behind our digital footprints.
These data points generated are collected and analyzed, and ML allows
these giants to make logical recommendations to us. Based on the genre
of videos we like, Netflix/YouTube can update our playlist, what links we
can click, and status we can react to; Facebook can recommend posts to us,
observing what type of product we frequently purchase; and Amazon can
suggest our next purchase as per our pocket size! Amazing, right?
The short definition for ML is as follows: “In Machine Learning, we
study statistical/mathematical algorithms to learn the patterns from the
data which are then used to make predictions for the future.”
And ML is not limited to the online mediums alone. Its power has been
extended to multiple domains, geographies, and use cases. We will be
describing those use cases in detail in the last section of this chapter.

2
Chapter 1 Introduction to Supervised Learning

So, in ML, we analyze vast amounts of data and uncover the patterns in it.
These patterns are then applied on real-world data to make predictions
for the future. This real-world data is unseen, and the predictions will help
businesses shape their respective strategies. We do not need to explicitly
program computers to do these tasks; rather, the algorithms take the
decisions based on historical data and statistical models.
But how does ML fit into the larger data analysis landscape? Often,
we encounter terms like data analysis, data mining, ML, and artificial
intelligence (AI). Data science is also a loosely used phrase with no
exact definition available. It will be a good idea if these terms are
explored now.

 elationship Between Data Analysis, Data


R
Mining, ML, and AI
Data mining is a buzzword nowadays. It is used to describe the process of
collecting data from large datasets, databases, and data lakes, extracting
information and patterns from that data, and transforming these insights
into usable structure. It involves data management, preprocessing,
visualizations, and so on. But it is most often the very first step in any data
analysis project.
The process of examining the data is termed data analysis. Generally,
we trend the data, identify the anomalies, and generate insights using
tables, plots, histograms, crosstabs, and so on. Data analysis is one of the
most important steps and is very powerful since the intelligence generated
is easy to comprehend, relatable, and straightforward. Often, we use
Microsoft Excel, SQL for EDA. It also serves as an important step before
creating an ML model.
There is a question quite often discussed—what is the relationship
between ML, AI, and deep learning? And how does data science fit in?
Figure 1-1 depicts the intersections between these fields. AI can be

3
Chapter 1 Introduction to Supervised Learning

thought of as automated solutions which replace human-intensive tasks.


AI hence reduces the cost and time consumed as well as improving the
overall efficiency.

$XWRPDWLRQ6ROXWLRQV
$UWLILFLDO
,QWHOOLJHQFH

0DFKLQH
/HDUQLQJ

&ODVVLF 'DWD6FLHQFH
0DFKLQH/HDUQLQJ
'HHS
/HDUQLQJ

1HXUDO1HWZRUNV

Figure 1-1. Relationship between AI, ML, deep learning, and data
science shows how these fields are interrelated with each other and
empower each other

Deep learning is one of the hottest trends now. Neural networks are
the heart and soul of deep learning. Deep learning is a subset of AI and ML
and involves developing complex mathematical models to solve business
problems. Mostly we use neural networks to classify images and analyze
text audio and video data.
Data science lies at the juxtaposition of these various domains. It
involves not only ML but also statistics understanding, coding expertise
and business acumen to solve business problems. A data scientist’s job
is to solve business problems and generate actionable insights for the
business. Refer to Table 1-1 to understand the capabilities of data science
and its limitations.

4
Chapter 1 Introduction to Supervised Learning

Table 1-1. Data Science: How Can It Help Us, Its Usages, and
Limitations
How data science can help Limitations of data science
Assist in making decisions by analyzing multi
dimensional data which is quite difficult for a Data is not an alternative to experience
human being
Use statistical tools & techniques to uncover Data science cannot replace the subject matter
patterns knowledge
Data science depends on data availability and
The algorithms further help in measuring the
data quality. Depending on the input,we will get
accuracy of the patterns & the claims
the output
Data science will not increase the revenue or
The results are reproducible and can be improved sales or output by 50% overnight. Similarly, it will
not decrease the cost by 1/3 immediately
The machine learns, which is a big difference A data science project takes time to be
-from the traditional software engineering implemented

With the preceding discussion, the role of ML and its relationship with
other data-related fields should be clear to you. You would have realized by
now that “data” plays a pivotal role in ML. Let’s explore more about data,
its types and attributes.

Data, Data Types, and Data Sources


You already have some understanding of data for sure. It will be
a good idea to refresh that knowledge and discuss different types
of datasets generated and examples of it. Figure 1-2 illustrates the
differentiation of data.

5
Chapter 1 Introduction to Supervised Learning

Figure 1-2. Data can be divided between structured and unstructured.


Structured data is easier to work upon while generally deep learning
is used for unstructured data

Data is generated in all the interactions and transactions we do.


Online or offline: we generate data every day, every minute. At a bank,
a retail outlet, on social media, making a mobile call: every interaction
generates data.
Data comes in two flavors: structured data and unstructured data.
When you make that mobile call to your friend, the telecom operator
gets the data of the call like call duration, call cost, time of day, and so on.
Similarly, when you make an online transaction using your bank portal,
data is generated around the amount of transaction, recipient, reason
of transaction, date/time, and so on. All such data points which can be
represented in a row-column structure are called structured data. Most of
the data used and analyzed is structured. That data is stored in databases
and servers using Oracle, SQL, AWS, MySQL, and so on.

6
Chapter 1 Introduction to Supervised Learning

Unstructured data is the type which cannot be represented in a row-­


column structure, at least in its basic format. Examples of unstructured
data are text data (Facebook posts, tweets, reviews, comments, etc.),
images and photos (Instagram, product photos), audio files (jingles,
recordings, call center calls), and videos (advertisements, YouTube posts,
etc.). All of the unstructured data can be saved and analyzed though. As
you would imagine, it is more difficult to analyze unstructured data than
structured data. An important point to be noted is that unstructured
data too has to be converted into integers so that the computers can
understand it and can work on it. For example, a colored image has
pixels and each pixel has RGB (red, green, blue) values ranging from 0
to 255. This means that each image can be represented in the form of
matrices having integers. And hence that data can be fed to the computer
for further analysis.

Note We use techniques like natural language processing, image


analysis, and neural networks like convolutional neural networks,
recurrent neural networks, and so on to analyze text and image data.

A vital aspect often ignored and less discussed is data quality. Data
quality determines the quality of the analysis and insights generated.
Remember, garbage in, garbage out.
The attributes of a good dataset are represented in Figure 1-3.
While you are approaching a problem, it is imperative that you spend
a considerable amount of time ascertaining that your data is of the
highest quality.

7
Chapter 1 Introduction to Supervised Learning

Figure 1-3. Data quality plays a vital role in development of an


ML solution; a lot of time and effort are invested in improving
data quality

We should ensure that data available to us conforms to the following


standards:

• Completeness of data refers to the percentage of


available attributes. In real-world business, we find
that many attributes are missing, or have NULL or NA
values. It is advisable to ensure we source the data
properly and ensure its completeness. During the
data preparation phase, we treat these variables and
replace them or drop them as per the requirements. For
example, if you are working on retail transaction data,
we have to ensure that revenue is available for all or
almost all of the months.

8
Chapter 1 Introduction to Supervised Learning

• Data validity is to ensure that all the key performance


indicators (KPI) are captured during the data
identification phase. The inputs from the business
subject matter experts (SMEs) play a vital role in
ensuring this. These KPIs are calculated and are
verified by the SMEs. For example, while calculating the
average call cost of a mobile subscriber, the SME might
suggest adding/deleting few costs like spectrum cost,
acquisition cost, and so on.

• Accuracy of the data is to make sure all the data points


captured are correct and no inconsistent information
is in our data. It is observed that due to human error
or software issues, sometimes wrong information is
captured. For example, while capturing the number of
customers purchasing in a retail store, weekend figures
are mostly higher than weekdays. This is to be ensured
during the exploratory phase.

• Data used has to be consistent and should not vary


between systems and interfaces. Often, different
systems are used to represent a KPI. For example, the
number of clicks on a website page might be recorded
in different ways. The consistency in this KPI will
ensure that correct analysis is done, and consistent
insights are generated.

• While you are saving the data in databases and tables,


often the relationships between various entities and
attributes are not consistent or worse may not exist.
Data integrity of the system ensures that we do not face
such issues. A robust data structure is required for an
efficient, complete, and correct data mining process.

9
Chapter 1 Introduction to Supervised Learning

• The goal of data analytics is to find trends and


patterns in the data. There are seasonal variations,
movements with respect to days/time and events,
and so on. Sometimes it is imperative that we capture
data of the last few years to measure the movement
of KPIs. The timeliness of the data captured has to be
representative enough to capture such variations.

Most common issues encountered in data are missing values,


duplicates, junk values, outliers, and so on. You will study in detail how to
resolve these issues in a logical and mathematical manner.
By now, you have understood what ML is and what the attributes
of good-quality data are to ensure good analysis. But still a question is
unanswered. When we have software engineering available to us, why do
we still need ML? You will find the answer to this question in the following
section.

How ML Differs from Software Engineering


Software engineering and ML both solve business problems. Both
interact with databases, analyze and code modules, and generate outputs
which are used by the business. The business domain understanding is
imperative for both fields and so is the usability. On these parameters,
both software engineering and ML are similar. However, the key
difference lies in the execution and the approach used to solve the
business challenge.
Software writing involves writing precise code which can be executed
by the processor, that is, the computer. On the other hand, ML collects
historical data and understands trends in the data. Based on the trends,
the ML algorithm will predict the desired output. Let us look at it with an
easy example first.

10
Another Random Scribd Document
with Unrelated Content
nage,
Et mon pied peureux froisse, au bord du
marécage,
Des crapauds imprévus et de froids
limaçons.

LE JET D'EAU

Tes beaux yeux sont las, pauvre amante!


Reste longtemps sans les rouvrir,
Dans cette pose nonchalante
Où t'a surprise le plaisir.

Dans la cour le jet d'eau qui jase


Et ne se tait ni nuit ni jour
Entretient doucement l'extase
Où ce soir m'a plongé l'amour.

La gerbe épanouie
En mille fleurs,
Où Phœbé réjouie
Met ses couleurs,
Tombe comme une pluie
De larges pleurs.

Ainsi ton âme qu'incendie


L'éclair brûlant des voluptés
S'élance, rapide et hardie,
Vers les vastes cieux enchantés.
Puis elle s'épanche, mourante,
En un flot de triste langueur,
Qui par une invisible pente
Descend jusqu'au fond de mon cœur.
La gerbe épanouie
En mille fleurs,
Où Phœbé réjouie
Met ses couleurs,
Tombe comme une pluie
De larges pleurs.

O toi que la nuit rend si belle,


Qu'il m'est doux, penché vers tes seins,
D'écouter la plainte éternelle
Qui sanglote dans les bassins!
Lune, eau sonore, nuit bénie,
Arbres qui frissonnez autour,
Votre pure mélancolie
Est le miroir de mon amour.

La gerbe épanouie
En mille fleurs,
Où Phœbé réjouie
Met ses couleurs,
Tombe comme une pluie
De larges pleurs.
VARIANTES DE «LA PETITE REVUE» (8 juillet 1865).
Refrain, vers 1, 2, 3, 4 et 5.
La gerbe d'eau qui verse
Ses mille fleurs,
Que la lune traverse
De ses lueurs
Tombe comme une averse

LES YEUX DE BERTHE


Vous pouvez mépriser les yeux les plus
célèbres,
Beaux yeux de mon enfant, par où filtre
et s'enfuit
Je ne sais quoi de bon, de doux comme
la Nuit!
Beaux yeux, versez sur moi vos
charmantes ténèbres!

Grands yeux de mon enfant, arcanes


adorés,
Vous ressemblez beaucoup à ces grottes
magiques
Où, derrière l'amas des ombres
léthargiques,
Scintillent vaguement des trésors ignorés!

Mon enfant a des yeux obscurs, profonds


et vastes,
Comme toi, Nuit immense, éclairés
comme toi!
Leurs feux sont ces pensers d'Amour,
mêlés de Foi,
Qui pétillent au fond, voluptueux ou
chastes.

HYMNE

A la très chère, à la très belle


Qui remplit mon cœur de clarté,
A l'ange, à l'idole immortelle,
Salut en immortalité!

Elle se répand dans ma vie


Comme un air imprégné de sel,
Et dans mon âme inassouvie
Verse le goût de l'éternel.

Sachet toujours frais qui parfume


L'atmosphère d'un cher réduit.
Encensoir oublié qui fume
En secret à travers la nuit.

Comment, amour incorruptible,


T'exprimer avec vérité?
Grain de musc qui gis, invisible,
Au fond de mon éternité!

A la très bonne, à la très belle


Qui fait ma joie et ma santé,
A l'ange, à l'idole immortelle,
Salut en immortalité!

VERS POUR LE PORTRAIT


DE M. HONORÉ DAUMIER

Celui dont nous t'offrons l'image,


Et dont l'art, subtil entre tous,
Nous enseigne à rire de nous,
Celui-là, lecteur, est un sage.

C'est un satirique, un moqueur;


Mais l'énergie avec laquelle
Il peint le Mal et sa séquelle
Prouve la beauté de son cœur.

Son rire n'est pas la grimace


De Melmoth ou de Méphisto
Sous la torche de l'Alecto
Qui les brûle, mais qui nous glace:

Leur rire, hélas! de la gaîté


N'est que la douloureuse charge;
Le sien rayonne, franc et large,
Comme un signe de sa bonté!

LOLA DE VALENCE

INSCRIPTION POUR LE TABLEAU D'ÉDOUARD MANET

Entre tant de beautés que partout on


peut voir,
Je comprends bien, amis, que le désir
balance;
Mais on voit scintiller en Lola de Valence
Le charme inattendu d'un bijou rose et
noir.

SUR LE TASSE EN PRISON

D'EUGÈNE DELACROIX

Le poète au cachot, débraillé, maladif,


Roulant un manuscrit sous son pied
convulsif,
Mesure d'un regard que la terreur
enflamme
L'escalier de vertige où s'abîme son âme.

Les rires enivrants dont s'emplit la prison


Vers l'étrange et l'absurde invitent sa
raison;
Le Doute l'environne, et la Peur ridicule,
Hideuse et multiforme, autour de lui
circule.

Ce génie enfermé dans un taudis malsain,


Ces grimaces, ces cris, ces spectres dont
l'essaim
Tourbillonne, ameuté derrière son oreille,

Ce rêveur que l'horreur de son logis


réveille,
Voilà bien ton emblème, Ame aux songes
obscurs,
Que le Réel étouffe entre ses quatre
murs!

LA VOIX

Mon berceau s'adossait à la bibliothèque,


Babel sombre, où roman, science, fabliau,
Tout, la cendre latine et la poussière
grecque,
Se mêlaient. J'étais haut comme un in-
folio.
Deux voix me parlaient. L'une, insidieuse
et ferme,
Disait: «La Terre est un gâteau plein de
douceur;
Je puis (et ton plaisir serait alors sans
terme!)
Te faire un appétit d'une égale grosseur.»
Et l'autre: «Viens! oh! viens voyager dans
les rêves,
Au delà du possible, au delà du connu!»
Et celle-là chantait comme le vent des
grèves,
Fantôme vagissant, on ne sait d'où venu,
Qui caresse l'oreille et cependant l'effraie.
Je te répondis: «Oui! douce voix!» C'est
d'alors
Que date ce qu'on peut, hélas! nommer
ma plaie
Et ma fatalité. Derrière les décors
De l'existence immense, au plus noir de
l'abîme,
Je vois distinctement des mondes
singuliers,
Et, de ma clairvoyance extatique victime,
Je traîne des serpents qui mordent mes
souliers.
Et c'est depuis ce temps que, pareil aux
prophètes,
J'aime si tendrement le désert et la mer;
Que je ris dans les deuils et pleure dans
les fêtes,
Et trouve un goût suave au vin le plus
amer;
Que je prends très souvent les faits pour
des mensonges,
Et que, les yeux au ciel, je tombe dans
des trous.
Mais la Voix me console et dit: «Garde
tes songes;
Les sages n'en ont pas d'aussi beaux que
les fous!»

L'IMPRÉVU
Harpagon, qui veillait son père agonisant,
Se dit, rêveur, devant ces lèvres déjà
blanches:
«Nous avons au grenier un nombre
suffisant,
Ce me semble, de vieilles
planches!»

Célimène roucoule et dit: «Mon cœur est


bon,
Et naturellement Dieu m'a faite très
belle.»
—Son cœur! cœur racorni, fumé comme
un jambon,
Recuit à la flamme éternelle!

Un gazetier fumeux, qui se croit un


flambeau,
Dit au pauvre, qu'il a noyé dans les
ténèbres:
«Où donc l'aperçois-tu, ce Créateur du
Beau,
Ce Redresseur que tu célèbres?»

Mieux que tous, je connais certain


voluptueux
Qui bâille nuit et jour, et se lamente et
pleure,
Répétant, l'impuissant et le fat: «Oui, je
veux
Être vertueux, dans une heure!»

L'horloge, à son tour, dit à voix basse: «Il


est mûr,
Le damné! J'avertis en vain la chair
infecte.
L'homme est aveugle, sourd, fragile,
comme un mur
Qu'habite et que ronge un
insecte!»

Et puis, Quelqu'un paraît, que tous


avaient nié,
Et qui leur dit, railleur et fier: «Dans mon
ciboire,
Vous avez, que je crois, assez communié,
A la joyeuse Messe noire!

«Chacun de vous m'a fait un temple dans


son cœur;
Vous avez, en secret, baisé ma fesse
immonde.
Reconnaissez Satan à son rire vainqueur.
Énorme et laid comme le monde!

«Avez-vous donc pu croire, hypocrites


surpris,
Qu'on se moque du maître, et qu'avec lui
l'on triche,
Et qu'il soit naturel de recevoir deux prix,
D'aller au Ciel et d'être riche?

«Il faut que le gibier paye le vieux


chasseur
Qui se morfond longtemps à l'affût de la
proie.
Je vais vous emporter à travers
l'épaisseur,
Compagnons de ma triste joie,

«A travers l'épaisseur de la terre et du


roc,
A travers les amas confus de votre
cendre,
Dans un palais aussi grand que moi, d'un
seul bloc,
Et qui n'est pas de pierre tendre;

«Car il est fait avec l'universel Péché


Et contient mon orgueil, ma douleur et
ma gloire!»
—Cependant, tout en haut de l'univers
juché,
Un ange sonne la victoire

De ceux dont le cœur dit: «Que béni soit


ton fouet,
Seigneur! que la douleur, ô Père, soit
bénie!
Mon âme dans tes mains n'est pas un
vain jouet,
Et ta prudence est infinie.»

Le son de la trompette est si délicieux,


Dans ces soirs solennels de célestes
vendanges,
Qu'il s'infiltre comme une extase dans
tous ceux
Dont elle chante les louanges.

LA RANÇON

L'homme a, pour payer sa rançon,


Deux champs au tuf profond et riche,
Qu'il faut qu'il remue et défriche
Avec le fer de la raison;
Pour obtenir la moindre rose,
Pour extorquer quelques épis,
Des pleurs salés de son front gris
Sans cesse il faut qu'il les arrose.

L'un est l'Art et l'autre l'Amour.


—Pour rendre le juge propice,
Lorsque de la stricte justice
Paraîtra le terrible jour,

Il faudra lui montrer des granges


Pleines de moissons et des fleurs
Dont les formes et les couleurs
Gagnent le suffrage des Anges.

A UNE MALABARAISE

Tes pieds sont aussi fins que tes mains,


et ta hanche
Est large à faire envie à la plus belle
blanche;
A l'artiste pensif ton corps est doux et
cher;
Tes grands yeux de velours sont plus
noirs que ta chair.
Aux pays chauds et bleus où ton Dieu t'a
fait naître
Ta tâche est d'allumer la pipe de ton
maître,
De pourvoir les flacons d'eaux fraiches et
d'odeurs,
De chasser loin du lit les moustiques
rôdeurs,
Et, dès que le matin fait chanter les
platanes,
D'acheter au bazar ananas et bananes.
Tout le jour, où tu veux tu mènes tes
pieds nus,
Et fredonnes tout bas de vieux airs
inconnus;
Et quand descend le soir au manteau
d'écarlate,
Tu poses doucement ton corps sur une
natte,
vOù tes rêves flottants sont pleins de
colibris,
Et toujours, comme toi, gracieux et
fleuris.
Pourquoi, l'heureuse enfant, veux-tu voir
notre France,
Ce pays trop peuplé que fauche la
souffrance,
Et, confiant ta vie aux bras forts des
marins,
Faire de grands adieux à tes chers
tamarins?
Toi, vêtue à moitié de mousselines frêles,
Frissonnante là-bas sous la neige et les
grêles,
Comme tu pleurerais tes loisirs doux et
francs,
Si, le corset brutal emprisonnant tes
flancs,
Il te fallait glaner ton souper dans nos
fanges
Et vendre le parfum de tes charmes
étranges,
L'œil pensif et suivant, dans nos sales
brouillards,
Des cocotiers absents les fantômes épars!
VARIANTE
Cette pièce parut d'abord dans l'Artiste du 13 décembre 1846, sous
le titre A une Indienne. Elle était terminée par les six vers suivants:
Amour de l'inconnu, jus de l'antique
pomme,
Vieille perdition de la femme et de
l'homme,
O curiosité, toujours tu leur feras
Déserter, comme font les oiseaux, ces
ingrats,
Pour un lointain mirage et des cieux
moins prospères
Le toit qu'ont parfumé les cercueils de
leurs pères.

PIÈCES EXTRAITES
DE L'ÉDITION POSTHUME DITE "DÉFINITIVE" (1868>

A THÉODORE DE BANVILLE

1842

Vous avez empoigné les crins de la


Déesse
Avec un tel poignet, qu'on vous eût pris,
à voir
Et cet air de maîtrise et ce beau
nonchaloir.
Pour un jeune ruffian terrassant sa
maîtresse.

L'œil clair et plein du feu de la précocité,


Vous avez prélassé votre orgueil
d'architecte
Dans des constructions dont l'audace
correcte
Fait voir quelle sera votre maturité.

Poète, notre sang nous fuit par chaque


pore;
Est-ce que par hasard la robe du
Centaure
Qui changeait toute veine en funèbre
ruisseau,

Était teinte trois fois dans les baves


subtiles
De ces vindicatifs et monstrueux reptiles
Que le petit Hercule étranglait au
berceau?

LE CALUMET DE PAIX

IMITÉ DE LONGFELLOW

Or Gitche Manito[14], le Maître de la Vie,


Le Puissant, descendit dans la verte
prairie,
Dans l'immense prairie aux coteaux
montueux;
Et là, sur les rochers de la Rouge
Carrière,
Dominant tout l'espace et baigné de
lumière,
Il se tenait debout, vaste et majestueux.

Alors il convoqua les peuples


innombrables,
Plus nombreux que ne sont les herbes et
les sables.
Avec sa main terrible il rompit un
morceau
Du rocher, dont il fit une pipe superbe,
Puis, au bord du ruisseau, dans une
énorme gerbe,
Pour s'en faire un tuyau, choisit un long
roseau.

Pour la bourrer il prit au saule son


écorce;
Et lui, le Tout-Puissant, Créateur de la
Force,
Debout, il alluma, comme un divin fanal,
La Pipe de la Paix. Debout sur la Carrière
Il fumait, droit, superbe et baigné de
lumière.
Or pour les nations c'était le grand signal.

Et lentement montait la divine fumée


Dans l'air doux du matin, onduleuse,
embaumée.
Et d'abord ce ne fut qu'un sillon
ténébreux;
Puis la vapeur se fit plus bleue et plus
épaisse,
Puis blanchit; et montant, et grossissant
sans cesse,
Elle alla se briser au dur plafond des
deux.

Des plus lointains sommets des


Montagnes Rocheuses,
Depuis les lacs du Nord aux ondes
tapageuses,
Depuis Tawasentha, le vallon sans pareil,
Jusqu'à Tuscaloosa, la forêt parfumée,
Tous virent le signal et l'immense fumée
Montant paisiblement dans le matin
vermeil.

Les Prophètes disaient: «Voyez-vous


cette bande
De vapeur, qui, semblable à la main qui
commande,
Oscille et se détache en noir sur le soleil?
C'est Gitche Manito, le Maître de la Vie,
Qui dit aux quatre coins de l'immense
prairie:
«Je vous convoque tous, guerriers, à mon
conseil!»

Par le chemin des eaux, par la route des


plaines,
Par les quatre côtés d'où soufflent les
haleines
Du vent, tous les guerriers de chaque
tribu, tous,
Comprenant le signal du nuage qui
bouge,
Vinrent docilement à la Carrière Rouge
Où Gitche Manito leur donnait rendez-
vous.
Les guerriers se tenaient sur la verte
prairie,
Tous équipés en guerre, et la mine
aguerrie,
Bariolés ainsi qu'un feuillage automnal;
Et la haine qui fait combattre tous les
êtres,
La haine qui brûlait les yeux de leurs
ancêtres
Incendiait encor leurs yeux d'un feu fatal.

Et leurs yeux étaient pleins de haine


héréditaire.
Or Gitche Manito, le Maître de la Terre,
Les considérait tous avec compassion,
Comme un père très bon, ennemi du
désordre,
Qui voit ses chers petits batailler et se
mordre.
Tel Gitche Manito pour toute nation.

Il étendit sur eux sa puissante main


droite
Pour subjuguer leur cœur et leur nature
étroite,
Pour rafraîchir leur fièvre à l'ombre de sa
main;
Puis il leur dit avec sa voix majestueuse,
Comparable à la voix d'une eau
tumultueuse
Qui tombe et rend un son monstrueux,
surhumain:

II
«O ma postérité, déplorable et chérie!
O mes fils! écoutez la divine raison.
C'est Gitche Manito, le Maître de la Vie,
Qui vous parle! celui qui dans votre patrie
A mis l'ours, le castor, le renne et le
bison.

Je vous ai fait la chasse et la pêche


faciles;
Pourquoi donc le chasseur devient-il
assassin?
Le marais fut par moi peuplé de volatiles;
Pourquoi n'êtes-vous pas contents, fils
indociles?
Pourquoi l'homme fait-il la chasse à son
voisin?

Je suis vraiment bien las de vos horribles


guerres.
Vos prières, vos vœux même sont des
forfaits!
Le péril est pour vous dans vos humeurs
contraires
Et c'est dans l'union qu'est votre force. En
frères
Vivez donc, et sachez vous maintenir en
paix.

Bientôt vous recevrez de ma main un


Prophète
Qui viendra vous instruire et souffrir avec
vous.
Sa parole fera de la vie une fête;
Mais si vous méprisez sa sagesse
parfaite,
Pauvres enfants maudits, vous
disparaîtrez tous!

Effacez dans les flots vos couleurs


meurtrières.
Les roseaux sont nombreux et le roc est
épais;
Chacun en peut tirer sa pipe. Plus de
guerres,
Plus de sang! Désormais vivez comme
des frères,
Et, tous unis, fumez le Calumet de Paix!»

III

Et soudain tous, jetant leurs armes sur la


terre,
Lavent dans le ruisseau les couleurs de la
guerre
Qui luisaient sur leurs fronts cruels et
triomphants
Chacun creuse une pipe et cueille sur la
rive
Un long roseau qu'avec adresse il
enjolive.
Et l'Esprit souriait à ses pauvres enfants!

Chacun s'en retourna l'âme calme et


ravie.
Et Gitche Manito, le Maître de la Vie,
Remonta par la porte entr'ouverte des
cieux.
—A travers la vapeur splendide du nuage
Le Tout-Puissant montait, content de son
ouvrage
Immense, parfumé, sublime, radieux!
LA PRIÈRE D'UN PAÏEN

Ah! ne ralentis pas tes flammes;


Réchauffe mon cœur engourdi,
Volupté, torture des âmes!
Diva! supplicem exaudi!

Déesse dans l'air répandue,


Flamme dans notre souterrain!
Exauce une âme morfondue,
Qui te consacre un chant d'airain.

Volupté, sois toujours ma reine!


Prends le masque d'une sirène
Faite de chair et de velours,

Ou verse-moi tes sommeils lourds


Dans le vin informe et mystique,
Volupté, fantôme élastique!

LE COUVERCLE

En quelque lieu qu'il aille, ou sur mer ou


sur terre.
Sous un climat de flamme ou sous un
soleil blanc.
Serviteur de Jésus, courtisan de Cythère,
Mendiant ténébreux ou Crésus rutilant,

Citadin, campagnard, vagabond,


sédentaire,
Que son petit cerveau soit actif ou soit
lent,
Partout l'homme subit la terreur du
mystère,
Et ne regarde en haut qu'avec un œil
tremblant.

En haut, le Ciel! ce mur de caveau qui


l'étouffe.
Plafond illuminé pour un opéra bouffe
Où chaque histrion foule un sol
ensanglanté;

Terreur du libertin, espoir du fol ermite;


Le Ciel! couvercle noir de la grande
marmite
Où bout l'imperceptible et vaste
Humanité.

L'EXAMEN DE MINUIT

La pendule, sonnant minuit,


Ironiquement nous engage
A nous rappeler quel usage
Nous fîmes du jour qui s'enfuit:
—Aujourd'hui, date fatidique,
Vendredi, treize, nous avons,
Malgré tout ce que nous savons,
Mené le train d'un hérétique.

Nous avons blasphémé Jésus,


Des Dieux le plus incontestable!
Comme un parasite à la table
De quelque monstrueux Crésus,

Nous avons, pour plaire à la brute,


Digne vassale des Démons,
Insulté ce que nous aimons
Et flatté ce qui nous rebute;

Contristé, servile bourreau,


Le faible qu'à tort on méprise
Salué l'énorme Bêtise,
La Bêtise au front de taureau;
Baisé la stupide Matière
Avec grande dévotion,
Et de la putréfaction
Béni la blafarde lumière.

Enfin, nous avons, pour noyer


Le vertige dans le délire,
Nous, prêtre orgueilleux de la Lyre,
Dont la gloire est de déployer
L'ivresse des choses funèbres,
Bu sans soif et mangé sans faim!...
—Vite soufflons la lampe, afin
De nous cacher dans les ténèbres!

MADRIGAL TRISTE

Que m'importe que tu sois sage?


Sois belle! et sois triste! Les pleurs
Ajoutent un charme au visage.
Comme le fleuve au paysage;
L'orage rajeunit les fleurs.

Je t'aime surtout quand la joie


S'enfuit de ton front terrassé;
Quand ton cœur dans l'horreur se noie;
Quand sur ton présent se déploie
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!

ebooknice.com

You might also like