0% found this document useful (0 votes)
1K views

Machine Learning with R Cookbook 2nd Edition Bhatia - The complete ebook set is ready for download today

The document provides information about the 'Machine Learning with R Cookbook 2nd Edition' by AshishSingh Bhatia and Yu-Wei Chiu, including download links and details about the authors. It also lists additional recommended ebooks related to machine learning and data analysis. The book covers various topics such as data exploration, regression analysis, and time series forecasting using R.

Uploaded by

jyanitafhi
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)
1K views

Machine Learning with R Cookbook 2nd Edition Bhatia - The complete ebook set is ready for download today

The document provides information about the 'Machine Learning with R Cookbook 2nd Edition' by AshishSingh Bhatia and Yu-Wei Chiu, including download links and details about the authors. It also lists additional recommended ebooks related to machine learning and data analysis. The book covers various topics such as data exploration, regression analysis, and time series forecasting using R.

Uploaded by

jyanitafhi
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/ 80

Visit https://ebookultra.

com to download the full version and


explore more ebooks

Machine Learning with R Cookbook 2nd Edition


Bhatia

_____ Click the link below to download _____


https://ebookultra.com/download/machine-learning-with-
r-cookbook-2nd-edition-bhatia/

Explore and download more ebooks at ebookultra.com


Here are some suggested products you might be interested in.
Click the link to download

Mastering Machine Learning with scikit learn 2nd edition


Gavin Hackeling

https://ebookultra.com/download/mastering-machine-learning-with-
scikit-learn-2nd-edition-gavin-hackeling/

Scala for Machine Learning Second Edition Patrick R.


Nicolas

https://ebookultra.com/download/scala-for-machine-learning-second-
edition-patrick-r-nicolas/

Machine Learning with R Expert Techniques for Predictive


Modeling to Solve All Your Data Analysis Problems 2nd
Edition Brett Lantz
https://ebookultra.com/download/machine-learning-with-r-expert-
techniques-for-predictive-modeling-to-solve-all-your-data-analysis-
problems-2nd-edition-brett-lantz/

A First Course in Machine Learning Chapman Hall CRC


Machine Learning Pattern Recognition 2nd Edition Simon
Rogers
https://ebookultra.com/download/a-first-course-in-machine-learning-
chapman-hall-crc-machine-learning-pattern-recognition-2nd-edition-
simon-rogers/
Machine Learning for Time Series Forecasting with Python
1st Edition Francesca Lazzeri

https://ebookultra.com/download/machine-learning-for-time-series-
forecasting-with-python-1st-edition-francesca-lazzeri/

Python Machine Learning By Example The Easiest Way to Get


into Machine Learning 1st Edition Yuxi (Hayden) Liu

https://ebookultra.com/download/python-machine-learning-by-example-
the-easiest-way-to-get-into-machine-learning-1st-edition-yuxi-hayden-
liu/

Bayesian reasoning and machine learning Barber D.

https://ebookultra.com/download/bayesian-reasoning-and-machine-
learning-barber-d/

Data Mining Practical Machine Learning Tools and


Techniques 2nd Edition Ian H. Witten

https://ebookultra.com/download/data-mining-practical-machine-
learning-tools-and-techniques-2nd-edition-ian-h-witten/

Python Machine Learning 1st Edition Wei-Meng Lee

https://ebookultra.com/download/python-machine-learning-1st-edition-
wei-meng-lee/
Machine Learning with R Cookbook 2nd Edition Bhatia
Digital Instant Download
Author(s): Bhatia, AshishSingh; Chiu, Yu-Wei (David)
ISBN(s): 9781787287808, 1787287807
Edition: 2nd
File Details: PDF, 17.02 MB
Year: 2017
Language: english
Machine Learning with R Cookbook
Second Edition

Analyze data and build predictive models


AshishSingh Bhatia

Yu-Wei, Chiu (David Chiu)

BIRMINGHAM - MUMBAI
Machine Learning
with R Cookbook
Second Edition
Copyright © 2017 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored


in a retrieval system, or transmitted in any form or by any means,
without the prior written permission of the publisher, except in the
case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure
the accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the authors, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged
to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information


about all of the companies and products mentioned in this book by
the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.

First published: March 2015

Second edition: October 2017

Production reference: 1171017


Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78728-439-5

www.packtpub.com
Credits
Authors
Copy Editor
AshishSingh Bhatia
Safis Editing
Yu-Wei, Chiu (David Chiu)

Reviewers
Project Coordinator

Ratanlal Mahanta

Saibal Dutta Kinjal Bari

Commissioning Editor Proofreader

Veena Pagare Safis Editing


Acquisition Editor Indexer

Divya Poojari Francy Puthiry


Content Development Editor Graphics

Trusha Shriyan Kirk D'Penha


Technical Editor Production Coordinator

Akash Patel Aparna Bhagat


About the Authors
AshishSingh Bhatia is a reader and learner at his core. He has more
than 11 years of rich experience in different IT sectors,
encompassing training, development, and management. He has
worked in many domains, such as software development, ERP,
banking, and training. He is passionate about Python and Java, and
recently he has been exploring R. He is mostly involved in web and
mobile developments in various capacity. He always likes to explore
new technologies and share his views and thoughts through various
online medium and magazines. He believes in sharing his experience
with new generation and do take active part in training and teaching
also.

First and foremost, I would like to thank God almighty. I would like
to thank my father, mother, brother and friends. I am also thankful to
whole team at PacktPub especially Divya and Trusha. My special
thanks go to my mother Smt. Ravindrakaur Bhatia for guiding and
motivating me when its required most. I also want to take this
opportunity to show my gratitude for Mitesh Soni, he is the one who
introduced me to Packt and started the ball rolling.

Thanks to all who are directly or indirectly involved in this


endeavor.

Yu-Wei, Chiu (David Chiu) is the founder of LargitData Company.


He has previously worked for Trend Micro as a software engineer,
with the responsibility of building up big data platforms for business
intelligence and customer relationship management systems. In
addition to being a startup entrepreneur and data scientist, he
specializes in using Spark and Hadoop to process big data and apply
data mining techniques to data analysis. Yu-Wei is also a
professional lecturer, and has delivered talks on Python, R, Hadoop,
and tech talks at a variety of conferences.

In 2013, Yu-Wei reviewed Bioinformatics with R Cookbook, a book


compiled for Packt Publishing.

He feels immense gratitude to his family and friends for supporting


and encouraging him to complete this book. Here, he sincerely says
thanks to his mother, Ming-Yang Huang (Miranda Huang); his
mentor, Man-Kwan Shan; proofreader of this book, Brendan Fisher;
Taiwan R User Group; Data Science Program (DSP); and more
friends who have offered their support.
About the Reviewers
Ratanlal Mahanta has several years of experience in the modeling
and simulation of quantitative trading. He works as a senior
quantitative analyst at GPSK Investment Group, Kolkata. Ratanlal
holds a master's degree of science in computational finance, and his
research areas include quant trading, optimal Execution, Machine
Learning and high-frequency trading.

He has also reviewed Mastering R for Quantitative Finance,


Mastering Scientific Computing with R, Machine Learning with R
Cookbook, and Mastering Python for Data Science and Building a
Recommendation System with R all by Packt Publishing.

Saibal Dutta has been working as analytical consultant in SAS


Research and Development. He is also pursuing PhD in data mining
and machine learning from Indian Institute of Technology,
Kharagpur. He holds Master of Technology in electronics and
communication from National Institute of Technology, Rourkela. He
has worked at TATA communications, Pune and HCL Technologies
Limited, Noida, as a consultant. In his 7 years of consulting
experience, he has been associated with global players such as IKEA
(in Sweden), Pearson (in the U.S.), and so on. His passion for
entrepreneurship has led him to start his own start-up in the field of
data analytics, which is in the bootstrapping stage. His areas of
expertise include data mining, machine learning, image processing,
and business consultation.

I would like to thank my advisor, Prof. Sujoy Bhattacharya, all my


colleagues specially, Ashwin Deokar, Lokesh Nagar, Savita Angadi,
Swarup De and my family and friends specially, Madhuparna Bit for
their encouragement, support, and inspiration.
www.PacktPub.com
For support files and downloads related to your book, please visit ww
w.PacktPub.com. Did you know that Packt offers eBook versions of
every book published, with PDF and ePub files available? You can
upgrade to the eBook version at www.PacktPub.com and as a print book
customer, you are entitled to a discount on the eBook copy. Get in
touch with us at service@packtpub.com for more details. At www.PacktPu
b.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and
offers on Packt books and eBooks.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you
full access to all Packt books and video courses, as well as industry-
leading tools to help you plan your personal development and
advance your career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the
heart of our editorial process. To help us improve, please leave us an
honest review on this book's Amazon page at https://www.amazon.com/d
p/1787284395.

