0% found this document useful (0 votes)
10 views61 pages

Machine Learning With Spark Nick Pentreath Download

The document discusses the book 'Machine Learning with Spark' by Nick Pentreath, which focuses on utilizing Apache Spark for large-scale machine learning applications. It covers various topics including setting up Spark, designing machine learning systems, and implementing models for recommendation, classification, regression, and clustering. The book is aimed at entry-level to intermediate data scientists and practitioners interested in applying machine learning techniques using Spark.

Uploaded by

bwfpkkmov281
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
0% found this document useful (0 votes)
10 views61 pages

Machine Learning With Spark Nick Pentreath Download

The document discusses the book 'Machine Learning with Spark' by Nick Pentreath, which focuses on utilizing Apache Spark for large-scale machine learning applications. It covers various topics including setting up Spark, designing machine learning systems, and implementing models for recommendation, classification, regression, and clustering. The book is aimed at entry-level to intermediate data scientists and practitioners interested in applying machine learning techniques using Spark.

Uploaded by

bwfpkkmov281
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/ 61

Machine Learning with Spark Nick Pentreath

download

https://textbookfull.com/product/machine-learning-with-spark-
nick-pentreath/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Mastering Apache Spark 2 x Scale your machine learning


and deep learning systems with SparkML DeepLearning4j
and H2O 2nd Edition Romeo Kienzler

https://textbookfull.com/product/mastering-apache-
spark-2-x-scale-your-machine-learning-and-deep-learning-systems-
with-sparkml-deeplearning4j-and-h2o-2nd-edition-romeo-kienzler/

Predictive Analytics with Microsoft Azure Machine


Learning Barga

https://textbookfull.com/product/predictive-analytics-with-
microsoft-azure-machine-learning-barga/

Machine Learning with TensorFlow 2nd Edition Chris A.


Mattmann

https://textbookfull.com/product/machine-learning-with-
tensorflow-2nd-edition-chris-a-mattmann/

Advanced Analytics with Spark Patterns for Learning


from Data at Scale 2nd Edition Sandy Ryza

https://textbookfull.com/product/advanced-analytics-with-spark-
patterns-for-learning-from-data-at-scale-2nd-edition-sandy-ryza/
Natural Language Processing with Spark NLP Learning to
Understand Text at Scale 1st Edition Alex Thomas

https://textbookfull.com/product/natural-language-processing-
with-spark-nlp-learning-to-understand-text-at-scale-1st-edition-
alex-thomas/

Advanced Data Analytics Using Python: With Machine


Learning, Deep Learning and NLP Examples Mukhopadhyay

https://textbookfull.com/product/advanced-data-analytics-using-
python-with-machine-learning-deep-learning-and-nlp-examples-
mukhopadhyay/

Applied Machine Learning for Health and Fitness: A


Practical Guide to Machine Learning with Deep Vision,
Sensors and IoT Kevin Ashley

https://textbookfull.com/product/applied-machine-learning-for-
health-and-fitness-a-practical-guide-to-machine-learning-with-
deep-vision-sensors-and-iot-kevin-ashley/

Stream Processing with Apache Spark Mastering


Structured Streaming and Spark Streaming 1st Edition
Gerard Maas

https://textbookfull.com/product/stream-processing-with-apache-
spark-mastering-structured-streaming-and-spark-streaming-1st-
edition-gerard-maas/

Hands On Machine Learning with Scikit Learn and


TensorFlow Aurélien Géron

https://textbookfull.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-aurelien-geron/
Preface
In recent years, the volume of data being collected, stored, and
analyzed has exploded, in particular in relation to activity on
the Web and mobile devices, as well as data from the physical
world collected via sensor networks. While large-scale data
storage, processing, analysis, and modeling were previously the
domain of the largest institutions, such as Google, Yahoo!,
Facebook, Twitter, and Salesforce, increasingly, many
organizations are being faced with the challenge of how to
handle a massive amount of data.

When faced with this quantity of data and the common


requirement to utilize it in real time, human-powered systems
quickly become infeasible. This has led to a rise in so-called big
data and machine learning systems that learn from this data to
make automated decisions.

In answer to the challenge of dealing with ever larger-scale data


without any prohibitive cost, new open source technologies
emerged at companies such as Google, Yahoo!, Amazon, and
Facebook, which aimed at making it easier to handle massive
data volumes by distributing data storage and computation
across a cluster of computers.
The most widespread of these is Apache Hadoop, which made
it significantly easier and cheaper to both store large amounts
of data (via the Hadoop Distributed File System, or HDFS) and
run computations on this data (via Hadoop MapReduce, a
framework to perform computation tasks in parallel across
many nodes in a computer cluster).

However, MapReduce has some important shortcomings,


including high overheads to launch each job and reliance on
storing intermediate data and results of the computation to
disk, both of which make Hadoop relatively ill-suited for use
cases of an iterative or low-latency nature. Apache Spark is a
new framework for distributed computing that is designed
from the ground up to be optimized for low-latency tasks and
to store intermediate data and results in memory, thus
addressing some of the major drawbacks of the Hadoop
framework. Spark provides a clean, functional, and easy-to-
understand API to write applications, and is fully compatible
with the Hadoop ecosystem.

Furthermore, Spark provides native APIs in Scala, Java,


Python, and R. The Scala and Python APIs allow all the benefits
of the Scala or Python language, respectively, to be used
directly in Spark applications, including using the relevant
interpreter for real-time, interactive exploration. Spark itself
now provides a toolkit (Spark MLlib in 1.6 and Spark ML in
2.0) of distributed machine learning and data mining models
that is under heavy development and already contains high-
quality, scalable, and efficient algorithms for many common
machine learning tasks, some of which we will delve into in this
book.

Applying machine learning techniques to massive datasets is


challenging, primarily because most well-known machine
learning algorithms are not designed for parallel architectures.
In many cases, designing such algorithms is not an easy task.
The nature of machine learning models is generally iterative,
hence the strong appeal of Spark for this use case. While there
are many competing frameworks for parallel computing, Spark
is one of the few that combines speed, scalability, in-memory
processing, and fault tolerance with ease of programming and a
flexible, expressive, and powerful API design.

Throughout this book, we will focus on real-world applications


of machine learning technology. While we may briefly delve
into some theoretical aspects of machine learning algorithms
and required maths for machine learning, the book will
generally take a practical, applied approach with a focus on
using examples and code to illustrate how to effectively use the
features of Spark and MLlib, as well as other well-known and
freely available packages for machine learning and data
analysis, to create a useful machine learning system.
What this book covers
Chapter 1, Getting Up and Running with Spark, shows how to
install and set up a local development environment for the
Spark framework, as well as how to create a Spark cluster in the
cloud using Amazon EC2. The Spark programming model and
API will be introduced and a simple Spark application will be
created using Scala, Java, and Python.

Chapter 2, Math for Machine Learning, provides a mathematical


introduction to machine learning. Understanding math and
many of its techniques is important to get a good hold on the
inner workings of the algorithms and to get the best results.

Chapter 3, Designing a Machine Learning System, presents an


example of a real-world use case for a machine learning system.
We will design a high-level architecture for an intelligent
system in Spark based on this illustrative use case.

Chapter 4, Obtaining, Processing, and Preparing Data with


Spark, details how to go about obtaining data for use in a
machine learning system, in particular from various freely and
publicly available sources. We will learn how to process, clean,
and transform the raw data into features that may be used in
machine learning models, using available tools, libraries, and
Spark's functionality.

Chapter 5, Building a Recommendation Engine with Spark,


deals with creating a recommendation model based on the
collaborative filtering approach. This model will be used to
recommend items to a given user, as well as create lists of items
that are similar to a given item. Standard metrics to evaluate
the performance of a recommendation model will be covered
here.

Chapter 6, Building a Classification Model with Spark, details


how to create a model for binary classification, as well as how
to utilize standard performance-evaluation metrics for
classification tasks.

Chapter 7, Building a Regression Model with Spark, shows how


to create a model for regression, extending the classification
model created in Chapter 6, Building a Classification Model
with Spark. Evaluation metrics for the performance of
regression models will be detailed here.

Chapter 8, Building a Clustering Model with Spark, explores


how to create a clustering model and how to use related
evaluation methodologies. You will learn how to analyze and
visualize the clusters that are generated.
Chapter 9, Dimensionality Reduction with Spark, takes us
through methods to extract the underlying structure from, and
reduce the dimensionality of, our data. You will learn some
common dimensionality-reduction techniques and how to
apply and analyze them. You will also see how to use the
resulting data representation as an input to another machine
learning model.

Chapter 10, Advanced Text Processing with Spark, introduces


approaches to deal with large-scale text data, including
techniques for feature extraction from text and dealing with the
very high-dimensional features typical in text data.

Chapter 11, Real-Time Machine Learning with Spark


Streaming, provides an overview of Spark Streaming and how
it fits in with the online and incremental learning approaches
to apply machine learning on data streams.

Chapter 12, Pipeline APIs for Spark ML, provides a uniform set
of APIs that are built on top of Data Frames and help the user
to create and tune machine learning pipelines.
What you need for this
book
Throughout this book, we assume that you have some basic
experience with programming in Scala or Python and have
some basic knowledge of machine learning, statistics, and data
analysis.
Who this book is for
This book is aimed at entry-level to intermediate data
scientists, data analysts, software engineers, and practitioners
involved in machine learning or data mining with an interest in
large-scale machine learning approaches, but who are not
necessarily familiar with Spark. You may have some experience
of statistics or machine learning software (perhaps including
MATLAB, scikit-learn, Mahout, R, Weka, and so on) or
distributed systems (including some exposure to Hadoop).
Conventions
In this book, you will find a number of text styles that
distinguish between different kinds of information. Here are
some examples of these styles and an explanation of their
meaning.

Code words in text, database table names, folder names,


filenames, file extensions, pathnames, dummy URLs, user
input, and Twitter handles are shown as follows: "Spark places
user scripts to run Spark in the bin directory."

A block of code is set as follows:

val conf = new SparkConf()


.setAppName("Test Spark App")
.setMaster("local[4]")
val sc = new SparkContext(conf)

Any command-line input or output is written as follows:

>tar xfvz spark-2.1.0-bin-hadoop2.7.tgz


>cd spark-2.1.0-bin-hadoop2.7
New terms and important words are shown in bold. Words
that you see on the screen, for example, in menus or dialog
boxes, appear in the text like this: "These can be obtained from
the AWS homepage by clicking Account | Security Credentials |
Access Credentials."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.


Reader feedback
Feedback from our readers is always welcome. Let us know
what you think about this book-what you liked or disliked.
Reader feedback is important for us as it helps us develop titles
that you will really get the most out of. To send us general
feedback, simply
e-mail [email protected], and mention the book's title in the
subject of your message. If there is a topic that you have
expertise in and you are interested in either writing or
contributing to a book, see our author guide at www.packtpub.com/a
uthors.
Customer support
Now that you are the proud owner of a Packt book, we have a
number of things to help you to get the most from your
purchase.
Downloading the example
code
You can download the example code files for this book from
your account at http://www.packtpub.com. If you purchased this
book elsewhere, you can visit http://www.packtpub.com/support and
register to have the files e-mailed directly to you.

You can download the code files by following these steps:

1. Log in or register to our website using your e-mail address


and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the
code files.
6. Choose from the drop-down menu where you purchased this
book from.
7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:

WinRAR / 7-Zip for Windows


Zipeg / iZip / UnRarX for Mac

7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at http
s://github.com/PacktPublishing/Machine-Learning-with-Spark-Second-Edit