If you'd like to join our team of regular reviewers, you can email us
at customerreviews@packtpub.com. We award our regular reviewers with
free eBooks and videos in exchange for their valuable feedback.
Help us be relentless in improving our products!
Table of Contents
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Practical Machine Learning with R
Introduction
Downloading and installing R
Getting ready
How to do it...
How it works...
See also
Downloading and installing RStudio
Getting ready
How to do it...
How it works...
See also
Installing and loading packages
Getting ready
How to do it...
How it works...
See also
Understanding of basic data structures
Data types
Data structures
Vectors
How to do it...
How it works...
Lists
How to do it...
How it works...
Array
How to do it...
How it works...
Matrix
How to do it...
DataFrame
How to do it...
Basic commands for subsetting
How to do it...
Data input
Reading and writing data
Getting ready
How to do it...
How it works...
There's more...
Manipulating data
Getting ready
How to do it...
How it works...
There's more...
Applying basic statistics
Getting ready
How to do it...
How it works...
There's more...
Visualizing data
Getting ready
How to do it...
How it works...
See also
Getting a dataset for machine learning
Getting ready
How to do it...
How it works...
See also
2. Data Exploration with Air Quality Datasets
Introduction
Using air quality dataset
Getting ready
How to do it...
How it works...
There's more...
Converting attributes to factor
Getting ready
How to do it...
How it works...
There's more...
Detecting missing values
Getting ready
How to do it...
How it works...
There's more...
Imputing missing values
Getting ready
How to do it...
How it works...
Exploring and visualizing data
Getting ready
How to do it...
Predicting values from datasets
Getting ready
How to do it...
How it works...
3. Analyzing Time Series Data
Introduction
Looking at time series data
Getting ready
How to do it...
How it works...
See also
Plotting and forecasting time series data
Getting ready
How to do it...
How it works...
See also
Extracting, subsetting, merging, filling, and padding
Getting ready
How to do it...
How it works...
See also
Successive differences and moving averages
Getting ready
How to do it...
How it works...
See also
Exponential smoothing
Getting ready
How to do it...
How it works...
See also
Plotting the autocorrelation function
Getting ready
How to do it...
How it works...
See also
4. R and Statistics
Introduction
Understanding data sampling in R
Getting ready
How to do it...
How it works...
See also
Operating a probability distribution in R
Getting ready
How to do it...
How it works...
There's more...
Working with univariate descriptive statistics in R
Getting ready
How to do it...
How it works...
There's more...
Performing correlations and multivariate analysis
Getting ready
How to do it...
How it works...
See also
Conducting an exact binomial test
Getting ready
How to do it...
How it works...
See also
Performing a student's t-test
Getting ready
How to do it...
How it works...
See also
Performing the Kolmogorov-Smirnov test
Getting ready
How to do it...
How it works...
See also
Understanding the Wilcoxon Rank Sum and Signed Rank test
Getting ready
How to do it...
How it works...
See also
Working with Pearson's Chi-squared test
Getting ready
How to do it...
How it works...
There's more...
Conducting a one-way ANOVA
Getting ready
How to do it...
How it works...
There's more...
Performing a two-way ANOVA
Getting ready
How to do it...
How it works...
See also
5. Understanding Regression Analysis
Introduction
Different types of regression
Fitting a linear regression model with lm
Getting ready
How to do it...
How it works...
There's more...
Summarizing linear model fits
Getting ready
How to do it...
How it works...
See also
Using linear regression to predict unknown values
Getting ready
How to do it...
How it works...
See also
Generating a diagnostic plot of a fitted model
Getting ready
How to do it...
How it works...
There's more...
Fitting multiple regression
Getting ready
How to do it...
How it works...
Summarizing multiple regression
Getting ready
How to do it...
How it works...
See also
Using multiple regression to predict unknown values
Getting ready
How to do it...
How it works...
See also
Fitting a polynomial regression model with lm
Getting ready
How to do it...
How it works...
There's more...
Fitting a robust linear regression model with rlm
Getting ready
How to do it...
How it works...
There's more...
Studying a case of linear regression on SLID data
Getting ready
How to do it...
How it works...
See also
Applying the Gaussian model for generalized linear regression
Getting ready
How to do it...
How it works...
See also
Applying the Poisson model for generalized linear regression
Getting ready
How to do it...
How it works...
See also
Applying the Binomial model for generalized linear regression
Getting ready
How to do it...
How it works...
See also
Fitting a generalized additive model to data
Getting ready
How to do it...
How it works...
See also
Visualizing a generalized additive model
Getting ready
How to do it...
How it works...
There's more...
Diagnosing a generalized additive model
Getting ready
How to do it...
How it works...
There's more...
6. Survival Analysis
Introduction
Loading and observing data
Getting ready
How to do it...
How it works...
There's more...
Viewing the summary of survival analysis
Getting ready
How to do it...
How it works...
Visualizing the Survival Curve
Getting ready
How to do it...
How it works...
Using the log-rank test
Getting ready
How to do it...
How it works...
Using the COX proportional hazard model
Getting ready
How to do it...
How it works...
Nelson-Aalen Estimator of cumulative hazard
Getting ready
How to do it...
How it works...
See also
7. Classification 1 - Tree, Lazy, and Probabilistic
Introduction
Preparing the training and testing datasets
Getting ready
How to do it...
How it works...
There's more...
Building a classification model with recursive partitioning trees
Getting ready
How to do it...
How it works...
See also
Visualizing a recursive partitioning tree
Getting ready
How to do it...
How it works...
See also
Measuring the prediction performance of a recursive partitioning tree
Getting ready
How to do it...
How it works...
See also
Pruning a recursive partitioning tree
Getting ready
How to do it...
How it works...
See also
Handling missing data and split and surrogate variables
Getting ready
How to do it...
How it works...
See also
Building a classification model with a conditional inference tree
Getting ready
How to do it...
How it works...
See also
Control parameters in conditional inference trees
Getting ready
How to do it...
How it works...
See also
Visualizing a conditional inference tree
Getting ready
How to do it...
How it works...
See also
Measuring the prediction performance of a conditional inference tree
Getting ready
How to do it...
How it works...
See also
Classifying data with the k-nearest neighbor classifier
Getting ready
How to do it...
How it works...
See also
Classifying data with logistic regression
Getting ready
How to do it...
How it works...
See also
Classifying data with the Naïve Bayes classifier
Getting ready
How to do it...
How it works...
See also
8. Classification 2 - Neural Network and SVM
Introduction
Classifying data with a support vector machine
Getting ready
How to do it...
How it works...
See also
Choosing the cost of a support vector machine
Getting ready
How to do it...
How it works...
See also
Visualizing an SVM fit
Getting ready
How to do it...
How it works...
See also
Predicting labels based on a model trained by a support vector machi
ne
Getting ready
How to do it...
How it works...
There's more...
Tuning a support vector machine
Getting ready
How to do it...
How it works...
See also
The basics of neural network
Getting ready
How to do it...
Training a neural network with neuralnet
Getting ready
How to do it...
How it works...
See also
Visualizing a neural network trained by neuralnet
Getting ready
How to do it...
How it works...
See also
Predicting labels based on a model trained by neuralnet
Getting ready
How to do it...
How it works...
See also
Training a neural network with nnet
Getting ready
How to do it...
How it works...
See also
Predicting labels based on a model trained by nnet
Getting ready
How to do it...
How it works...
See also
9. Model Evaluation
Introduction
Why do models need to be evaluated?
Different methods of model evaluation
Estimating model performance with k-fold cross-validation
Getting ready
How to do it...
How it works...
There's more...
Estimating model performance with Leave One Out Cross Validation
Getting ready
How to do it...
How it works...
See also
Performing cross-validation with the e1071 package
Getting ready
How to do it...
How it works...
See also
Performing cross-validation with the caret package
Getting ready
How to do it...
How it works...
See also
Ranking the variable importance with the caret package
Getting ready
How to do it...
How it works...
There's more...
Ranking the variable importance with the rminer package
Getting ready
How to do it...
How it works...
See also
Finding highly correlated features with the caret package
Getting ready
How to do it...
How it works...
See also
Selecting features using the caret package
Getting ready
How to do it...
How it works...
See also
Measuring the performance of the regression model
Getting ready
How to do it...
How it works...
There's more...
Measuring prediction performance with a confusion matrix
Getting ready
How to do it...
How it works...
See also
Measuring prediction performance using ROCR
Getting ready
How to do it...
How it works...
See also
Comparing an ROC curve using the caret package
Getting ready
How to do it...
How it works...
See also
Measuring performance differences between models with the caret pa
ckage
Getting ready
How to do it...
How it works...
See also
10. Ensemble Learning
Introduction
Using the Super Learner algorithm
Getting ready
How to do it...
How it works...
Using ensemble to train and test
Getting ready
How to do it...
How it works...
Classifying data with the bagging method
Getting ready
How to do it...
How it works...
There's more...
Performing cross-validation with the bagging method
Getting ready
How to do it...
How it works...
See also
Classifying data with the boosting method
Getting ready
How to do it...
How it works...
There's more...
Performing cross-validation with the boosting method
Getting ready
How to do it...
How it works...
See also
Classifying data with gradient boosting
Getting ready
How to do it...
How it works...
There's more...
Calculating the margins of a classifier
Getting ready
How to do it...
How it works...
See also
Calculating the error evolution of the ensemble method
Getting ready
How to do it...
How it works...
See also
Classifying data with random forest
Getting ready
How to do it...
How it works...
There's more...
Estimating the prediction errors of different classifiers
Getting ready
How to do it...
How it works...
See also
11. Clustering
Introduction
Clustering data with hierarchical clustering
Getting ready
How to do it...
How it works...
There's more...
Cutting trees into clusters
Getting ready
How to do it...
How it works...
There's more...
Clustering data with the k-means method
Getting ready
How to do it...
How it works...
See also
Drawing a bivariate cluster plot
Getting ready
How to do it...
How it works...
There's more...
Comparing clustering methods
Getting ready
How to do it...
How it works...
See also
Extracting silhouette information from clustering
Getting ready
How to do it...
How it works...
See also
Obtaining the optimum number of clusters for k-means
Getting ready
How to do it...
How it works...
See also
Clustering data with the density-based method
Getting ready
How to do it...
How it works...
See also
Clustering data with the model-based method
Getting ready
How to do it...
How it works...
See also
Visualizing a dissimilarity matrix
Getting ready
How to do it...
How it works...
There's more...
Validating clusters externally
Getting ready
How to do it...
How it works...
See also
12. Association Analysis and Sequence Mining
Introduction
Transforming data into transactions
Getting ready
How to do it...
How it works...
See also
Displaying transactions and associations
Getting ready
How to do it...
How it works...
See also
Mining associations with the Apriori rule
Getting ready
How to do it...
How it works...
See also
Pruning redundant rules
Getting ready
How to do it...
How it works...
See also
Visualizing association rules
Getting ready
How to do it...
How it works...
See also
Mining frequent itemsets with Eclat
Getting ready
How to do it...
How it works...
See also
Creating transactions with temporal information
Getting ready
How to do it...
How it works...
See also
Mining frequent sequential patterns with cSPADE
Getting ready
How to do it...
How it works...
See also
Using the TraMineR package for sequence analysis
Getting ready
How to do it...
How it works...
Visualizing sequence, Chronogram, and Traversal Statistics
Getting ready
How to do it...
How it works...
See also
13. Dimension Reduction
Introduction
Why to reduce the dimension?
Performing feature selection with FSelector
Getting ready
How to do it...
How it works...
See also
Performing dimension reduction with PCA
Getting ready
How to do it...
How it works...
There's more...
Determining the number of principal components using the scree test
Getting ready
How to do it...
How it works...
There's more...
Determining the number of principal components using the Kaiser m
ethod
Getting ready
How to do it...
How it works...
See also
Visualizing multivariate data using biplot
Getting ready
How to do it...
How it works...
There's more...
Performing dimension reduction with MDS
Getting ready
How to do it...
How it works...
There's more...
Reducing dimensions with SVD
Getting ready
How to do it...
How it works...
See also
Compressing images with SVD
Getting ready
How to do it...
How it works...
See also
Performing nonlinear dimension reduction with ISOMAP
Getting ready
How to do it...
How it works...
There's more...
Performing nonlinear dimension reduction with Local Linear Embed
ding
Getting ready
How to do it...
How it works...
See also
14. Big Data Analysis (R and Hadoop)
Introduction
Preparing the RHadoop environment
Getting ready
How to do it...
How it works...
See also
Installing rmr2
Getting ready
How to do it...
How it works...
See also
Installing rhdfs
Getting ready
How to do it...
How it works...
See also
Operating HDFS with rhdfs
Getting ready
How to do it...
How it works...
See also
Implementing a word count problem with RHadoop
Getting ready
How to do it...
How it works...
See also
Comparing the performance between an R MapReduce program and
a standard R program
Getting ready
How to do it...
How it works...
See also
Testing and debugging the rmr2 program
Getting ready
How to do it...
How it works...
See also
Installing plyrmr
Getting ready
How to do it...
How it works...
See also
Manipulating data with plyrmr
Getting ready
How to do it...
How it works...
See also
Conducting machine learning with RHadoop
Getting ready
How to do it...
How it works...
See also
Configuring RHadoop clusters on Amazon EMR
Getting ready
How to do it...
How it works...
See also
Preface
Big data has become a popular buzzword across many industries. An
increasing number of people have been exposed to the term and are
looking at how to leverage big data in their own businesses, to
improve sales and profitability. However, collecting, aggregating,
and visualizing data is just one part of the equation. Being able to
extract useful information from data is another task, and much more
challenging.