ion. We also have other code bundles from our rich catalog of
books and videos available at https://github.com/PacktPublishing/.
Check them out!
Downloading the color
images of this book
We also provide you with a PDF file that has color images of
the screenshots/diagrams used in this book. The color images
will help you better understand the changes in the output. You
can download this file from https://www.packtpub.com/sites/default/
files/downloads/MachineLearningwithSparkSecondEdition_ColorImages.pdf.
Errata
Although we have taken every care to ensure the accuracy of
our content, mistakes do happen. If you find a mistake in one
of our books-maybe a mistake in the text or the code-we would
be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve
subsequent versions of this book. If you find any errata, please
report them by visiting http://www.packtpub.com/submit-errata,
selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata
are verified, your submission will be accepted and the errata
will be uploaded to our website or added to any list of existing
errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpu


b.com/books/content/support and enter the name of the book in the
search field. The required information will appear under the
Errata section.
Piracy
Piracy of copyrighted material on the Internet is an ongoing
problem across all media. At Packt, we take the protection of
our copyright and licenses very seriously. If you come across
any illegal copies of our works in any form on the Internet,
please provide us with the location address or website name
immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the


suspected pirated material.

We appreciate your help in protecting our authors and our


ability to bring you valuable content.
Questions
If you have a problem with any aspect of this book, you can
contact us at [email protected], and we will do our best to
address the problem.
Getting Up and Running
with Spark
Apache Spark is a framework for distributed computing; this
framework aims to make it simpler to write programs that run
in parallel across many nodes in a cluster of computers or
virtual machines. It tries to abstract the tasks of resource
scheduling, job submission, execution, tracking, and
communication between nodes as well as the low-level
operations that are inherent in parallel data processing. It also
provides a higher level API to work with distributed data. In
this way, it is similar to other distributed processing
frameworks such as Apache Hadoop; however, the underlying
architecture is somewhat different.

Spark began as a research project at the AMP lab in University


of California, Berkeley (https://amplab.cs.berkeley.edu/projects/spa
rk-lightning-fast-cluster-computing/). The university was focused
on the use case of distributed machine learning algorithms.
Hence, it is designed from the ground up for high performance
in applications of an iterative nature, where the same data is
accessed multiple times. This performance is achieved
primarily through caching datasets in memory combined with
low latency and overhead to launch parallel computation tasks.
Together with other features such as fault tolerance, flexible
distributed-memory data structures, and a powerful functional
API, Spark has proved to be broadly useful for a wide range of
large-scale data processing tasks, over and above machine
learning and iterative analytics.

For more information, you can visit:

http://spark.apache.org/community.html

http://spark.apache.org/community.html#history

Performance wise, Spark is much faster than Hadoop for


related workloads. Refer to the following graph:

Source: https://amplab.cs.berkeley.edu/wp-content/uploads/2011/11/spark-lr.png

Spark runs in four modes:

The standalone local mode, where all Spark processes are run
within the same Java Virtual Machine (JVM) process

The standalone cluster mode, using Spark's own built-in, job-


scheduling framework
Using Mesos, a popular open source cluster-computing
framework

Using YARN (commonly referred to as NextGen


MapReduce), Hadoop

In this chapter, we will do the following:

Download the Spark binaries and set up a development


environment that runs in Spark's standalone local mode. This
environment will be used throughout the book to run the
example code.

Explore Spark's programming model and API using Spark's


interactive console.

Write our first Spark program in Scala, Java, R, and Python.

Set up a Spark cluster using Amazon's Elastic Cloud


Compute (EC2) platform, which can be used for large-sized
data and heavier computational requirements, rather than
running in the local mode.

Set up a Spark Cluster using Amazon Elastic Map Reduce

If you have previous experience in setting up Spark and are


familiar with the basics of writing a Spark program, feel free to
skip this chapter.
Installing and setting up
Spark locally
Spark can be run using the built-in standalone cluster
scheduler in the local mode. This means that all the Spark
processes are run within the same JVM-effectively, a single,
multithreaded instance of Spark. The local mode is very
used for prototyping, development, debugging, and testing.
However, this mode can also be useful in real-world scenarios
to perform parallel computation across multiple cores on a
single computer.

As Spark's local mode is fully compatible with the cluster


mode; programs written and tested locally can be run on a
cluster with just a few additional steps.

The first step in setting up Spark locally is to download the


latest version http://spark.apache.org/downloads.html, which
contains links to download various versions of Spark as well as
to obtain the latest source code via GitHub.

The documents/docs available at http://spark.apache.or


g/docs/latest/ are a comprehensive resource to learn
more about Spark. We highly recommend that you
explore it!
Spark needs to be built against a specific version of Hadoop in
order to access Hadoop Distributed File System (HDFS)
as well as standard and custom Hadoop input sources
Cloudera's Hadoop Distribution, MapR's Hadoop distribution,
and Hadoop 2 (YARN). Unless you wish to build Spark against
a specific Hadoop version, we recommend that you download
the prebuilt Hadoop 2.7 package from an Apache mirror from h
ttp://d3kbcqa49mib13.cloudfront.net/spark-2.0.2-bin-hadoop2.7.tgz.

Spark requires the Scala programming language (version 2.10.x


or 2.11.x at the time of writing this book) in order to run.
Fortunately, the prebuilt binary package comes with the Scala
runtime packages included, so you don't need to install Scala
separately in order to get started. However, you will need to
have a Java Runtime Environment (JRE) or Java
Development Kit (JDK).

Refer to the software and hardware list in this book's


code bundle for installation instructions. R 3.1+ is
needed.

Once you have downloaded the Spark binary package, unpack


the contents of the package and change it to the newly created
directory by running the following commands:

$ tar xfvz spark-2.0.0-bin-hadoop2.7.tgz


$ cd spark-2.0.0-bin-hadoop2.7
Spark places user scripts to run Spark in the bin directory. You
can test whether everything is working correctly by running
one of the example programs included in Spark. Run the
following command:

$ bin/run-example SparkPi 100

This will run the example in Spark's local standalone mode. In


this mode, all the Spark processes are run within the same
JVM, and Spark uses multiple threads for parallel processing.
By default, the preceding example uses a number of threads
equal to the number of cores available on your system. Once
the program is executed, you should see something similar to
the following lines toward the end of the output:

...
16/11/24 14:41:58 INFO Executor: Finished task 99.0 in stage 0.0
(TID 99). 872 bytes result sent to driver
16/11/24 14:41:58 INFO TaskSetManager: Finished task 99.0 in stage
0.0 (TID 99) in 59 ms on localhost (100/100)
16/11/24 14:41:58 INFO DAGScheduler: ResultStage 0 (reduce at
SparkPi.scala:38) finished in 1.988 s
16/11/24 14:41:58 INFO TaskSchedulerImpl: Removed TaskSet 0.0,
whose tasks have all completed, from pool
16/11/24 14:41:58 INFO DAGScheduler: Job 0 finished: reduce at
SparkPi.scala:38, took 2.235920 s
Pi is roughly 3.1409527140952713
The preceding command calls class
org.apache.spark.examples.SparkPi class.

This class takes parameter in the local[N] form, where N is the


number of threads to use. For example, to use only two threads,
run the following command instead:N is the number of threads
to use. Giving local[*] will use all of the cores on the local
machine--that is a common usage.

To use only two threads, run the following command instead:

$ ./bin/spark-submit --class org.apache.spark.examples.SparkPi


--master local[2] ./examples/jars/spark-examples_2.11-2.0.0.jar
Spark clusters
A Spark cluster is made up of two types of processes: a driver
program and multiple executors. In the local mode, all these
processes are run within the same JVM. In a cluster, these
processes are usually run on separate nodes.

For example, a typical cluster that runs in Spark's standalone


mode (that is, using Spark's built-in cluster management
modules) will have the following:

A master node that runs the Spark standalone master process


as well as the driver program

A number of worker nodes, each running an executor process

While we will be using Spark's local standalone mode


throughout this book to illustrate concepts and examples, the
same Spark code that we write can be run on a Spark cluster. In
the preceding example, if we run the code on a Spark
standalone cluster, we could simply pass in the URL for the
master node, as follows:

$ MASTER=spark://IP:PORT --class org.apache.spark.examples.SparkP


./examples/jars/spark-examples_2.11-2.0.0.jar 100
Other documents randomly have
different content
Ya los celos se acabaron
De Doña Ana y de Don Juan,
Pues todo lo han escuchado,
Y mi amor, pues Doña Clara
Viene á Hipólito buscando!
¡Cielos! sin querer, he visto
Mis celos averiguados.
ArceoY. si el galan y la dama
Están ya desengañados,
Aquí acaba la comedia.
D. Ped
¿Oiste
. ya el desengaño,
Don Juan?
(Llegándose á la puerta del cuarto donde estuvo.)

ESCENA XVI.
DOÑA ANA, DOÑA LUCÍA. — DON PEDRO, ARCEO.

D.ª Ana. No soy tan dichosa


Yo.
D. Ped
¿Cómo
. así?
D.ª Ana. Como cuando
Yo entré, sólo ví un hombre,
Que atrevido y temerario
Se echaba por la ventana,
Que hay, señor, á esos tejados.
ArceoPues
. no acaba la comedia.
D. Ped
¡Qué
. rigoroso, qué extraño
Afecto de amor y celos!
(Ap. Él iba á salir al paso:
Seguir á los dos importa,
No suceda algun fracaso.)
(Vase.)
D.ª AGrande
na. desdicha es la mia,
Pues cuando vengo buscando
Hoy, Don Juan, finezas tuyas,
Solas mis desdichas hallo.
Cuando te siguen sospechas,
Tú las estás esperando
Firme, ¡y vuelves las espaldas
Si te siguen desengaños!
¿Qué mujer es esta ¡cielos!
Que hoy en mi casa se ha entrado?
¿Qué hombre es este que asegura
Que yo le vengo buscando?
¡Oh nunca en el tiempo hubiera,
Oh nunca hubiera en el año,
Si es que la culpa han tenido
De enredos y enojos tantos,
Las mañanas floridas
De Abril y Mayo!
JORNADA TERCERA.

Sala en casa de Doña Ana.

ESCENA PRIMERA.
DON JUAN, á oscuras.

Nada me sucede bien.


¿Qué roca habrá que contraste
Tanta avenida de penas,
Tantos golpes de pesares?
Del aposento en que estaba
Por testigo de mis males,
Imposible de sufrirlos,
E imposible de vengarme,
Celoso y desesperado
Salir pretendo á la calle
A esperar aquel galan
Tan feliz, que coronarse
Pudo de tantos favores,
De dichas que son tan grandes.
Echéme por la ventana
(Porque allí no me estorbasen
La venganza de mis celos),
Presumiendo que era fácil,
Ganando desde el tejado
De la puerta los umbrales;
Y saltando dél á un patio,
Donde la ventana sale,
Perdí el tino, y dí á otra casa.
Pero parece que abren
Una puerta, y entra gente...
Y con las luces que traen
Percibo mejor las señas.
¿Hay suceso semejante?
¡Vive Dios, que esta es la casa
De Doña Ana! ¡Si tomase
Hoy puerto en el mismo golfo
Esta derrotada nave!
Ella es. ¿Qué he de hacer, cielos?
Que no es bien que aquí me halle,
Y presuma que he venido
Cobardemente á quejarme
De mis celos, sin vengarlos.
¿Hay confusion más notable?
¿Qué haré? Que no me está bien
Ya ni el irme ni el quedarme.
(Escóndese.)

ESCENA II.
DOÑA ANA y DOÑA LUCÍA, con luz. — DON JUAN, escondido.

D.ª AQuítame
na. este manto. ¡Gracias
A mi fortuna inconstante
Que me ha dado (¡ay infelice!)
Un solo punto, un instante
De tiempo para llorar,
De lugar para quejarme!
Y así, ya que estoy á solas,
Sean tormentas, sean mares
Mis lágrimas y mis quejas
Entre la tierra y el aire.
D.ª LSeñora,
uc. si dese modo
Tan justos extremos haces,
Triunfará de amor la muerte.
Consuelo tus penas hallen;
Que para todo hay consuelo.
Que si Don Juan (por guardarle
A Don Pedro aquel decoro
Que debió á sus amistades)
Se arrojó por la ventana,
Ya en su seguimiento parten
Don Pedro, Arceo y Pernía,
Porque los dos no se maten.
D.ª AYnacuando
. remedie (¡ay triste!)
Mi temor, ¿para adelante
Puede ya dejar de ser
Lo que fué? ¿Pueden borrarse
De la memoria los celos
En que yo no tuve parte?
D. Juan
(Ap.. al paño.) De cuanto yo desde aquí
Puedo á las dos escucharles,
Nada entiendo; y sólo entiendo
Que temo que me declaren
Mis congojas, mis desdichas,
Mis recelos, mis pesares;
Porque no es posible, no,
Que un celoso sufra y calle.
D.ª LAcuéstate,
uc. por tu vida,
Porque en la cama descanses.
D.ª ANo
na.hay descanso para mí.
Fuera de que he de esperarle
A Don Pedro; que le dije
Que con lo que le pasase
En alcance de Don Juan
(Pues todos van á buscarle),
Viniese á avisarme; y ya
Parece que llaman. Abre.

ESCENA III.
DON PEDRO, ARCEO, PERNÍA. — Dichos.

D.ª ASeñor
na. Don Pedro, ¿qué hay?
D. Ped
Que
. todo ha salido en balde.
D.ª A¿Cómo?
na.
D. Ped. No habemos hallado
A Don Juan, y es bien notable
Suceso, porque de aquella
Ventana, que al patio cae,
Para salir al portal
Hay una puerta, y la llave
Está echada, de manera
Que ha sido imposible hallarle,
Cuando ni en mi casa está,
Ni salir pudo á la calle.
ArceoNo
. le hemos buscado bien,
Si va á decir las verdades;
Porque á un celoso, señora,
Le ha de buscar el que hallarle
Quisiere, ahogado por los pozos,
O ahorcado por los desvanes.
Pernía
Ya
. le he dicho que se meta
En juntar sus consonantes.
No hable palabra donde
Yo estoy.
Arceo. Quínola pasante,
Tambien yo le tengo dicho
Que de dar lanzadas trate,
Y sacar, no para el toro,
Para el lacayo el alfanje,
Y no más.
D.ª Luc. Entre dos ruines
Sea mi mano el montante.
D. Ped
No. es posible hallarle, en fin.
D.ª ASon
na. mis penas, no os espante,
Y bien dicen que son mias.
Pues ellas disponer saben
Tantas falsas apariencias,
Que me culpen y le agravien.
¡Plegue á Dios, señor Don Pedro,
Que él me destruya y me falte,
Si á aquel hombre ví en mi vida,
Sino hoy, que pudo entrarse
Aquí tras una mujer,
A quien siguió desde el Parque,
Y vióme á mí! ¿Mas por qué
Lo digo ¡ay Dios! si escucharme
No puede Don Juan, y doy
Satisfacciones al aire?
D. Ped
Quedad,
. señora, con Dios;
Que por si vuelve á buscarme
A mi casa, vuelvo á ella.
¿Qué mandais?
D.ª Ana. No es bien que os mande,
Que os ruegue sí, que volvais
A la mañana á contarme
Lo que hubiere sucedido.
D. Ped
Quedad
. con Dios.
(Vase.)
D.ª Ana. Él os guarde.—
Lucía, cierra esas puertas,
Y entra despues á acostarme;
Que he de madrugar mañana,
Porque he de salir al Parque
A hacer una diligencia.—
¡Oh si á este vivo cadáver
Hoy ese lecho de pluma
Sepulcro fuera de jaspe!
(Vase.)

ESCENA IV.
DON JUAN, al paño; ARCEO, DOÑA LUCÍA.

D. Juan . ¿Al Parque mañana? ¡Ay cielos!


(Ap.)
No estos desengaños basten:
Vuelvan atras mis desdichas,
Pues pasa el riesgo adelante.
ArceoDe
. todos estos enredos,
De todos estos debates,
Vos teneis, Doña Lucía,
La culpa, pues vos contasteis
A vuestra ama que en mi casa
Estaba Don Juan.
D.ª Luc. De tales
Sucesos, quien me lo dijo
A mí, tiene mayor parte;
Que ya sabe quien me cuenta
A mí el suceso que sabe,
Que es decirme que lo diga
El decirme que lo calle.
ArceoEres
. tan dueña, que puedes
Servir desde aquí adelante
De molde de vaciar dueñas.
D.ª LTú
uc.escudero vergonzante.
ArceoEres
. dueña.
D.ª Luc. Tú eres loco.
ArceoEres
. dueña.
D.ª Luc. Tú un bergante.
ArceoEres
. dueña.
D.ª Luc. Tú un bufon.
ArceoEres
. dueña.
D.ª Luc. Tú un infame.
ArceoEres
. dueña.
D.ª Luc. Tú un bribon.
ArceoItem
. más, dueña; y no trates
De desquitarte, porque
No has de poder desquitarte.
D.ª L¿Cómo
uc. no? Eres un...
Arceo. Dí, dí.
D.ª LMal
uc. poeta.
Arceo. ¡Tate, tate!
¿Poeta, dijiste? Adios, dueña;
Que ya quedamos iguales.
D.ª L¿Desa
uc. manera te vas?
ArceoPues
. ¿qué quieres?
D.ª Luc. Que te aguardes
Aquí, miéntras que mi ama
Acaba de desnudarse,
Y volveré á hablar contigo
Un rato.
Arceo. Aquí espero.
(Vase Doña Lucía, llevándose la luz.)

ESCENA V.
DON JUAN, al paño; ARCEO.