Traditionally, most researchers perform statistical analysis using


historical samples of data. The main downside of this process is that
conclusions drawn from statistical analysis are limited. In fact,
researchers usually struggle to uncover hidden patterns and unknown
correlations from target data. Aside from applying statistical
analysis, machine learning has emerged as an alternative. This
process yields a more accurate predictive model with the data
inserted into a learning algorithm. Through machine learning, the
analysis of business operations and processes is not limited to
human-scale thinking. Machine-scale analysis enables businesses to
discover hidden value in big data.

The most widely used tool for machine learning and data analysis is
the R language. In addition to being the most popular language used
by data scientists, R is open source and is free for use for all users.
The R programming language offers a variety of learning packages
and visualization functions, which enable users to analyze data on
the fly. Any user can easily perform machine learning with R on
their dataset without knowing every detail of the mathematical
models behind the analysis.

Machine Learning with R Cookbook takes a practical approach to


teaching you how to perform machine learning with R. Each of the
14 chapters are introduced to you by dividing this topic into several
simple recipes. Through the step-by-step instructions provided in
each recipe, the reader can construct a predictive model by using a
variety of machine learning packages.
What this book covers
Chapter 1, Practical Machine Learning with R, shows how to install
and setup R environment, it covers package installation basic syntax
and data types followed by reading and writing data from various
sources. It also covers basic statistics and visualization using R.

Chapter 2, Data Exploration with Air Quality Datasets, shows how


actual data looks in R. It covers loading of data, exploring and
visualizing the data.

Chapter 3, Analyzing Time Series Data, shows a totally different type


of data which consist of time factor. It covers how to handle time
series in R.

Chapter 4, R and Statistics, covers data sampling, probability


distribution, univariate descriptive statistics, correlation, multivariate
analysis, linear regression. Exact binomial test, student – t test,
Kolmogorov-Smirnov test, Wilcoxon Rank Sum and Signed Rank
test, Pearson's Chi-squared Test, One-way ANOVA, and Two-way
ANOVA.

Chapter 5, Understanding Regression Analysis, introduces to the


supervised learning, to analyze the relationship between dependent
and independent variable. It covers different type of distribution
model followed by generalized additive model.

Chapter 6, Survival Analysis, shows how to analyze the data where the
outcome variable is time for occurrence of an event, widely used in
clinical trials.

Chapter 7, Classification 1 – Tree, Lazy and Probabilistic, Tree, Lazy


and Probabilistic, deals with classification model built from the
training dataset, of which the categories are already known.
Chapter 8, Classification 2 – Neural Network and SVM, shows how to
train a support vector machine and neural network, how to visualize
and tune the both.

Chapter 9, Model Evaluation, shows to evaluate the performance of a


fitted model.

Chapter 10, Ensemble Learning, shows bagging and boosting to