Arceo. Madres
Las que á los hijos parísteis
Para nocturnos amantes
De viejas, mirad en mí
Las desdichas á que nacen.
Esperando una estantigua
Estoy, confuso y cobarde,
Aquí donde mis suspiros
Pueblan estas soledades.
(Sale Don Juan del cuarto en que estaba.)
D. Juan . Ahora, desconfianzas,
(Ap.)
Es tiempo de aconsejarme,
Si esto que pasa por mí
Son mentiras ó verdades.
El recatarme me importa
De Doña Ana: ella no sabe
Que la escucho, y en suspiros
Que mal pronunciados salen
Desde el corazon al labio,
Me ha dado ciertas señales
De que mi desdicha llora,
De que siente mis pesares.
Estos criados no pueden
Engañarse ni engañarme,
Puesto que Arceo á Lucía
La contó cómo ocultarme
Pude en casa de Don Pedro,
Y ella á Doña Ana: bastante
Desengaño de que fué
Entónces ella á buscarme.
Mas ¡ay de mí! si es aquesto
Como dicen señas tales,
¿Don Hipólito á qué efecto
Dijo que á él iba á buscarle?
¿O qué mujer es aquesta?
Y en fin, ¿para qué ir al Parque
Mañana quiere Doña Ana,
Para que á mí no me falte
Cuidado? ¡Pues vive Dios,
Que tengo de averiguarle!
Si aquí estoy, es imposible
Que disimule y que calle;
E imposible, si me ven,
De que la ida del Parque
Averigüe: luego irme
Será lo más importante.
Este criado á Lucía
Espera: miéntras no sale,
Pues no ha cerrado la puerta,
Salir pretendo á la calle,
Por seguirla donde fuere.
Que me prendan ó me maten,
Todo, todo importa ménos
Que no que me desengañe.
ArceoYa
. siento pasos.—Lucía,
Seas bien venida, dame
Los brazos.
(Abraza á Don Juan.)
¡Barbada vienes!
¿Quién es?
D. Juan. Callad, que no es nadie.
Arceo¿Cómo
. no es nadie? Yo soy
Tan cortés y tan galante,
Que ántes crêré que sois muchos.
¡Ay, ay!
D. Juan. ¡Vive Dios, que os mate,
Si no callais!

ESCENA VI.
DOÑA ANA, DOÑA LUCÍA. — DON JUAN, ARCEO.

D.ª A(Dentro.)
na. ¿Que rüido
Es aquél?
(Sale Doña Lucía á oscuras y encuentra con Don Juan.)
D.ª L(Bajo
uc. á Don Juan.)

¡Eres notable!
¿Es posible que tu miedo
Tan grandes extremos hace,
Que des voces? Salte presto,
Para que aquí no te hallen.
Vénte tras mí.
D. Juan
(Bajo
. á ella. Vamos.) (Ap. ¡Cielos!
Hasta que me desengañe
He de callar; que esta es
Propia condicion de amantes.)
(Vanse Doña Lucía y Don Juan, que al entrarse, encuentra con Arceo.)
Arceo¿Otro
. diablo? ¡Vive Dios,
Que tienen aquestos lances
Cosas de la Dama Duende!

ESCENA VII.
DOÑA ANA, medio desnuda, con luz. — ARCEO; despues, DOÑA
LUCÍA.

D.ª A¡Hola!
na. ¿No responde nadie?
Mas ¡ay de mí!
Arceo(Ap.)
. Yo me embozo,
Por ver si puedo excusarme
De que me conozcan.
(Sale Doña Lucía.)
D.ª L(Ap.)
uc. Ya
No hay peligro que me espante,
Pues ya en la calle está Arceo.
¿Mas no es el que está delante?
¿Quién era, si él está aquí,
El que yo puse en la calle?
Arceo(Ap.)
. ¡Aquí muero!
D.ª Ana. Caballero,
Que, recatado el semblante,
La noble clausura rompes
Destos sagrados umbrales,
Si necesidad acaso
Te ha obligado á extremos tales,
De mis joyas y vestidos
Francas te daré las llaves:
Ceba tu hidrópica sed
En sus telas y diamantes.
Pero si, más codicioso
De honor que de hacienda, haces
Estos extremos, te ruego
(Estoy muerta) que no trates
Con tal desprecio (¡ay de mí!)
El honor (estoy cobarde)
De una mujer infelice,
Sujeta á desdichas tales.
Porque si para mi afrenta
A aqueste cuarto llegaste,
Vive Dios, que ántes que intentes
Hablarme palabra, y ántes
Que ofenda al dueño que adoro,
Yo con mis manos me mate;
Porque si lágrimas solas
No enternecen un diamante,
Rompiéndome el pecho yo,
Le sabré labrar con sangre.
ArceoNo
. labraréis, si yo puedo;
Que fuera mucho desaire
Ser pelícana una dama,
Y ser labradora un ángel.
Grandes casos de fortuna
A vuestra casa me traen.
No á hacer mella en vuestras joyas,
Ni á vuestra opinion ultraje.
Y porque os asegureis
De mi término galante,
Segura quedais de mí.
A Dios, señora, que os guarde.
(Vase.)
D.ª L¡Qué
uc. miro!
D.ª Ana. ¿Fuése ya?
D.ª Luc. Sí.
D.ª AEcha
na. á esa puerta la llave;
Y pues ya la blanca aurora
Venciendo las sombras sale,
No me quiero desnudar.
¡Ay, Don Juan, si esto mirases!...
¿Quién de que no es culpa mia
Pudiera desengañarte?
(Vanse.)

El Parque.

ESCENA VIII.
DOÑA CLARA é INÉS, en el traje corto, como primero.

Inés. ¿Al Parque vuelves?


D.ª Clar. Rendida,
Sin ley, razon ni sentido,
Donde la vida he perdido,
Vuelvo, Inés, á hallar la vida.
Inés. Bastante está lo sentido,
Y si yo no me he engañado,
Toda la gloria ha parado
En que has, señora, advertido
De ayer el raro suceso.
D.ª C¿De
lar. que sirviera negar
Con la lengua mi pesar,
Si con llanto lo confieso?
Vana de que hallarse habia
Don Hipólito burlado,
Le llamé; y su desenfado
Burló de la industria mia.
Que aunque es verdad que me dió
Satisfacciones que allí
Por mi respeto creí,
Inés, por mi gusto no;
Pues no me pudo negar
Que fué donde otra mujer
Le llamaba, y mi placer
Se convirtió en mi pesar.
Yo misma (¡ay de mí!) encendí
El fuego en que triste peno,
Yo conficioné el veneno
Que yo misma me bebí,
Yo misma desperté, yo,
La fiera que me ha deshecho,
Yo crié dentro del pecho
El áspid que me mordió.
Arda, gima, pene y muera
Quien sopló, conficionó,
Alimentó, despertó,
Veneno, ardor, áspid, fiera.
Inés. Bien en tantos pareceres
Hoy dirán cuantos te ven,
Que sólo queremos bien,
Tratadas mal, las mujeres.
¿Para qué habemos venido
Al Parque con tal cruel
Pena?
D.ª Clar A. ver si viene á él
Don Hipólito.
Inés. Él ha sido,
Por cierto, muy lindo ensayo.
D.ª CSilarhoy
. doy tregua á mis temores,
Yo os coronaré de flores,
Mañanas de Abril y Mayo.
(Vanse.)