classify the data, perform the cross validation to estimate the error
rate. It also covers the random forest.

Chapter 11, Clustering, means grouping similar objects widely used in


business applications. It covers four clustering techniques, validating
clusters internally.

Chapter 12, Association Analysis and Sequence Mining, covers finding


the hidden relationships within a transaction data set. It shows how
to create and inspect the transaction data set, performing association
analysis with an Aprori algorithm, visualizing associations in various
graphs formats, using Eclat algorithm finding frequent itemset.

Chapter 13, Dimension Reduction, shows how to deal with redundant


data and removing irrelevant data. It shows how to perform feature
ranking and selection, extraction and dimension reduction using
linear and nonlinear methods.

Chapter 14, Big Data Analysis ( R and Hadoop ), shows how R can be
used with big data. It covers preparing of Hadoop environment,
performing MapReduce from R, operate a HDFS, performing
common data operation.
What you need for this
book
All the examples cover in this book have been tested on R version
3.4.1 and R studio version 1.0.153. Chapter 1, Practical Machine
Learning with R, covers how to download and install them.
Who this book is for
This book is for data science professionals, data analysts, or anyone
who has used R for data analysis and machine learning, and now
wishes to become the go-to person for machine learning with R.
Those who wish to improve the efficiency of their machine learning
models and need to work with different kids of datasets will find this
book quite insightful.
Sections
In this book, you will find several headings that appear frequently
(Getting ready, How to do it..., How it works..., There's more..., and
See also).

To give clear instructions on how to complete a recipe, we use these


sections as follows:
Getting ready
This section tells you what to expect in the recipe, and describes how
to set up any software or any preliminary settings required for the
recipe.
How to do it…
This section contains the steps required to follow the recipe.
Another Random Scribd Document
with Unrelated Content
wife. After this it was of course vain for her to make objections; he
was completely master of his own house, and Jane knew, from sad
experience, that she might produce as much effect by talking to the
tables and chairs as to him, when in one of his stubborn fits.
All she could do, therefore, was to be as cross as possible for the
rest of the day to those around her, in consequence of which she
was left to a tête-à-tête with Margaret, as Elizabeth was upstairs
making preparations for Emma's departure, and Robert went out to
spend the evening with some bachelor friends.
CHAPTER IV.

Punctually the next day, Mr. Bridge drove to the door, and at the
same moment Mr. Morgan entered the house. Emma was in the
parlour quite ready for her journey, and her eye sparkled with
pleasure as she told him that she should not trouble him to call on
her again, for she was leaving Croydon for a long time. He looked
aghast.—
"Going away," was his exclamation, as he cast an enquiring eye at
the trunk which Mr. Bridge's man was preparing to place on the
carriage. "This is quite unexpected—may I ask where you are
going?"
"It is Mr. Bridge who is taking me away," replied Emma, "and
really I can hardly answer as to where we are going. I am wishing to
try a change of air, as I do not find Croydon agree with me."
"This is Mr. Bridge's doing then," said he, his face turning pale
with an emotion which she did not understand. He felt convinced
that his plans had been seen through and counteracted, and
entertained, in consequence, anything but a feeling of gratitude
towards the agent of his disappointment. At this moment the
clergyman entered, and claimed Emma's company, and after an
affectionate farewell from Miss Watson, and a formal bow from the
doctor, she was hurried away. The other two ladies were out
walking, as Jane was determined not to countenance Emma's
departure by her presence on the occasion. Emma felt so very much
relieved as she lost sight of Croydon, and entered on a country quite
new to her, that she fancied she was deriving fresh health and
strength from every breath she inhaled. She was, however too weak
to bear much conversation, and was content to lie back in peace and
silence in a corner of the carriage, quietly reposing on the cushions
with which she had been carefully propped, and enjoying the luxury
of seeing the varying landscape pass before her eyes, without
making any exertion. Mr. Bridge was reading; and in this way the
fourteen miles were pleasantly and quickly passed, and in about two
hours from leaving Croydon, they stopped at the door of Miss
Bridge's residence.
It was a small, old-fashioned house, with a thick screen of shrubs
surrounding it, and a few picturesque old Scotch firs standing on the
little grass plat which divided the front from the road. The walls were
covered with creeping shrubs, and it was evident that the owner
loved flowers, for early as it was in the year, the little porch was
crowded with showy plants, and odoriferous with the scent of the
hyacinth, narcissus and other sweet bulbs. The old lady came out to
receive them, and the warmth of her welcome, with the kindness of
her manner, quite won Emma's heart at once. She saw that her
guest was fatigued, and would not allow her to exert herself in any
way; but leading her upstairs, made her rest on the bed, and left her
promising to return in a short time. The air of comfort which now
surrounded Emma, was truly grateful to her feelings; the airy and
well-furnished bed-room, the snowy curtains and drapery round the
bed, the comfortable furniture, all seemed to bespeak an attention
to her wants, to which she had long been a stranger; and as she lay
there thinking over all that was past, and wondering what was to
come next, a deep feeling of gratitude stole over her heart for
finding herself at last in so peaceful and apparently comfortable a
home.
Faithful to her promise, Miss Bridge returned speedily, bringing
with her some refreshment, of which she insisted on Emma's
partaking; and then desiring her to remain quiet for a couple of
hours at least, she returned to her brother, and spent the interval in
learning every particular that he could detail relative to her
interesting young visitor.
When Emma woke from a refreshing slumber of several hours
duration, the first object which met her eyes was the countenance of
Miss Bridge bending over her. There was such a look of benevolent
interest in that good-tempered face, as would have sufficed to
redeem a very plain set of features from the charge of insipidity. But
Miss Bridge was very far from plain, and it was evident she must
have been eminently handsome. She was extremely thin, and her
high features, and dark complexion made her look, perhaps, rather
older than she really was, but her eyes which were dark hazel were
still bright and lively. Her dress was that of an old woman, the
colours grave, and the materials rich, and though not exactly in the
reigning fashion of the day, yet sufficiently like it to prevent any
appearance of singularity, whilst it was perfectly becoming her age
and station. Emma felt sure that she should like her exceedingly, and
quite longed to be strong enough to converse with her. She was
found so much better as to be permitted to leave her room, and lie
for a time on the sofa in the drawing-room, though Miss Bridge still
proscribed conversation, and recommended quiet and rest.
Everything that she saw gave her an idea of the comfort of her
new home; the well-filled book-shelves especially delighted her; she
had enjoyed so little time for reading lately that the sight of such a
collection of books was a most welcome prospect, and she
anticipated with satisfaction the time when she should be able to
exert herself again, and commence the acquisition of the Italian
language; as she was extremely anxious to increase her information
and accomplishments to the utmost.
The next day the old clergyman took his leave, and telling Emma
not to fret about her friends at Croydon, and hoping when he came
over next month, he should find her with rosy cheeks and smiles to
welcome him, he went off quite satisfied that he had secured a
comfortable home for his young friend, and a desirable companion
for his old sister.
Nothing could be more peaceful and pleasant to a contented mind
than the course of life in which Emma now engaged. She speedily
recovered her strength, and was able by early rising to enjoy several
hours alone in the morning, which she devoted to study; by this
means she was always at liberty to give her whole attention to Miss
Bridge so soon as they met in the drawing-room. Their fore-noons
were employed in reading and needlework, unless when Miss Bridge
was writing letters or settling her household matters. Walking out, or
working in the garden occupied the afternoon, and in both these
occupations, as soon as Emma was strong enough, she took great
delight. The garden was cultivated with uncommon care; Miss Bridge
having quite a passion for floriculture, and Emma thought nothing
could exceed the beauty of her tulips, anemones and hyacinths, as
they gradually unfolded their blossoms. She became extremely
interested in the pursuit, and Miss Bridge more than once had to
interfere to prevent her over tiring herself by her zealous labours.
The country round their residence was extremely pretty; tracts of
old forest land with the huge old trees, survivors of many centuries,
formed an agreeable contrast to the agricultural districts
interspersed in places; and the steep sides of some of the chalky
hills were clothed with hanging beech woods equally picturesque
with the green forest glades beneath. To wander over this scenery,
botanising amongst the lanes and hedgerows, or visiting the various
cottages in the neighbourhood, formed a delightful variety to their
labours in the garden. Emma found that next to the clergyman, Miss
Bridge was looked up to as the guardian and friend of the poor.
Every wounded limb, or distressing domestic affliction was
detailed to her. Her advice was sought equally when the pig died,
the baby was born, or the husband was sick. Her medicine-chest
was in frequent requisition, but her kitchen and dairy still more so.
For one dose of rhubarb which she dispensed, she gave away at
least two dinners, and those well acquainted with the poor may
judge whether by so doing she was not likely to prevent as much
illness as she cured; for by far the greater part of the diseases
amongst the labouring classes arise from scanty food and too thin
clothing. Of course she was the idol, the oracle of all the villagers,
and the more so because there was no squire nor squire's family in
the parish to diminish her importance or dim the lustre of her
position. In fact she was the sister of the last squire, and since his
death, as his eldest son resided on another property, the manor-
house had stood empty and deserted. It quite grieved Emma to see
it, for the house with its gable-ends and old-fashioned porch was
very picturesque; but they derived one advantage from the desolate
condition in which it was left, as they had the uncontrolled range of
the gardens and pleasure-grounds, which were very extensive. The
little church stood within these grounds, and by its situation
somewhat reminded her of Osborne Castle. But how different was
the Rector. He was an old, formal bachelor, living with an unmarried
sister, extremely nervous and shy, and more remarkable for his total
disregard to punctuality than any other point. This was peculiarly
evident on the Sunday, when the whole congregation were always
assembled at least a quarter of an hour before his appearance
amongst them. If the day was fine, they did not enter the church
but remained strolling up and down the pasture in which it stood,
until the minister appeared and led the way into the sacred building.
The congregation, which was almost entirely composed of the rural
population, presented a very different aspect from that at Croydon;
there were few smart bonnets, and the gayest articles of apparel in
the church were the scarlet cloaks of the women. The dark and old-
fashioned building itself had no ornaments but the hatchments
belonging to the Bridge family, and one or two ugly and cumbrous
monuments upon the walls, which seemed intended to record that
certain individuals had been born and died, though what they did
when living was now totally forgotten.
When the service was concluded, the clergyman quitted the pulpit
and walked out before all his congregation, who stood up
respectfully to let him pass, and then Miss Bridge and Emma, who
had their seat in the squire's pew, followed before any one else
presumed to stir from their places: there was then a friendly
greeting between the Rector and his principal parishioners, after
which they took their quiet way homewards, to partake of their early
dinner, and return to the afternoon service.
Such was the tenor of Emma's life, whilst she remained with Miss
Bridge—the only incident that varied the scene, was a drive over to
Croydon one day, in order to attend Margaret's wedding. Emma had
recovered her strength so rapidly, that she was perfectly equal to the
exertion, and Margaret had sent a pressing invitation not only to her,
but to Miss Bridge likewise. It was, therefore, settled that they
should go and spend the night at the vicarage, as Robert Watson's
house was quite full—with the addition of some cousins of his wife,
who were paying a visit. In consequence of this arrangement, she
did not see her future brother-in-law that day; but Elizabeth spent
the afternoon with them. She saw, with sincere pleasure, how much
Emma was improved in looks—she was plumper and fresher—more
blooming and bewitching than ever; and so thought Mr. Morgan too
—for he likewise, called to see her—and was quite startled with the
alteration in her appearance.
"I need not ask you how you are," said he, fixing on her eyes
which spoke his admiration as plainly as if he had put it into words;
"you are looking so well."
Emma was forced to turn away, for the expression of his face was
too openly admiring to be pleasant.
Elizabeth had a long chat with her in private: there was so much
to learn about her new way of life, and so much to tell in return, that
it seemed as if four and twenty hours instead of two, might have
been talked away with ease. There was much to discuss about
Margaret's prospects; Elizabeth was very little satisfied with Tom
Musgrove, and only wondered that her sister appeared so well
pleased as she did. He was careless and cold—almost to insolence—
and had, evidently, tried to annoy her in every way he could; flirting
with every girl who came in his way, and only shewing that he was
not careless to her feelings, by his repeated attempts to wound
them. To all this she seemed perfectly indifferent—whether from
vanity, she really did not see, or from wilful blindness she would not
perceive his meaning, Elizabeth could not tell; but she always
continued to preserve a most satisfied air; and when slighted by
Tom, sought peace and contentment in the contemplation of her
wedding presents and bridal finery; constantly talking as if she
enjoyed the unlimited affection of the most amiable and agreeable
man in the world.
"And who do you think appeared amongst us last week?"
continued Elizabeth, "actually Lord Osborne! Ah! you color and look
pleased—and well you may—for I have no doubt Croydon would
never have seen his countenance, if he had not thought you still
living here!"
"Lord Osborne!" said Emma astonished, "what brought his lordship
here—do you know?"
"The ostensible reason, was to bring a present to Margaret from
his sister—a very pretty necklace as a wedding present; but the real
reason, I have not the smallest doubt was, to see you—and had he
not supposed you were still here, the parcel might have come by the
coach, for any trouble he would have given himself about it."
"It was very good-natured of Miss Osborne, to remember
Margaret in that way," said Emma, "how pleased she must have
been."
"Yes, I think she was—it seemed even to put Tom in a better
humour with her and every thing—it gave her a sort of
consequence."
"What did Lord Osborne say?" enquired Emma, hoping to hear
something relative to Mr. Howard.
"Oh! we had a long talk together, and he enquired particularly
about you, and where and how you were; and he said he hoped
very soon to see you. He talked about expecting you to visit his
sister; in short, he seemed to have a great deal to say for himself—
and really for him, was quite agreeable. To be sure, I do not think
him quite so pleasant as George Millar, but every body need not
have my taste of course."
"Well, I should like to have seen him—did he say nothing about
our friends, Mrs. Willis and her brother—how are they?"
"He said, what I was sorry to hear, that Mr. Howard appeared ill
and out of spirits. I wonder what can be the matter with him—do
you think he can be in love?"
"I am not in his confidence," said Emma, coloring deeply.
"You will see him, of course," said Elizabeth, "if you go to Osborne
Castle—be sure and let me know what you think of him, then; do
ascertain if he is in love."
"You had better make observations for yourself, Elizabeth," replied
her sister, "how can I judge of a sentiment with which I am
unacquainted; wait till you visit Margaret, and you will be able to
form your own opinions."
"I do not think I shall ever visit Margaret," replied Elizabeth; "so if
I do not see Mr. Howard under any other circumstances, our chance
of meeting is but small."
The wedding-day was as bright and sunshiny as any bride could
desire. Emma's thoughts wandered from Margaret and her
companions to the bridal party in London, who she imagined would
be engaged in the same ceremony about the same hour. She knew
Mr. Howard was to officiate for her friend, and she tried to picture
the scene to herself; then she imagined another group, where Mr.
Howard himself should perform the part of bridegroom; and
wondered what her own feelings would be if she were the witness of
such a spectacle.
She was ashamed of herself when she recalled her mind from this
vision, and she tried to think of something more appropriate to the
occasion. She joined in the prayers for her sister's happiness, but her
heart trembled as she thought of her prospects; however, it was no
use foreboding evil—she tried to hope for the best.
Margaret was not satisfied with her two sisters as bridesmaids, but
both she and Tom had insisted on having four more from amongst
her intimate friends. One of these was the younger Miss Morgan,
and as a compliment to her, her brother was invited to be of the
party to church. He stood by Emma; but she was unconscious of it,
until, when the ceremony was concluded, and there was a general
congratulation, and kissing going on, she felt her hand clasped by
some one, and on her turning round, he whispered in her ear,
—"When shall you stand in your sister's place?"
Before she had time to answer, or even to understand exactly
what he had said, her new-made brother came up and claimed the
right of kissing her—the double right in fact, both as bridegroom and
brother—and when she had submitted to the infliction, she again
heard it whispered into her ear:
"That is the only part which I envy Mr. Musgrove."
Emma moved away without looking round again, and took her
station by the side of her friend, Miss Bridge, where she felt
convinced that Mr. Morgan would not dare to intrude on her. There
was something in the change of manner which he had lately
assumed to her, most particularly offensive and grating to her
feelings.
Another thing she could not avoid remarking was, that some of
the young ladies affected to shun her, shrinking away when she
approached, and abruptly changing the conversation, as if some
mystery were going on between them. This was more particularly
evident during the party which succeeded the wedding; when she
found herself rather a conspicuous person two or three times, being
left alone by those she approached—and on more than one
occasion, seeing a group suddenly disperse on her drawing near;
she did not comprehend the reason of this, but she felt it particularly
disagreeable; and it induced her as soon as she noticed it, to keep
close to Miss Bridge, in order to avoid the feeling of solitude in a
crowd which was so distressing to her.
The meeting after the wedding was as dull as such affairs usually
are, and right glad was Emma when the time for retiring came, and
she was able to return to the peaceful vicarage. The next day she
again left Croydon, and once more found repose and tranquillity
beneath Miss Bridge's hospitable roof.
CHAPTER V.