ESCENA IX.
DON HIPÓLITO, DON LUIS.

D. Hipól
En efecto,
. hasta su casa
A Doña Clara seguí
Como visteis, y la dí
Del engaño que me pasa
Satisfacciones, diciendo
¿Qué ofensa era ir á ver,
Llamado de una mujer,
Lo que mandaba? Y haciendo
Extremos de enamorado,
Que supe fingir muy bien
(Porque ya no hay, Don Luis, quien
No haga el papel estudiado),
La dejé desenojada,
Atenta á mi desengaño;
Y al fin, con su mismo daño
Vino ella á ser la engañada,
Pues mis extremos creyó;
Siendo así, Don Luis, verdad
Que alma, vida y voluntad
La Doña Ana me robó;
Porque una vez persuadido
De que me llamaba á mí
Y hallarla despues allí,
Me empeñó en haber creido
Que ella fué quien me llamó.
D. Luis
Vos
. teneis lindo despejo.
D. Hipól
¿Fuera
. más cuerdo consejo
Darme por vencido?
D. Luis. No.
Mas á haberme sucedido
A mí lo que á vos con ellas,
Jamás volviera yo á vellas
De turbado y de corrido.
D. Hipól
Fuera
. linda necedad.
Puntualidades teneis
Tan necias, que pareceis
Caballero de ciudad.
Mira, si aquesta fortuna
A corrella te acomodas,
Querer por tu gusto á todas,
Por tu pesar á ninguna.

ESCENA X.
DOÑA ANA y DOÑA LUCÍA, vestidas como Doña Clara. — DON
HIPÓLITO, DON LUIS.

D.ª LYa
uc.estás en el Parque, ya (Ap. las dos.)
Decirme, señora, puedes
Con qué intento deste modo
A su hermoso sitio vienes.
D.ª ASinahas
. de verlo, ¿para qué
Ahora que lo diga quieres?
Que es retórica excusada
Decir las cosas dos veces,
Y más cuando están tan cerca
De suceder, que presente
Está el que vengo buscando.
D.ª L(Ap.
uc. á ella.) El hombre, señora, es este

De los engaños de ayer,


Si mis ojos no me mienten.
D.ª APor
na. él lo digo; pues solo
He salido á hablarle y verle,
Donde por la obligacion
Que á ser caballero tiene,
Desengañe mi opinion;
Pues los que son más corteses
Caballeros, siempre amparan
El honor de las mujeres.
D.ª L¿Para
uc. aquesto de tu casa
Al Parque, señora, vienes,
Donde es una culpa más
Si aquí acertaran á verte?
D.ª ADon
na. Juan está retraido
Donde quiera que estuviere,
Y solo, á este sitio, donde
Hay tal concurso de gente,
No se atreverá á venir.
Y así más seguramente
Es donde le puedo hablar.
D.ª L¡Plegue
uc. á Dios que no lo yerres!
D.ª ATápate,
na. y llega á llamarle.
Dí que una mujer pretende
Hablarle: que se retire
Del amigo con quien viene.
D.ª L(AucDon
. Hipólito.) Caballero, una tapada
A solas hablaros quiere,
Que es la que mirais. Seguidnos.
D. Hipól
(Ap.. Doña Clara es, claramente
Lo dice el traje. Otra vez
Al engaño de ayer vuelve;
Mas hoy no lo ha de lograr.)
(Llégase, y habla á Doña Ana.)
Notable, vive Dios, eres,
Pues que tan mal te aseguras
De quien te estima y no ofende.
Si buscas satisfacciones
Mayores de las que tienes,
No es menester que me sigas,
Pues en el alma estás siempre.
D.ª APor
na. otra me habeis tenido:
En vuestras voces se infiere,
Y quiero desengañaros
Desde luego. ¿Conoceisme?
(Descúbrese.)
D. Hipól
Otra. vez me preguntasteis
En otra ocasion más fuerte
Eso mismo, y respondí
Que sí y que no; y me parece,
Pues siempre es una la duda,
Dar una respuesta siempre.
Sí os conozco, pues que os miro;
No os conozco, porque suelen
Los bienes pasarse á males,
Y hoy al revés me sucede.
D.ª ASeguidme
na. hácia la Florida,
Porque hablaros me conviene
Donde estéis solo; y decidle
A ese amigo que se quede.
(Vanse las dos.)
D. Hipól
Don. Luis, de nueva aventura
Podeis darme parabienes.
Doña Ana es esta tapada.
Ahora no puedo hacerme
Engaño, que yo la he visto
Con mis ojos claramente.
¿Veis cómo fué la de ayer
Esta misma? ¿Veis si vuelve
A buscarme? Aquí os quedad,
Y murmurad, si os parece,
El haber dicho que tengo
Buena estrella con mujeres.

ESCENA XI.
DOÑA CLARA é INÉS, tapadas. — DON HIPÓLITO, DON LUIS.

Inés. (Ap. á D.ª Clara.) Don Hipólito está aquí.


D.ª CPues
lar. no andemos más, detente.