Much as Emma's thoughts had been dwelling on her acquaintance


in London, she little guessed the scene that had really been passing,
or the prominent figure which Mr. Howard had made on the
occasion.
When the ceremony was performed, the breakfast over, and the
new married couple had left the house, Lady Osborne retired to her
dressing-room, and thither she sent for Mr. Howard. Without the
slightest suspicion as to the real object of her wishes, he obeyed the
summons, and found her ladyship alone.
She requested him to be seated, and then looked exceedingly
embarrassed, and not a little silly; but after some attempts at
conversation, which ended in total failures, she suddenly observed:
"The marriage of my daughter makes a great difference to me, Mr.
Howard."
"Of course it must," replied he, rather wondering what would
come next.
"I fear I shall find myself very uncomfortable if I continue in the
same style of life I have done before; without Miss Osborne I shall
be quite lost."
Mr. Howard could not help thinking that he should have supposed
few mothers would have felt the change so little. They had never
been companions or appeared of any consequence to each other.
However he felt it his duty to make some cheering observation, and
therefore ventured to suggest that her ladyship should not give way
to such desponding thoughts: she might, perhaps, find it less painful
than she anticipated.
"You are very kind to try to cheer me in my melancholy situation,
but, Mr. Howard, I have always found you so, and I am deeply
indebted to you for the many hours of comfort you have at different
times procured for me. You have always been my friend."
He did not at all know what to say to this speech, and was
therefore silent.
"Do you consider," continued she, "that gratitude is a good
foundation for happiness in the married state?"
"It is, no doubt, a good foundation for affection," replied he, "but
unless the superstructure is raised, I do not think the foundation will
be of much use. It is not sufficient of itself."
"You distress me by your opinion, I had hoped that to secure
gratitude was the certain way to produce love."
"I apprehend that your ladyship will find it much more easy to
deserve gratitude than to secure it; it is an intractable virtue, and
favors which are supposed to have this return as their object, are
apt to fail entirely in their purpose."
"I am very sorry you say so, Mr. Howard; I wish I could secure
love from the objects of my affection. I fear the case is exactly the
reverse."
The gentleman was silent, and a pause ensued between them,
which the lady broke.
"What do you think of my daughter's marriage?"
"I think," replied he, "it has every promise of securing them
mutual happiness—I hope this as sincerely as I wish it. Sir William is
an excellent young man."
"The marriage is not so high a one as what my daughter might
have aspired to—she has given up all dreams of ambition—do you
not see that?"
"Of course Miss Osborne might have married the equal or the
superior to her brother in rank," said Mr. Howard, "but she has acted
far more wisely, in my opinion, in preferring worth and affection,
though not accompanying so splendid an alliance as possibly her
friends have expected for her. Sir William has wealth to satisfy a less
reasonable woman than Lady Gordon, and if his rank is sufficiently
elevated to content her, she can have no more to desire."
"Do not imagine, Mr. Howard, from what I said that I was
regretting the difference in rank; on the contrary, I believe most fully
that as she was attached to Sir William, Miss Osborne could do
nothing better than marry him. Far be it from me to wish any one to
sacrifice affection to ambition. Had there been even more difference
in their rank, had the descent been decidedly greater—had he been
of really plebeian origin, I should not have objected when her
affections were fixed."
"I cannot imagine that there was any possibility of such an event;
Miss Osborne would never have fixed her affections on an unsuitable
object, as any one decidedly beneath her would have been."
"Do you then consider it unsuitable, where love directs, to step
out of one's own sphere to follow its dictates?"
"I am decidedly averse to unequal marriages—even when the
husband is the superior, if the inequality is very great I am inclined
to think it does not tend to promote happiness: but when their
positions are reversed, and the man, instead of elevating his wife,
drags her down to a level beneath that where she had previously
moved, it can hardly fail to produce some degree of domestic
discomfort."
"Alas, I am grieved that your opinion should be so contrary to my
favorite theories; I can imagine nothing more delightful than for a
woman to sacrifice station and rank, to forego an elevated position,
and to lay down her wealth at the feet of some man distinguished
only by his wit and worth; to have the proud happiness of securing
thus his eternal gratitude."
"I think a man must be very selfish and self-confident, who could
venture to ask such a sacrifice from any woman. I could not."
"But I am supposing that the sacrifice is voluntary, proposed,
planned, and arranged entirely by herself—women have been
capable of this—what should you say to it?"
"I cannot tell what I should say, for I cannot imagine myself in
such a situation. Your ladyship takes pleasure in arranging little
romances, but such circumstances are unlikely to occur in real life."
"And why? what do you suppose is the reason why, in this prosaic
world, we are governed only by titles—empty sounds, not to be
compared to the sterling merits of virtue and learning? Mr. Howard, I
prefer a man of sense, learning, and modesty to all the coxcombs
who ever wore a coronet or paraded a title."
"Your ladyship is quite right," replied he, beginning to get a little
uncomfortable at the looks of his companion, and rather anxious to
put a stop to the conference.
"And if that man were too modest to be sensible of the
preference, if he could not venture, on his own account, to break
through the barriers which difference of station had placed between
us, should he be shocked if, despising etiquette, and throwing aside
the restraints of pride and reserve, I were to venture to express
those feelings in all their native warmth and openness?"
He was silent, and Lady Osborne continued for some moments in
profound thought likewise, looking down at the carpet and playing
with her rings: at length she raised her head, and said,
"I think you understand my meaning, Mr. Howard. Of the nature of
my feelings I am sure you must have been long aware. Do you not
see to what this conversation tends?"
He appeared excessively embarrassed, and could not, for some
minutes, arrange his ideas sufficiently to know what to say. At length
he stammered out—
"Your ladyship does me too much honour, if I rightly understand
your meaning—but perhaps—I should be sorry to misinterpret it—
and really you must excuse me—perhaps I had better withdraw."
"No, Mr. Howard, do not go with a half explanation which can only
lead to mistakes. Tell me what you really suppose I meant; why
should you hesitate to express—"
"Seriously," replied he, trying to smile,
"I for a moment imagined that your ladyship meant to apply to me
what you had just been saying, and I feared you were going to tell
me of some friend who would make the sacrifices you so eloquently
described. Sacrifices which I felt would be far beyond my deserts."
"And supposing I did say so—supposing there were a woman of
rank and wealth, and influence, who would devote them all to you—
what would you say?"
"I would say, that though excessively obliged to her, my love was
not to be the purchase of either wealth or influence."
"I know you are entitled to hold worldly advantages as cheap as
any one; but remember, my dear friend, all the worth of such a
sacrifice—think of the warmth of an affection which could trample on
ceremony and brave opinion. And think on the consequences which
might accrue to you from this. Even you may well pause, before
preferring mediocrity to opulence, and obscurity to rank and
eminence.
"These advantages would not greatly weigh with me were they
attainable—but you forget my profession forbids ambition, and
removes the means of advancement."
—"No, you forget the gradations which exist in that career—do
you treat as nothing the certainty of promotion—of rising to be a
dignitary of the church—a dean—a bishop, perhaps—becoming at
once a member of the Upper House? Has ambition no charms—no
hold upon your mind?"
"My ambition would never prompt me to wish to rise through my
wife—I could not submit to that."
"Hard-hearted, cruel man!—and has love, ardent love, no charms
for you?—it is true I cannot offer you the first bloom of youth, but
have I no traces of former beauty—no charm which can influence
you or soften your heart—has not the uncontrollable though
melancholy love which actuates me—has that no power over your
affections?"
She paused, and Mr. Howard hesitated a moment how to answer,
then firmly but respectfully replied,
"If I understand your ladyship aright, and I think I cannot now
misunderstand, you pay me the highest compliment, but one which
is quite undeserved by me. Highly as I feel honoured, however, I
cannot change my feelings, or alter the sentiments which I have
already expressed. My mind was made known to you, before yours
was to me, and to vary now from what I then said might well cause
you to doubt my sincerity, and could give no satisfaction to your
ladyship."
He stopped abruptly; he wanted to say something indicative of
gratitude and respect; but the disgust which he felt at her
proceedings, prevented the words coming naturally. She, the mother
of a married daughter and a grown up son, to be making proposals
to a man so much her junior in age, and in every way unsuited for
her—really, he could not command the expressions which, perhaps,
politeness and a sense of the compliment paid him required. He rose
and appeared about to leave her, but she rose likewise, and said
with a look which betrayed indignation struggling with other
feelings:
"No, do not leave me thus—reflect before you thus madly throw
away the advantages I offer you—consider the enmity you provoke—
calculate the depth of my wrath and the extent of my power. Refuse
me, and there is no effort to injure you which I will not practise to
revenge myself—you shall bitterly rue this day, if you affront me
thus!"
"I cannot vary from my answer; your ladyship may excite my
gratitude by your kindness but neither my love nor my fears are to
be raised by promises or menaces. On this subject I must be,
apparently, ungrateful; but when the temporary delusion which now
influences you has passed away, you will, doubtless, rejoice that I
am firm to-day. I must leave you."
"Leave me, then; and let me never see that insidious face again,
ungrateful monster; to throw my benefits from you—to reject my
advances. Is my condescension to be thus rewarded? But I debase
myself by talking to you—leave me—begone!—and take only my
enmity with you as your portion."
The lady seemed struggling with vehement emotions, which
almost choked her; and knowing she was occasionally attacked with
dangerous fits, Mr. Howard hesitated about leaving her alone. By a
gesture of her hand, however, she repulsed his offer to approach
her; he therefore, slowly withdrew, and his mind was relieved of
anxiety for her by seeing her maid enter the room before he had
descended the stairs. He then hurried away, and tried, by walking
very quickly through the most retired paths in Kensington Gardens,
to soothe his feelings and tranquillize his mind.
Had there been no Emma Watson in the world, or had she been,
as he feared she would soon be, married to Lord Osborne, he must
still have refused the proposal which had just been made to him. It
never could have presented itself as a temptation to his mind. But
under present circumstances, with a heart full of her memory, all the
more precious, the more dwelt on, because he feared she would
never be more to him, it was more than impossible, it was entirely
repulsive. If he must love her in vain, as he told himself he should,
that was no reason he should marry another; and if she were to
become Lady Osborne as he feared, her mother-in-law would be the
last person he would be tempted to accept. Step-father to her
husband—oh, impossible! rather would he remove a thousand miles
than voluntarily bring himself into contact with that charming girl in
that relationship. If he could not have her, he would remain single
for her and for his sister's sake, and his nephew should hold the
place of son to him. These were his resolutions, and a further
determination to avoid all intercourse at present with the dowager
was the only other idea which could find any resting place in his
troubled brain. He returned the next day to his Vicarage, and there,
with his sister, his garden and his parochial duties, he sought alike to
forget the pleasures and the pains of the past.
CHAPTER VI.