(Quédanse paradas Doña Clara é Inés; Don Hipólito, engañado por el traje, cree
que son Doña Ana y Lucía, que esperan á que las siga, y se acerca y las habla.)
D. Hipól
Ya os
. sigo. Guiad, señora
Doña Ana, donde quisiereis;
Que yendo con vos, hermosa
Deidad de estos campos verdes,
Cualquiera sitio será
La Florida; que le deben
A vuestros ojos de fuego
Y á vuestra planta de nieve
Púrpura y verde las flores,
Cristal y aljófar las fuentes.
D.ª C(lar
Ap. .Doña Ana dijo: ¡ay de mí!
Mas ¿qué nuevo engaño es este?
Mas no tarde en discurrillo
Quien averiguarlo puede.
La Florida es el lugar
Citado, y á él me conviene
Llevarle.) Venid.
D. Hipól
(Ap.). Fortuna,
¡Oh cuánto mi amor le debe,
Pues seguro de los celos
De Doña Clara, me ofreces
A Doña Ana! Triunfo hermoso
De tu gran deidad es este.
(Vanse todos, y queda solo Don Luis.)

ESCENA XII.
DON JUAN. — DON LUIS.

D. Juan
Hácia
. esta parte bajó
Doña Ana; que entre la gente
Que venía, la perdí
De vista. Pero no puede
Esconderse. Y es verdad;
Pues cuando á mí me mintiesen
Tantas señas, me dijera
Verdad mi infelice suerte.
Con Don Hipólito va
Hablando. Ya no hay que espere.
Muera de cólera y rabia
Quien de amor y celos muere.
D. Luis
(Ap.
. ¡Válgame el cielo! ¡qué miro!
Don Juan de Guzman ¿no es este?)
¡Señor Don Juan de Guzman!
D. Juan
¿Quién
. llama? (Ap. ¿Quién vió más fuerte
Confusion? Este es Don Luis.)
D. Luis
Donde
. quiera que yo viere
A quien agravia mi sangre
Y á quien mi opinion ofende,
Primero que con la lengua,
Sin ceremonias corteses
Le saludo con la espada,
Voz de honor más elocuente.
Sacad la vuestra; porque
Con más opinion me vengue.
D. Juan
Yo. no he rehusado en mi vida
Con la mia responderle
A quien me habla con la suya.
Y si matarme os conviene,
Daos priesa; que si os tardais,
Os podrá quitar la suerte
Otra herida, y no es capaz
Una vida de dos muertes.
D. Luis
No. os respondo, porque ya
Hablar el acero debe.
(Riñen.)
D. Juan . Con Doña Ana entró en la huerta
(Ap.)
Don Hipólito. ¡Oh aleve
Pena! ¿Quién crêrá que allí
Me agravien, y aquí se venguen?
D. Luis
Desguarnecióse
. la espada.
D. Juan
Daros
. pudiera la muerte;
Pero porque echeis de ver
Cómo mi valor procede,
Y como debí de darla
A vuestro primo igualmente
(Pues el que fuera una vez
Traidor, lo fuera dos veces;
Porque ser uno cobarde
No es defecto que se pierde),
Id por espada, que aquí
Os espero.
D. Luis
(Ap.
. ¡Trance fuerte,
Pues quien me agravia me obliga,
Pues me halaga quien me ofende!
Mas ya sé qué debo hacer.)
Esperad, que brevemente
Volveré.
D. Juan. Ya veis el riesgo
A que estoy, si aquí me viesen.
Y por quitarme del paso,
Puesto que veis que lo es este,
Dentro estoy de la Florida.
D. Luis
Antes
. de un instante breve
A ella volveré á buscaros.
(Vase.)
ESCENA XIII.
DON JUAN.

¿Qué haré en penas tan crueles,


Que un inconveniente es
Sombra de otro inconveniente?
Cuando sigo un daño, otro
En mi seguimiento viene;
Uno busco y otro hallo,
Y en todos no sé qué hacerme;
Que soy en un caso mismo
Persona que hace y padece.
Si á Don Hipólito sigo,
Falto á Don Luis neciamente;
Y si espero á Don Luis, falto
A mis celos. ¿Mas qué teme
Mi valor? ¿No es morir todo?
Máteme el que ántes pudiere,
Don Hipólito ó Don Luis:
Pues cosa justa parece,
Si me busca al que yo ofendo,
Que busque yo el que me ofende.
(Vase.)

La Florida.

ESCENA XIV.
DOÑA CLARA, DON HIPÓLITO.
D. Hipól
En aqueste
. hermoso márgen,
En este florido albergue,
Que la hermosa primavera
A tanto estudio guarnece,
Podeis decirme, señora
Doña Ana, lo que á esto os mueve
(Pues ya sabeis que he de estar
A vuestro servicio siempre),
Y no esa grosera nube
Tan bellos rayos afrente.
Amanezca vuestro sol,
Pues ya el del cielo amanece.
D.ª CYo
larharé
. lo que me mandais;
Que á conceptos tan corteses,
Que á discursos tan galantes,
Hace mal quien no obedece.
(Descúbrese.)
D. Hipól
(Ap.). ¡Doña Clara es, vive Dios!
D.ª C¿Qué
lar. os admira? ¿Qué os suspende?
Yo soy: proseguid, que va
El discursillo excelente.
D. Hipól
Ni me. suspendo ni admiro,
Sino sólo de que pienses
Que no te habia conocido,
Y sabido que tú eres.
Pero quíseme vengar
De que salgas desta suerte
De casa, trocando el nombre.
D.ª C¡Oh
lar. qué anciano chiste es ese!
D. Hipól
¡Vive. Dios, que cuando dije
A Don Luis que no viniese
Tras mí, le dije quién eras!
Venga él, y si no dijere
Que es verdad, castiga entónces
Mis culpas con tus desdenes.
Yo voy por él, y dirá...
D.ª CTodo
lar. cuanto tú quisieres.
No le llames.
D. Hipól. Pues ¿por qué?
D.ª CPorque
lar. es el «Muñoz, que miente
Más que vos» del refrancillo.
D. Hipól
No,. no: mejor es que éntre
A desengañarte. (Ap. No es
Sino que yo busco este
Desahogo, con que pueda
Admirarme y suspenderme
De que de una mano á otra
Así una mujer se trueque.)
(Vase.)
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