A month of tranquillity and peace of mind, passed in the society of


Miss Bridge, was sufficient to restore Emma Watson to all her former
health and more than her former beauty. When Lady Gordon wrote
to remind her of the promised visit, she was almost sorry to go. Yet
her heart would flutter a little at the notion of again visiting Osborne
Castle—of being again in the vicinity of Mr. Howard, of seeing,
hearing, meeting him again. It was very foolish to care so much
about it—extremely so when he had so completely shown his own
indifference, and yet she could not help feeling a good deal at the
idea of meeting.
She called it curiosity to see how he was looking, when she
admitted that thoughts of him had anything to do with it; but more
often she persisted that it was affection for Lady Gordon, or a wish
to see her old neighbourhood, or to visit Osborne Castle in the
summer. In short, she found a hundred surprisingly good reasons
why she should wish to go to Osborne Castle, any one of which
would have been sufficient had it only been true, but as they were
mostly imaginary, she never felt quite deceived about them in her
own mind. This was provoking, as she would have liked, had she
been able, to convince herself that she no longer took any interest in
Mr. Howard. She had, however, a right to remember his sister with
regard, and she readily owned to herself that she should be
extremely glad to renew her acquaintance with Mrs. Willis. She
hoped to see Margaret again, and judge of the comparative
happiness of her married life. Yet she looked back with regret to the
four past weeks and reckoned them as some of the happiest she had
ever known. Elizabeth had spent part of the time with her, and she
had enjoyed herself so very much.
The more she had known of Miss Bridge, the better she had liked
her, and the parting was accompanied with mutual regrets and
hopes of meeting again.
It was June when she returned to Osborne Castle—June with its
deep blue skies—its sunny days—its delicious twilight; June with its
garlands of roses scenting the air, and its odoriferous hay-fields. The
weather was such as any lover of nature must revel in—delicious
summer weather—fit for strolling in the shade or sitting under trees,
making believe to read, whilst you were really watching the birds
flitting among the bushes, or the bees humming in the flowers—
weather for enjoying life in perfect listlessness and idleness—when
scarcely any occupation could be followed up beyond arranging a
bouquet or reading a novel. So thought and so declared the young
bride when her husband pressed her to engage in any serious
pursuit; she enjoyed the pleasure of teasing him by her refusals
perhaps rather more than she ought to have done, but she never
teased him very far now; she knew what he would bear, and
ventured not to go beyond it.
"I am glad Emma Watson is coming today," said she, as she threw
herself on a seat in the flower-garden; "you will have something else
to look at then besides me, and I shall quite enjoy the change."
"Are you sure of that, Rosa?" said he doubtfully.
"Why you have not the impertinence to suppose that I value your
incessant attentions," said she; "can you not imagine how tired I am
of being the sole object of your love. Emma Watson shall listen to
the grave books you so much love, shall talk of history or painting
with you, shall sit as your model, and leave me in my beloved
indolence."
"May I enquire if you suppose you are teasing or pleasing me by
this arrangement, Rosa—is it to satisfy me or yourself?"
"Oh, don't ask troublesome questions; I hate investigations as to
meanings and motives—all I want is to be left alone, and not asked
to ride or walk when I had rather lie on a sofa in quiet."
"Shall I leave you now then, my dear little wife?" enquired he
smilingly, and offering to go as he spoke. "I have a letter to write
now, and you can stay here in solitude."
He returned to the Castle, she remained musing where he left her,
and thus it happened that when Emma was announced, she found
the young baronet alone in their morning sitting-room. He laid down
his pen and advanced to meet her with great cordiality, desiring a
message to be sent to summon his lady.
After expressing the pleasure it gave him to see her again, he
observed:
"Who would have thought, Miss Watson, when we last met, that I
should be receiving you in this castle; did you prognosticate such an
event?"
"Not precisely," replied Emma, "so far as concerned myself; but as
relating to Miss Osborne—I mean Lady Gordon—any one must have
foreseen it."
"I assure you, when such things are foreseen, Miss Watson, it
most frequently happens that they never come to pass. I have
repeatedly seen instances of this kind." He spoke with an arch smile,
and a faint idea passed through her mind that she was in his
thoughts at the moment; an idea which might, perhaps, have
embarrassed her more had it not been swallowed up—annihilated
entirely by a more powerful sensation, as the door opened and Lady
Gordon entered with Mr. Howard.
It was fortunate that the enquiries of the former—her expressions
of pleasure, and her caresses, were an excuse for Emma's not
immediately turning to the gentleman—had they been obliged to
speak at once, it is probable their dialogue would have been peculiar
—interesting but unconnected—as the man said of Johnson's
dictionary. As it was, they both had time to collect their thoughts—
and when they did turn, were able to go through their interview with
tolerable calmness; but Emma had the advantage—as ladies
frequently have where circumstances require a ready tact and
presence of mind. Indeed, they did not start on fair ground—since
she had only one set of sensations to contend with and conceal—he
had more—for, besides the emotion which the sight of her
occasioned him, he had the double evil of being convinced it was
contrary to the requisitions of honour, to feel any extraordinary
pleasure in her company. Had not Lord Osborne made him his
confidant relative to his attachment, or had Howard boldly owned to
his lordship at the time, that he entertained similar views, all would
have been right, and he might openly have expressed the interest
which he now was compelled carefully to smother. His address was
cold and formal—the very contrast to his feelings—and extremely ill
done likewise; Emma, chilled by the reception so different to what
she had ventured to expect, began to fear her own manners had
been too openly indicative of pleasure at the sight of him; and
determined to correct this error she almost immediately followed
Lady Gordon, who had sauntered towards the conservatory.
"Come here," said the young hostess, linking her arm in Emma's,
"let us leave the gentlemen to discuss the parish politics together.
Mr. Howard came on business, and Sir William dearly loves meddling
with it. Now, you must tell me all the news of Croydon. Have you no
scandal to enliven me?—with whom has the lawyer quarrelled? or to
whom has the apothecary been making love."
Emma colored and laughed a little. Lady Gordon smilingly watched
her.
"To you, I suppose, by your blushes, Miss Watson; well, that gives
me a higher idea of his taste, than I have been accustomed to form
of country-town doctors. How many lovers have you to boast of?
Beginning with Lord Osborne, and ending with this nameless son of
Esculapius?—tell me all.
"Indeed, I have no such honors to boast," replied Emma, "no one
has sought me, and probably no one ever will:" this was followed by
a little sigh.
"Nay, do not be so desponding—a little chill is nothing," cried Lady
Gordon, "but I am not going to pry into your secrets. This
conservatory has given us enough of trouble in that way already. By
the way, you will, of course, like to go over and call on your sister,
Mrs. Musgrove—when will it suit you?"
"To-morrow, if you please," replied Emma, gratefully; Lady Gordon
promised that the means of conveyance should be at her service,
and they proceeded to discuss other topics.
She insisted on detaining Mr. Howard to spend the afternoon and
to dine with them—pleading, as a reason, the absence of his sister,
who was away on a visit; and when this point was carried and
settled, she led them out into the flower garden again, and loitered
away the rest of the intervening time, amidst the perfume of
summer flowers, and the flickering lights and shadows of the
alcoves, and their gay creeping plants. It was the day and place for
love making; who could resist the fascinating influence of sweet
scents, sunshine, murmuring fountains and soft summer airs? Not
Mr. Howard, certainly! Gradually his frozen manner melted away—his
purposes of reserve were forgotten, and he became once more the
Mr. Howard of Emma's first acquaintance, pleasant and gay—
sensible and agreeable.
Lady Gordon left them several times together, whilst she occupied
herself with her flowers or her tame pheasants; and each successive
time of her absence, there was less check and constraint in his
manner; and when, at last, she totally disappeared, and they were
left without other witnesses in that delightful spot, than the silent
trees, or the trickling waters, his reserve had disappeared altogether,
and she could converse with him as in former times.
"Have you enjoyed your visit at Croydon, Miss Watson," enquired
he, presently.
She looked surprised at the question.
"Enjoyed it," she repeated—then, after a momentary hesitation
added, "I wonder you can apply such a term to circumstances
connected with so much that is—that must be most painful."
He was exceedingly vexed with himself for the question, and
attempted to make some excuse for the inadvertence.
"It is unnecessary." she replied, with a something almost of
bitterness in her tone, "I had no right to expect that the memory of
our misfortune would remain, when we ourselves were removed
from sight. I ought rather to apologise for answering your question
so uncivilly."
"No, no, indeed," cried he eagerly, "I cannot admit that—but
indeed, Miss Watson, you do me injustice, and the same to all your
former friends in that last speech. We cannot cease to regret the
misfortune—the Providential dispensation, which in removing your
excellent father from among us, robbed us likewise of you and your
sisters."
"My dear father," said Emma involuntarily, her eyes filling with
tears—she turned away her head.
"It was of course a terrible wound to you," said he softly, and
stepping up quite close to her, "but not one which you need despair
of time's healing; your good sense, your principles must assist you to
view the occurrence in its true light. It must not sadden your whole
life, or rob you of all pleasure."
"True—but there are other sorrows connected with it—" she
stopped abruptly, then went on again, "however I have no right to
complain. I have still some friends left—my loss of fortune has not
entailed the loss of all those whom I reckoned amongst my friends;
though an event of that kind is a good touch-stone for new and
untried friendships."
"Can you imagine," cried he eagerly, "that such a circumstance
can make the shadow of a difference to any one worth knowing. It
is, I own, too, too common—but surely you have not met with such
instances."
She shook her head and looked half reproachfully at him: in her
own heart, she had felt inclined to charge him with this feeling.
"I should have thought," continued he warmly, "you would have
said—at least you would have found it like the words of the old
song, that—

"Friends in all the old you meet,


And brothers in the young."

"I believe it is not usual," replied she trying to speak playfully, "to
attach much value to an old song—we may consider that as a
poetical fiction."
He looked very earnestly at her and said:
"You fancy friends have deserted you, owing to a change in your
prospects—do not—allow me to advise you—do not give way to such
feelings—they will not make you happy."
"They do not make me unhappy, I assure you," said she with
spirit; "the value I place on such fluctuating friendships is low
indeed."
"In one single instance, perhaps, it may be so—but you had better
not dwell on such ideas; they will create eventually a habit of mind
which must tend to produce secret irritation and uneasiness. The
allowing yourself to think it—much more expressing that thought can
do you no good, and each repetition deepens the impression!"
He spoke so gently, with such a low, earnest tone, she could not
resist or for a moment longer indulge her half-formed suspicions
relative to him and his sister. Whether he had guessed her feelings
she could not tell; his eyes were fixed on her with too much of
interest to allow her to attempt reading the whole of their meaning.
She never liked him so well as when thus, and with justice,
reproving her.
"I dare say you are right," said she meekly, "I will try to repress
such feelings—indeed I am ashamed I ever gave them utterance—
and here too, where I have been so very kindly welcomed!"
"And I am to imagine then," continued he, "that Croydon offers
few attractions to you—a country town is not usually agreeable
except to those who love gossip, of which I do not suspect you; but
you must have found some compensations."
"It was a great pleasure to look forward to Elizabeth being so
comfortably settled," replied Emma, "I like my future brother very
much, and am pleased with his family. I have no doubt of her
happiness—and the style of life will not be irksome to her—but I love
the country, and country pursuits, and was right glad to exchange
the noisy streets of Croydon for the delightful groves of Burton—its
meadows and green-lanes."
"You have not then been the whole time at Croydon?"
She explained—he had certainly been in a state of complete
darkness as to her movements lately; and she really felt a
momentary mortification that he should have been contented to
remain in such profound ignorance. Yet she also rejoiced that he had
never heard anything relative to the course of events which had
occasioned her so much pain at Croydon, and driven her from the
place. He knew nothing of Mr. Morgan.
How much longer they would have been content to loiter in that
pleasant flower-garden cannot now be known, but they were only
induced to leave it by the sound of the gong, which summoned them
to the Castle to prepare for dinner. The hour which they had thus
enjoyed had been one of the pleasantest to Emma which she could
recollect, and the witchery of it to Howard himself would have been
quite unrivalled, had his conscience been easy on reflection, with
regard to Lord Osborne's plans and hopes. He tormented himself
with the idea that it was unjust to his friend to take advantage of his
absence; yet a flattering hope dwelt in his heart, that she had shown
no reluctance to the interview; nay, if his wishes did not deceive and
mislead him, there was a glance in her averted eye, and a rich
mantling of colour over her cheek once or twice, which spoke
anything but aversion.
And if so—if he really had been so fortunate as to inspire her with
a partiality so delightful, was he not privileged—more than privileged
—bound in honour to her to prove himself deserving of such
feelings, and capable of appreciating them. This conviction gave him
a degree of confidence and animation quite different from the
manners he had exhibited when they had previously met at Osborne
Castle, and Emma found him as pleasant as in the earlier stage of
their acquaintance.
"Are you still partial to early walks, Miss Watson," enquired Sir
William in the course of the evening, "or is it only in frosty winter
mornings that you indulge in such a recreation."
"Ah, I had a very pleasant ramble that morning," said Emma, "at
least till the rain came and spoilt it all."
"A very mortifying way of concluding," said Sir William, laughing,
"for I came with the rain. I wish you had not put in that reservation."
"I am not so ungrateful as to include you and the rain in the same
condemnation," replied she, "you were of great assistance in my
distresses."
"But if you wish to indulge in the same amusement now, you will
have abundance of time, as Lady Gordon is by no means so
precipitate in her habits of rising and performing her morning
toilette, as to compel her guests to abridge their walks before
breakfast. Perhaps as a compliment to you, and by making very
great speed she may contrive to complete her labours in that way by
ten or eleven o'clock."
"Well, I do not pretend to deny it," said Lady Gordon, "I am
excessively indolent, and dearly love the pleasure of doing nothing.
But Sir William is always anxious to make me out much worse than I
am."
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!

ebookultra.com

You might also like