100% found this document useful (4 votes)
4K views

Hands-On Scikit-Learn For Machine Learning Applications: Data Science Fundamentals With Python David Paper 2024 Scribd Download

fundamentals

Uploaded by

tarziacotelo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
4K views

Hands-On Scikit-Learn For Machine Learning Applications: Data Science Fundamentals With Python David Paper 2024 Scribd Download

fundamentals

Uploaded by

tarziacotelo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

Hands-on Scikit-Learn for machine learning


applications: data science fundamentals with
Python David Paper

https://textbookfull.com/product/hands-on-scikit-
learn-for-machine-learning-applications-data-
science-fundamentals-with-python-david-paper/

Explore and download more textbook at https://textbookfull.com


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

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/

textbookfull.com

Hands On Machine Learning with Scikit Learn and TensorFlow


1st Edition Aurélien Géron

https://textbookfull.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-1st-edition-aurelien-geron/

textbookfull.com

Hands On Machine Learning with Scikit Learn and TensorFlow


Early Release 2nd Edition Aurélien Géron

https://textbookfull.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-early-release-2nd-edition-aurelien-geron/

textbookfull.com

Plant Names A Guide to Botanical Nomenclature 4th Edition


Roger Spencer Rob Cross

https://textbookfull.com/product/plant-names-a-guide-to-botanical-
nomenclature-4th-edition-roger-spencer-rob-cross/

textbookfull.com
Machine Learning with LightGBM and Python 2nd Edition
Andrich Van Wyk

https://textbookfull.com/product/machine-learning-with-lightgbm-and-
python-2nd-edition-andrich-van-wyk/

textbookfull.com

Arteriovenous and Cavernous Malformations Robert F.


Spetzler

https://textbookfull.com/product/arteriovenous-and-cavernous-
malformations-robert-f-spetzler/

textbookfull.com

Guide for Hindu Missionaries 1st Edition Siddhant Bhartee

https://textbookfull.com/product/guide-for-hindu-missionaries-1st-
edition-siddhant-bhartee/

textbookfull.com

Petroleum Industry Transformations Lessons from Norway and


Beyond Taran Thune

https://textbookfull.com/product/petroleum-industry-transformations-
lessons-from-norway-and-beyond-taran-thune/

textbookfull.com

The Routledge Companion to Media Sex and Sexuality 1st


Edition Clarissa Smith

https://textbookfull.com/product/the-routledge-companion-to-media-sex-
and-sexuality-1st-edition-clarissa-smith/

textbookfull.com
Dragons of Mount Rixa 02.0 - Dragon Loved 1st Edition
Riley Storm

https://textbookfull.com/product/dragons-of-mount-rixa-02-0-dragon-
loved-1st-edition-riley-storm/

textbookfull.com
David Paper

Hands-on Scikit-Learn for Machine


Learning Applications
Data Science Fundamentals with Python
David Paper
Logan, UT, USA

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​9781484253724 . For more
detailed information, please visit http://​www.​apress.​com/​source-code
.

ISBN 978-1-4842-5372-4 e-ISBN 978-1-4842-5373-1


https://doi.org/10.1007/978-1-4842-5373-1

© David Paper 2020

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather
than use a trademark symbol with every occurrence of a trademarked
name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark. The use in this publication
of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of
opinion as to whether or not they are subject to proprietary rights.

While the advice and information in this book are believed to be true
and accurate at the date of publication, neither the authors nor the
editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained
herein.

Distributed to the book trade worldwide by Springer Science+Business


Media New York, 233 Spring Street, 6th Floor, New York, NY 10013.
Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-
ny@springer-sbm.com, or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM
Finance Inc is a Delaware corporation.
For my mother, brothers, and friends.
Introduction
We apply the popular Scikit-Learn library to demonstrate machine
learning exercises with Python code to help readers solve machine
learning problems. The book is designed for those with intermediate
programming skills and some experience with machine learning
algorithms. We focus on application of the algorithms rather than
theory. So, readers should read about the theory online or from other
sources if appropriate. The reader should also be willing to spend a lot
of time working through the code examples because they are pretty
deep. But, the effort will pay off because the examples are intended to
help the reader tackle complex problems.
The book is organized into eight chapters. Chapter 1 introduces the
topic of machine learning, Anaconda, and Scikit-Learn. Chapters 2 and 3
introduce algorithmic classification. Chapter 2 classifies simple data
sets and Chapter 3 classifies complex ones. Chapter 4 introduces
predictive modeling with regression. Chapters 5 and 6 introduce
classification tuning. Chapter 5 tunes simple data sets and Chapter 6
tunes complex ones. Chapter 7 introduces predictive modeling
regression tuning. Chapter 8 puts all knowledge together to review and
present findings in a holistic manner.
Download this book’s example data by clicking the Download
source code button found on the book’s catalog page at
https://www.apress.com/us/book/9781484253724​.
Table of Contents
Chapter 1:​Introduction to Scikit-Learn
Machine Learning
Anaconda
Scikit-Learn
Data Sets
Characterize Data
Simple Classification Data
Complex Classification Data
Regression Data
Feature Scaling
Dimensionality Reduction
Chapter 2:​Classification from Simple Training Sets
Simple Data Sets
Classifying Wine Data
Classifying Digits
Classifying Bank Data
Classifying make_​moons
Chapter 3:​Classification from Complex Training Sets
Complex Data Sets
Classifying fetch_​20newsgroups
Classifying MNIST
Classifying fetch_​lfw_​people
Chapter 4:​Predictive Modeling Through Regression
Regression Data Sets
Regressing tips
Regressing boston
Regressing wine data
Chapter 5:​Scikit-Learn Classifier Tuning from Simple Training
Sets
Tuning Data Sets
Tuning Iris Data
Tuning Digits Data
Tuning Bank Data
Tuning Wine Data
Chapter 6:​Scikit-Learn Classifier Tuning from Complex Training
Sets
Tuning Data Sets
Tuning fetch_​1fw_​people
Tuning MNIST
Tuning fetch_​20newsgroups
Chapter 7:​Scikit-Learn Regression Tuning
Tuning Data Sets
Tuning tips
Tuning boston
Tuning wine
Chapter 8:​Putting It All Together
The Journey
Value and Cost
MNIST Value and Cost
Explaining MNIST to Money People
Explaining Output to Money People
Explaining the Confusion Matrix to Money People
Explaining Visualizations to Money People
Value and Cost
fetch_​lfw_​people Value and Cost
Explaining fetch_​lfw_​people to Money People
Explaining Output to Money People
Explaining Visualizations to Money People
Value and Cost
fetch_​20newsgroups Value and Cost
Explaining fetch_​20newsgroups to Money People
Explaining Output to Money People
Explaining the Confusion Matrix to Money People
Value and Cost
Index
About the Author and About the Technical
Reviewer

About the Author


David Paper
is a professor at Utah State University in
the Management Information Systems
department. He is the author of two
books –Web Programming for Business:
PHP Object-Oriented Programming with
Oracle andData Science Fundamentals for
Python and MongoDB . He has over
70 publications in refereed journals such
asOrganizational Research Methods
,Communications of the ACM, Information
& Management ,Information Resource
Management Journal ,Communications of
the AIS ,Journal of Information
Technology Case and Application
Research , andLong Range Planning . He
has also served on several editorial
boards in various capacities, including
associate editor. Besides growing up in family businesses, Dr. Paper has
worked for Texas Instruments, DLS, Inc., and the Phoenix Small
Business Administration. He has performed IS consulting work for IBM,
AT&T, Octel, Utah Department of Transportation, and the Space
Dynamics Laboratory. Dr. Paper’s teaching and research interests
include data science, machine learning, process reengineering, object-
oriented programming, and change management.

About the Technical Reviewer


Jojo Moolayil
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
is an artificial intelligence, deep learning,
machine learning, and decision science
professional and published author of
three books:Smarter Decisions – The
Intersection of Internet of Things and
Decision Science ,Learn Keras for Deep
Neural Networks , andApplied Supervised
Learning with R . He has worked with
industry leaders on several high-impact
and critical data science and machine
learning projects across multiple
verticals. He is currently associated with
Amazon Web Services as a research
scientist – AI.
Jojo was born and raised in Pune,
India, and graduated from the University
of Pune with a major in Information
Technology Engineering. He started his
career with Mu Sigma Inc., the world’s largest pure-play analytics
provider, and worked with the leaders of many Fortune 50 clients. He
later worked with Flutura – an IoT analytics start-up – and GE, the
pioneer and leader in Industrial AI.
He currently resides in Vancouver, BC. Apart from authoring books
on deep learning, decision science, and IoT, Jojo has also been a
technical reviewer for various books on the same subject with Apress
and Packt publications. He is an active Data Science tutor and maintains
a blog at http://blog.jojomoolayil.com .
Jojo’s personal web site: www.jojomoolayil.com
Business e-mail:mail@jojomoolayil.com
© David Paper 2020
D. Paper, Hands-on Scikit-Learn for Machine Learning Applications
https://doi.org/10.1007/978-1-4842-5373-1_1

1. Introduction to Scikit-Learn
David Paper1

(1) Logan, UT, USA

Scikit-Learn is a Python library that provides simple and efficient tools for implementing
supervised and unsupervised machine learning algorithms. The library is accessible to everyone
because it is open source and commercially usable. It is built on NumPY, SciPy, and matplolib
libraries, which means it is reliable, robust, and core to the Python language.
Scikit-Learn is focused on data modeling rather than data loading, cleansing, munging or
manipulating. It is also very easy to use and relatively clean of programming bugs.

Machine Learning
Machine learning is getting computers to program themselves. We use algorithms to make this
happen. An algorithm is a set of rules used to calculate or problem solve with a computer.
Machine learning advocates create, study, and apply algorithms to improve performance on
data-driven tasks. They use tools and technology to answer questions about data by training a
machine how to learn.
The goal is to build robust algorithms that can manipulate input data to predict an output
while continually updating outputs as new data becomes available. Any information or data sent
to a computer is considered input. Data produced by a computer is considered output.
In the machine learning community, input data is referred to as the feature set and output data
is referred to as the target. The feature set is also referred to as the feature space. Sample data is
typically referred to as training data. Once the algorithm is trained with sample data, it can make
predictions on new data. New data is typically referred to as test data.
Machine learning is divided into two main areas: supervised and unsupervised learning. Since
machine learning typically focuses on prediction based on known properties learned from
training data, our focus is on supervised learning.
Supervised learning is when the data set contains both inputs (or the feature set) and desired
outputs (or targets). That is, we know the properties of the data. The goal is to make predictions.
This ability to supervise algorithm training is a big part of why machine learning has become so
popular.
To classify or regress new data, we must train on data with known outcomes. We classify data
by organizing it into relevant categories. We regress data by finding the relationship between
feature set data and target data.
With unsupervised learning, the data set contains only inputs but no desired outputs (or
targets). The goal is to explore the data and find some structure or way to organize it. Although
not the focus of the book, we will explore a few unsupervised learning scenarios.

Anaconda
You can use any Python installation, but I recommend installing Python with Anaconda for several
reasons. First, it has over 15 million users. Second, Anaconda allows easy installation of the
desired version of Python. Third, it preinstalls many useful libraries for machine learning
including Scikit-Learn. Follow this link to see the Anaconda package lists for your operating
system and Python version: https://docs.anaconda.com/anaconda/packages/pkg-
docs/. Fourth, it includes several very popular editors including IDLE, Spyder, and Jupyter
Notebooks. Fifth, Anaconda is reliable and well-maintained and removes compatibility
bottlenecks.
You can easily download and install Anaconda with this link:
https://www.anaconda.com/download/. You can update with this link:
https://docs.anaconda.com/anaconda/install/update-version/. Just open
Anaconda and follow instructions. I recommend updating to the current version.

Scikit-Learn
Python’s Scikit-Learn is one of the most popular machine learning libraries. It is built on Python
libraries NumPy, SciPy, and Matplotlib. The library is well-documented, open source,
commercially usable, and a great vehicle to get started with machine learning. It is also very
reliable and well-maintained, and its vast collection of algorithms can be easily incorporated into
your projects. Scikit-Learn is focused on modeling data rather than loading, manipulating,
visualizing, and summarizing data. For such activities, other libraries such as NumPy, pandas,
Matplotlib, and seaborn are covered as encountered. The Scikit-Learn library is imported into a
Python script as sklearn.

Data Sets
A great way to understand machine learning application is by working through Python data-
driven code examples. We use either Scikit-Learn, UCI Machine Learning, or seaborn data sets for
all examples. The Scikit-Learn data sets package embeds some small data sets for getting started
and helpers to fetch larger data sets commonly used in the machine learning library to benchmark
algorithms on data from the world at large. The UCI Machine Learning Repository maintains 468
data sets to serve the machine learning community. Seaborn provides an API on top of Matplotlib
that offers simplicity when working with plot styles, color defaults, and high-level functions for
common statistical plot types that facilitate visualization. It also integrates nicely with Pandas
DataFrame functionality.
We chose the data sets for our examples because the machine learning community uses them
for learning, exploring, benchmarking, and validating, so we can compare our results to others
while learning how to apply machine learning algorithms.
Our data sets are categorized as either classification or regression data. Classification data
complexity ranges from simple to relatively complex. Simple classification data sets include
load_iris, load_wine, bank.csv, and load_digits. Complex classification data sets include
fetch_20newsgroups, MNIST, and fetch_1fw_people. Regression data sets include tips, redwine.csv,
whitewine.csv, and load_boston.

Characterize Data
Before working with algorithms, it is best to understand the data characterization. Each data set
was carefully chosen to help you gain experience with the most common aspects of machine
learning. We begin by describing the characteristics of each data set to better understand its
composition and purpose. Data sets are organized by classification and regression data.
Classification data is further organized by complexity. That is, we begin with simple
classification data sets that are not complex so that the reader can focus on the machine learning
content rather than on the data. We then move onto more complex data sets.

Simple Classification Data


Classification is a machine learning technique for predicting the class upon which a dependent
variable belongs. A class is a discrete response. In machine learning, a dependent variable is
typically referred to as the target. A class is predicted based upon the independent variables of a
data set. Independent variables are typically referred to as the feature set or feature space. Feature
space is the collection of features used to characterize the data.
Simple data sets are those with a limited number of features. Such a data set is referred to as
one with a low-dimensional feature space.

Iris Data
The first data set we characterize is load_iris, which consists of Iris flower data. Iris is a
multivariate data set consisting of 50 samples from each of three species of iris (Iris setosa, Iris
virginica, and Iris versicolor). Each sample contains four features, namely, length and width of
sepals and petals in centimeters. Iris is a typical test case for machine learning classification. It is
also one of the best known data sets in the data science literature, which means you can test your
results against many other verifiable examples.
The first code example shown in Listing 1-1 loads Iris data, displays its keys, shape of the
feature set and target, feature and target names, a slice from the DESCR key, and feature
importance (from most to least).

from sklearn import datasets


from sklearn.ensemble import RandomForestClassifier

if __name__ == "__main__":
br = '\n'
iris = datasets.load_iris()
keys = iris.keys()
print (keys, br)
X = iris.data
y = iris.target
print ('features shape:', X.shape)
print ('target shape:', y.shape, br)
features = iris.feature_names
targets = iris.target_names
print ('feature set:')
print (features, br)
print ('targets:')
print (targets, br)
print (iris.DESCR[525:900], br)
rnd_clf = RandomForestClassifier(random_state=0,
n_estimators=100)
rnd_clf.fit(X, y)
rnd_name = rnd_clf.__class__.__name__
feature_importances = rnd_clf.feature_importances_
importance = sorted(zip(feature_importances, features),
reverse=True)
print ('most important features' + ' (' + rnd_name + '):')
[print (row) for i, row in enumerate(importance)]
Listing 1-1 Characterize the Iris data set
Go ahead and execute the code from Listing 1-1. Remember that you can find the example
from the book’s example download. You don’t need to type the example by hand. It’s easier to
access the example download and copy/paste.
Your output from executing Listing 1-1 should resemble the following:

dict_keys(['data', 'target', 'target_names', 'DESCR',


'feature_names', 'filename'])

features shape: (150, 4)


target shape: (150,)

feature set:
['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal
width (cm)']

targets:
['setosa' 'versicolor' 'virginica']

============== ==== ==== ======= ===== ====================


Min Max Mean SD Class Correlation
============== ==== ==== ======= ===== ====================
sepal length: 4.3 7.9 5.84 0.83 0.7826
sepal width: 2.0 4.4 3.05 0.43 -0.4194
petal length: 1.0 6.9 3.76 1.76 0.9490 (high!)
petal width:

most important features (RandomForestClassifier):


(0.4604447396171521, 'petal length (cm)')
(0.4241162651271012, 'petal width (cm)')
(0.09090795402103086, 'sepal length (cm)')
(0.024531041234715754, 'sepal width (cm)')

The code begins by importing datasets and RandomForestClassifier packages.


RandomForestClassifier is an ensemble learning method that constructs a multitude of decision
trees at training time and outputs the class that is the mode of the classes.
In this example, we are only using it to return feature importance. The main block begins by
loading data and displaying its characteristics. Loading feature set data into variable X and target
data into variable y is convention in the machine learning community.
The code concludes by training RandomForestClassifier on the pandas data, so it can return
feature importance. When actually modeling data, we convert pandas data to NumPy for optimum
performance. Keep in mind that the keys are available because the data set is embedded in Scikit-
Learn.
Notice that we only took a small slice from DESCR, which holds a lot of information about the
data set. I always recommend displaying at least the shape of the original data set before
embarking on any machine learning experiment.

Tip RandomForestClassifier is a powerful machine learning algorithm that not only models
training data, but returns feature importance.

Wine Data
The next data set we characterize is load_wine. The load_wine data set consists of 178 data
elements. Each element has thirteen features that describe three target classes. It is considered a
classic in the machine learning community and offers an easy multi-classification data set.
The next code example shown in Listing 1-2 loads wine data and displays its keys, shape of the
feature set and target, feature and target names, a slice from the DESCR key, and feature
importance (from most to least).

from sklearn.datasets import load_wine


from sklearn.ensemble import RandomForestClassifier

if __name__ == "__main__":
br = '\n'
data = load_wine()
keys = data.keys()
print (keys, br)
X, y = data.data, data.target
print ('features:', X.shape)
print ('targets', y.shape, br)
print (X[0], br)
features = data.feature_names
targets = data.target_names
print ('feature set:')
print (features, br)
print ('targets:')
print (targets, br)
rnd_clf = RandomForestClassifier(random_state=0,
n_estimators=100)
rnd_clf.fit(X, y)
rnd_name = rnd_clf.__class__.__name__
feature_importances = rnd_clf.feature_importances_
importance = sorted(zip(feature_importances, features),
reverse=True)
n = 6
print (n, 'most important features' + ' (' + rnd_name + '):')
[print (row) for i, row in enumerate(importance) if i < n]
Listing 1-2 Characterize load_wine

After executing code from Listing 1-2, your output should resemble the following:

dict_keys(['data', 'target', 'target_names', 'DESCR',


'feature_names'])

features: (178, 13)


targets (178,)

[1.423e+01 1.710e+00 2.430e+00 1.560e+01 1.270e+02 2.800e+00


3.060e+00
2.800e-01 2.290e+00 5.640e+00 1.040e+00 3.920e+00 1.065e+03]

feature set:
['alcohol', 'malic_acid', 'ash', 'alcalinity_of_ash', 'magnesium',
'total_phenols', 'flavanoids', 'nonflavanoid_phenols',
'proanthocyanins', 'color_intensity', 'hue',
'od280/od315_of_diluted_wines', 'proline']

targets:
['class_0' 'class_1' 'class_2']

6 most important features (RandomForestClassifier):


(0.19399882779940295, 'proline')
(0.16095401215681593, 'flavanoids')
(0.1452667364559143, 'color_intensity')
(0.11070045042456281, 'alcohol')
(0.1097465262717493, 'od280/od315_of_diluted_wines')
(0.08968972021098301, 'hue')

Tip To create (instantiate) a machine learning algorithm (model), just assign it to a variable
(e.g., model = algorithm()). To train based on the model, just fit it to the data (e.g., model.fit(X,
y)).

The code begins by importing load_wine and RandomForestClassifier. The main block displays
keys, loads data into X and y, displays the first vector from feature set X, displays shapes, and
displays feature set and target information. The code concludes by training X with
RandomForestClassifier, so we can display the six most important features. Notice that we display
the first vector from feature set X to verify that all features are numeric.

Bank Data
The next code example shown in Listing 1-3 works with bank data. The bank.csv data set is
composed of direct marketing campaigns from a Portuguese banking institution. The target is
described by whether a client will subscribe (yes/no) to a term deposit (target label y). It consists
of 41188 data elements with 20 features for each element. A 10% random sample of 4119 data
elements is also available from this site for more computationally expensive algorithms such as
svm and KNeighborsClassifier.

import pandas as pd

if __name__ == "__main__":
br = '\n'
f = 'data/bank.csv'
bank = pd.read_csv(f)
features = list(bank)
print (features, br)
X = bank.drop(['y'], axis=1).values
y = bank['y'].values
print (X.shape, y.shape, br)
print (bank[['job', 'education', 'age', 'housing',
'marital', 'duration']].head())
Listing 1-3 Characterize bank data
After executing code from Listing 1-3, your output should resemble the following:

['age', 'job', 'marital', 'education', 'default', 'housing', 'loan',


'contact', 'month', 'day_of_week', 'duration', 'campaign', 'pdays',
'previous', 'poutcome', 'emp.var.rate', 'cons.price.idx',
'cons.conf.idx', 'euribor3m', 'nr.employed', 'y']

(41188, 20) (41188,)

job education age housing marital duration


0 housemaid basic.4y 56 no married 261
1 services high.school 57 no married 149
2 services high.school 37 yes married 226
3 admin. basic.6y 40 no married 151
4 services high.school 56 no married 307

The code example begins by importing the pandas package. The main block loads bank data
from a CSV file into a Pandas DataFrame and displays the column names (or features). To retrieve
column names from pandas, all we need to do is make the DataFrame a list and assign the result
to a variable. Next, feature set X and target y are created. Finally, X and y shapes are displayed as
well as a few choice features.

Digits Data
The final code example in this subsection is load_digits. The load_digits data set consists of 1797 8
× 8 handwritten images. Each image is represented by 64 pixels (based on an 8 × 8 matrix), which
make up the feature set. Ten targets are predicted represented by digits zero to nine.
Listing 1-4 contains the code that characterizes load_digits.

import numpy as np
from sklearn.datasets import load_digits
import matplotlib.pyplot as plt

if __name__ == "__main__":
br = '\n'
digits = load_digits()
print (digits.keys(), br)
print ('2D shape of digits data:', digits.images.shape, br)
X = digits.data
y = digits.target
print ('X shape (8x8 flattened to 64 pixels):', end=' ')
print (X.shape)
print ('y shape:', end=' ')
print (y.shape, br)
i = 500
print ('vector (flattened matrix) of "feature" image:')
print (X[i], br)
print ('matrix (transformed vector) of a "feature" image:')
X_i = np.array(X[i]).reshape(8, 8)
print (X_i, br)
print ('target:', y[i], br)
print ('original "digits" image matrix:')
print (digits.images[i])
plt.figure(1, figsize=(3, 3))
plt.title('reshaped flattened vector')
plt.imshow(X_i, cmap="gray", interpolation="gaussian")
plt.figure(2, figsize=(3, 3))
plt.title('original images dataset')
plt.imshow(digits.images[i], cmap="gray",
interpolation='gaussian')
plt.show()
Listing 1-4 Characterize load_digits
After executing code from Listing 1-4, your output should resemble the following:

dict_keys(['data', 'target', 'target_names', 'images', 'DESCR'])

2D shape of digits data: (1797, 8, 8)

X shape (8x8 flattened to 64 pixels): (1797, 64)


y shape: (1797,)

vector (flattened matrix) of "feature" image:


[ 0. 0. 3. 10. 14. 3. 0. 0. 0. 8. 16. 11. 10.
13. 0. 0. 0. 7.
14. 0. 1. 15. 2. 0. 0. 2. 16. 9. 16. 16. 1. 0. 0. 0. 12.
16.
15. 15. 2. 0. 0. 0. 12. 10. 0. 8. 8. 0. 0. 0. 9.
12. 4. 7.
12. 0. 0. 0. 2. 11. 16. 16. 9. 0.]

matrix (transformed vector) of a "feature" image:


[[ 0. 0. 3. 10. 14. 3. 0. 0.]
[ 0. 8. 16. 11. 10. 13. 0. 0.]
[ 0. 7. 14. 0. 1. 15. 2. 0.]
[ 0. 2. 16. 9. 16. 16. 1. 0.]
[ 0. 0. 12. 16. 15. 15. 2. 0.]
[ 0. 0. 12. 10. 0. 8. 8. 0.]
[ 0. 0. 9. 12. 4. 7. 12. 0.]
[ 0. 0. 2. 11. 16. 16. 9. 0.]]

target: 8

original "digits" image matrix:


[[ 0. 0. 3. 10. 14. 3. 0. 0.]
[ 0. 8. 16. 11. 10. 13. 0. 0.]
[ 0. 7. 14. 0. 1. 15. 2. 0.]
[ 0. 2. 16. 9. 16. 16. 1. 0.]
[ 0. 0. 12. 16. 15. 15. 2. 0.]
[ 0. 0. 12. 10. 0. 8. 8. 0.]
[ 0. 0. 9. 12. 4. 7. 12. 0.]
[ 0. 0. 2. 11. 16. 16. 9. 0.]]
Listing 1-4 also displays Figures 1-1 and 1-2. Figure 1-1 is a reshaped flattened vector of the
500th image in the data set. Each data element in feature set X is represented as a flattened vector
of 64 pixels because Scikit-Learn cannot recognize an 8 × 8 image matrix, so we must reshape the
500th vector to an 8 × 8 image matrix to visualize. Figure 1-2 is the 500th image taken directly
from the images data set that is available when we load the data into variable digits.

Figure 1-1 Reshaped flattened vector of the 500th data element

Figure 1-2 Original image matrix of the 500th data element

The code begins by importing numpy, load_digits, and matplotlib packages. The main block
places load_digits into the digits variable and displays its keys: data, target, target_names, images,
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
and DESCR. It continues by displaying the two-dimensional (2D) shape of images contained in
images. Data in images are represented by 1797 8 × 8 matrices. Next, feature data (represented as
vectors) are placed in X and target data in y.
A feature vector is one that contains information about an object’s important characteristics.
Data in data are represented by 1797 64-pixel feature vectors. A simple feature representation of
an image is the raw intensity value of each pixel. So, an 8 × 8 image is represented by 64 pixels.
Machine learning algorithms process feature data as vectors, so each element in data must be a
one-dimensional (1D) vector representation of its 2D image matrix.

Tip Feature data must be composed of vectors to work with machine learning algorithm.

The code continues by displaying the feature vector of the 500th image. Next, the 500th feature
vector is transformed from its flattened 1D vector shape into a 2D image matrix and displayed
with the NumPy reshape function. The code continues by displaying the target value y of the
500th image. Next, the 500th image matrix is displayed by referencing images.
The reason we transformed the image from its 1D flattened vector state to the 2D image
matrix is that most data sets don’t include an images object like load_data. So, to visualize and
process data with machine learning algorithms, we must be able to manually flatten images and
transform flattened images back to their original 2D matrix shape.
The code concludes by visualizing the 500th image in two ways. First, we use the flattened
vector X_i. Second, we reference images. While machine learning algorithms require feature
vectors, function imshow requires 2D image matrices to visualize.

Complex Classification Data


Now let’s work with more complex data sets. Complex data sets are those with a very high
number of features. Such a data set is referred to as one with a high-dimensional feature space.

Newsgroup Data
The first data set we characterize is fetch_20newsgroups, which consists of approximately 18000
posts on 20 topics. Data is split into train-test subsets. The split is based on messages posted
before and after a specific date.
Listing 1-5 contains the code that characterizes fetch_20newsgroups.

from sklearn.datasets import fetch_20newsgroups

if __name__ == "__main__":
br = '\n'
train = fetch_20newsgroups(subset='train')
test = fetch_20newsgroups(subset='test')
print ('data:')
print (train.target.shape, 'shape of train data')
print (test.target.shape, 'shape of test data', br)
targets = test.target_names
print (targets, br)
categories = ['rec.autos', 'rec.motorcycles', 'sci.space',
'sci.med']
train = fetch_20newsgroups(subset='train',
categories=categories)
test = fetch_20newsgroups(subset='test',
categories=categories)
print ('data subset:')
print (train.target.shape, 'shape of train data')
print (test.target.shape, 'shape of test data', br)
targets = train.target_names
print (targets)
Listing 1-5 Characterize fetch_20newsgroups
After executing code from Listing 1-5, your output should resemble the following:

data:
(11314,) shape of train data
(7532,) shape of test data

['alt.atheism', 'comp.graphics', 'comp.os.ms-windows.misc',


'comp.sys.ibm.pc.hardware', 'comp.sys.mac.hardware',
'comp.windows.x', 'misc.forsale', 'rec.autos', 'rec.motorcycles',
'rec.sport.baseball', 'rec.sport.hockey', 'sci.crypt',
'sci.electronics', 'sci.med', 'sci.space', 'soc.religion.christian',
'talk.politics.guns', 'talk.politics.mideast', 'talk.politics.misc',
'talk.religion.misc']

data subset:
(2379,) shape of train data
(1584,) shape of test data

['rec.autos', 'rec.motorcycles', 'sci.med', 'sci.space']

The code begins by importing fetch_20newsgroups. The main block begins by loading train
and test data and displaying their shapes. Training data consists of 11314 postings, while test
data consists of 7532 postings. The code continues by displaying target names and categories.
Next, train and test data are created from a subset of categories. The code concludes by displaying
shapes and target names of the subset.

MNIST Data
The next data set we characterize is MNIST. MNIST (Modified National Institute of Standards and
Technology) is a large database of handwritten digits commonly used for training and testing in
the machine learning community and other industrial image processing applications. MNIST
contains 70000 examples of handwritten digit images labeled from 0 to 9 of size 28 × 28. Each
target (or label) is stored as a digit value. The feature set is a matrix of 70000 28 × 28 images
automatically flattened to 784 pixels each. So, each of the 70000 data elements is a vector of
length 784. The target set is a vector of 70000 digit values.
Listing 1-6 contains the code that characterizes MNIST.

import numpy as np
from random import randint
import matplotlib.pyplot as plt

def find_image(data, labels, d):


for i, row in enumerate(labels):
if d == row:
target = row
X_pixels = np.array(data[i])
return (target, X_pixels)

if __name__ == "__main__":
br = '\n'
X = np.load('data/X_mnist.npy')
y = np.load('data/y_mnist.npy')
target = np.load('data/mnist_targets.npy')
print ('labels (targets):')
print (target, br)
print ('feature set shape:')
print (X.shape, br)
print ('target set shape:')
print (y.shape, br)
indx = randint(0, y.shape[0]-1)
target = y[indx]
X_pixels = np.array(X[indx])
print ('the feature image consists of', len(X_pixels),
'pixels')
X_image = X_pixels.reshape(28, 28)
plt.figure(1, figsize=(3, 3))
title = 'image @ indx ' + str(indx) + ' is digit ' \
+ str(int(target))
plt.title(title)
plt.imshow(X_image, cmap="gray")
digit = 7
target, X_pixels = find_image(X, y, digit)
X_image = X_pixels.reshape(28, 28)
plt.figure(2, figsize=(3, 3))
title = 'find first ' + str(int(target)) + ' in dataset'
plt.title(title)
plt.imshow(X_image, cmap="gray")
plt.show()
Listing 1-6 Characterize MNIST
After executing code from Listing 1-6, your output should resemble the following:

labels (targets):
[0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]

feature set shape:


(70000, 784)

target set shape:


(70000,)

the feature image consists of 784 pixels

Listing 1-6 also displays Figures 1-3 and 1-4. Figure 1-3 is the reshaped image of digit 1 at
index 6969. Figure 1-4 is the first image of digit 7 in the data set.
Figure 1-3 Reshaped flattened vector of image at index 6969

Figure 1-4 Image of first digit 7 in the data set


The code begins by importing randint and other requisite packages. Function find_image
locates the first occurrence of an image. The main block loads data from NumPy files into feature
set X, target y, and target. Variable target holds target labels. It continues by displaying the shape
of X and y. Feature set X consists of 70000 784-pixel vectors, so each image consists of 28 × 28
pixels.
Target y consists of 70000 labels. Next, a random integer between 0 and 69999 is generated,
so we can display a random image from the data set. The random integer in our case is 6969. The
image at index 6969 is digit 1. The size of the image is displayed to verify that it is 784 pixels. We
then reshape vector 6969 to a 28 × 28 matrix, so we can visualize with function imshow. The code
concludes by finding the first digit 7 and displaying it.
Faces Data
The final data set characterized in this subsection is fetch_1fw_people. The fetch_1fw_people data
set is used for classifying labeled faces. It contains 1288 face images and seven targets. Each
image is represented by a 50 × 37 matrix of pixels, so the feature set has 1850 features (based on
a 50 × 37 matrix). In all, the data consists of 1288 labeled faces composed of 1850 pixels each
predicting seven targets.
Listing 1-7 contains the code that characterizes fetch_1fw_people.

import numpy as np
import matplotlib.pyplot as plt

if __name__ == "__main__":
br = '\n'
X = np.load('data/X_faces.npy')
y = np.load('data/y_faces.npy')
targets = np.load('data/faces_targets.npy')
print ('shape of feature and target data:')
print (X.shape)
print (y.shape, br)
print ('target faces:')
print (targets)
X_i = np.array(X[0]).reshape(50, 37)
image_name = targets[y[0]]
fig, ax = plt.subplots()
image = ax.imshow(X_i, cmap="bone")
plt.title(image_name)
plt.show()
Listing 1-7 Characterize fetch_1fw_people

After executing code from Listing 1-7, your output should resemble the following:

shape of feature and target data:


(1288, 1850)
(1288,)

target faces:
['Ariel Sharon' 'Colin Powell' 'Donald Rumsfeld' 'George W Bush'
'Gerhard Schroeder' 'Hugo Chavez' 'Tony Blair']

Listing 1-7 also displays Figure 1-5. Figure 1-5 is the reshaped image of the first data element
in the data set.
Random documents with unrelated
content Scribd suggests to you:
“Bah Jove!” remarked our young friend, eying him with haughty
scorn that made a hilarious contrast with his outlandish green
August overcoat. “Bah Jove, don’t be so peremptory, so rude, ye
know!”
“W—why!” gasped the amazed policeman.
“I want to know, don’t ye know,” said Chauncey, “if I can send a
telegram, bah Jove?”
“Yes,” growled the other. “That is, if you’ve got any money.”
Chauncey pulled out his “roll,” which had been missed when they
searched him, and tossed a five-dollar bill carelessly to the man.
“Take that,” said he. “Bah Jove, I don’t want it, ye know. Come now,
write what I tell you.”
The man took the bill in a hurry and drew out a pencil and
notebook, while Chauncey’s two fellow-prisoners stared anxiously.
Chauncey dictated with studied scorn and indifference.
“Am—arrested,” said he, “for—burglary—ye—know.”
The policeman wrote the “ye know,” obediently, though he gasped in
amazement and muttered “lunatic.”
“Under—name—of—Peter—Smith— —— Street—station. Come—
instantly Chauncey.”
“Who shall I send it to?” inquired the “stenographer.”
“Let me see,” Chauncey mused. “Bah Jove, not to fawther, ye know.
They’d see the name, ruin the family reputation. A deuced mess! Oh
yes, bah Jove, I’ll have all me uncles, ye know! Ready there? First,
Mr. Perry Bellwood, —— Fifth Avenue——”
“What!” gasped the officer.
“Write what I say,” commanded Chauncey, sternly; “and no
comments! Second, Mr. W. K. Vanderpool, —— Fifth Avenue. Third—
bah Jove—Mr. W. C. Stickhey, —— Fifth Avenue. Fourth——”
“How many do you want?” expostulated the other.
“Silence!” roared the “dude.” “Do as I say! I take no chances. Fourth,
Mr. Bradley-Marvin, —— Fifth Avenue. And that’ll do, I guess, ye
know. Run for your life, then, deuce take it, and I’ll give you another
five if they get here in a hawf hour, bah Jove.”
There was probably no more amazed policeman on the metropolitan
force than that one. But he hustled according to orders none the
less. Certainly there was no more satisfied plebe in the whole
academy class than Mr. Chauncey Van Rensselaer Mount-Bonsall of
New York. “It’s all right now, bah Jove,” said he. “They’ll be here
soon.”
And with those words of comfort Chauncey subsided and was asleep
from sheer exhaustion two minutes later. Though he slept, forgetful
of the whole affair, there were a few others who did not sleep,
messenger boys and millionaires especially.
The sergeant at the desk had had no one but one “drunk” to register
during the next half hour, and so he was pretty nearly asleep
himself. The doorman was slumbering peacefully in his chair, and
two or three roundsmen and officers were sitting together in one
corner whispering. That was the state of affairs in the police station
when something happened all of a sudden that made everybody
leap up with interest.
A carriage came slamming up the street at race-horse speed. Any
one who has lain awake at night, or rather in the early hours of
morning, when the city is as silent as a graveyard, has noticed the
clatter made by a single wagon. An approaching tornado or
earthquake could not have made much more of a rumpus than this
one. The sergeant sat up in alarm and the doorman flung upon the
door and rushed out to see what was the matter.
They were soon to learn—the driver yanked up his galloping horses
directly in front of the building. At the same instant the coach door
was flung open with a bang. It was an elderly gentleman who
hopped out, and he made a dash for the entrance, nearly bowling
the doorman over in his haste.
Now it is not often that a “swell bloke” like that visits a station house
at such hours. The sergeant gazed at him in alarm, expecting a
burglary, a murder, or perhaps even a dynamite plot.
“What’s the matter?” he cried.
The man dashed up to the desk, breathless from his unusual
exertion.
“My boy!” he cried. “Where is he?”
“Your boy?” echoed the sergeant. “Where is he? What on earth?”
The sergeant thought he had a lunatic then.
“My boy!” reiterated the man excitedly. “Chauncey! He’s a prisoner
here!”
The officer shook his head with a puzzled look.
“I’ve got nobody named Chauncey,” said he. “You’ve come to the
wrong place.”
The man happened to think of the telegram; he glanced at it.
“Oh, yes,” he cried, suddenly. “I forgot. Peter Smith is the name he
gave. You’ve a Peter Smith here!”
The sergeant gazed at the excited man in indescribable amazement.
“Peter Smith!” he stammered. “Why, yes. But he’s a tramp. He’s
arrested for burglary, and——”
The strange gentleman was evidently angry at having been stirred
out of bed so early in the morning. Moreover he was insulted at the
outrageous idea of his nephew’s being in a common prison house as
a burglar. Altogether he was mad through, and didn’t take the
trouble to be cautious.
“Let him out this instant, I say,” he demanded, indignantly. “How
dare you——”
Now the sergeant was a pompous individual and he had no idea of
being “bossed” like that by any one, whoever he might be, least of
all in the presence of his men. Moreover, he was an Irishman, and
this angry individual’s superior way got him wild.
“Who are you?” he demanded, with more conciseness than courtesy.
“I’m Perry Bellwood,” said the other with just as much asperity. “And
what is more——”
“Who in thunder is Perry Bellwood?” roared the sergeant.
That took all the wind out of the elderly and aristocratic gentleman’s
sails.
“You don’t know Perry Bellwood?” he gasped. “Perry Bellwood, the
banker!”
“Never saw him,” retorted the sergeant.
“And you won’t release my nephew?”
“No, sir. I won’t release your nephew!” roared the officer, hammering
on his desk for emphasis. “I wouldn’t release him for you or any
other banker in New York, or the whole crowd of them together. Do
you hear that? I’d like to know what you think a police sergeant is,
anyhow. A nice state of affairs it would be if I had to set loose every
burglar and murderer in prison because of some man who thinks he
owns the earth because he is a banker.”
The sergeant was red in the face from anger as he finished this
pointed declaration. Mr. Bellwood was pacing up and down the room
furiously. He turned upon the man suddenly when he finished.
“I’ll bet you all I own,” he said, “that you’ll do as I say, and in an
hour, too.”
“And I’ll bet you my job I don’t,” snapped the sergeant. “I’ll see
who’s running this place——”
By that time the outraged banker had made a dash for his carriage.
The outraged sergeant planked himself down on his chair and gazed
about him indignantly.
“The very idea!” vowed he. “The very idea! That fellow talked to me
as if he were the mayor. I’d a good mind to lock him up. I wouldn’t
let those burglars loose now for all Fifth Avenue.”
He was given a chance to prove that last assertion of his, a good
deal more of a chance than he expected when he made it. He had
hardly gotten the words out of his mouth, and the rattle of the
carriage had not yet died away before another one dashed up to the
door.
The sergeant thought it was the same fellow back, and he got up
angrily. The door was flung open and in dashed another man, even
more aristocratic in bearing than the other.
“My name is Mr. Stickhey,” said he, gravely, “and I’ve come——”
“I suppose you want to raise a rumpus about that confounded
Chauncey, too!” cried the sergeant, getting red to the ends of his
whiskers.
“W-why! What’s this?” gasped the astonished millionaire.
“And I suppose you want me to let him go, don’t you?”
“W-why!” gasped the astonished millionaire again. “What——”
“Well, if you do you might as well understand that I don’t mean to
do it. And you needn’t be wasting any breath about it either. I’ve
stood about all of this I mean to stand from anybody. I don’t set my
prisoners loose for the devil himself, and I won’t for you. Now then!”
It would be difficult to describe the look of amazement that was on
the dignified Mr. Stickhey’s face. He stared, and then he started
again.
“Why, officer!” said he. “I’m sure——”
“So’m I!” vowed the sergeant. “Dead sure! And all your talk won’t
change the fact, either, that Peter Smith, or Chauncey, or whoever
he is, stays where he is till morning. And the sooner you realize it
the better.”
The millionaire stared yet half a minute more, and then he whirled
about on his heel and strode out, without another word.
“I’ll see about this,” said he.
The sergeant did not return to his seat; he was too mad. He pranced
up and down the room like a wild man, vowing vengeance on all the
dudes and bankers in existence.
“I wonder if any more of them are coming,” exclaimed he. “By jingo,
I just wish they would. I’m just in the humor—gee whiz!”
It was another! Yet older and more sedate than either of the others
he marched in and gazed haughtily about him.
“I’ve a nephew——” he began; and there he stopped.
“Oh!” said the sergeant. “You have! Get out!”
“Why—er——”
“Get out!”
“What in——”
“Do you hear me? Get out of here, I say! Not a word, or I’ll have you
—ah! I wonder if there’ll be any more of ’em.”
This last was a chuckle of satisfaction as Millionaire No. 3 fled
precipitately. The sergeant rubbed his hands gleefully. This sport
bade fair to last all night, he realized to his great satisfaction as he
faced about and waited.
He was waiting for number four to show up. He was getting madder
still and this time he was fingering his club suggestively. At the very
first gleam of a white shirt front he drew it and made a dash for the
door.
It was Mr. Vanderpool, number four.
“Get out!” said the irate sergeant, menacingly, and he swung up his
weapon. The gentleman thought he had met with a maniac; he gave
one glance and then made a dash for the carriage. The officer faced
about, replaced his club, and softly murmured “Next.”
But the “next” never came. The sergeant got weary of pacing about
and finally sat down again. Half an hour passed and he began to
doze; the fun for that night was over, thought he, and laughed when
he thought how mad be had been.
“I’d just like to see any Fifth Avenue dudes running this place,” he
muttered. “I never heard of such a piece of impertinence in my life!”
Through all this the plebes were peacefully sleeping. What poor
Chauncey would have done if he had seen his four uncles insulted by
that irate policeman is left to the imagination of the reader. It would
most infallibly have been the death of Chauncey, and so perhaps it is
just as well that he didn’t awaken.
The clock over the station house door was at three. It will be
remembered that the train left at three-thirty. The only train that
could possibly save those unfortunate plebes. Three-thirty was the
time the ferryboat left. But the station house was two miles and
more from the ferry-slip. Altogether things were getting very
interesting. For the sergeant dozed on, and the prisoners slept on
and the clock went on to three-fifteen. It was a wonder Mark Mallory
didn’t have a nightmare.
It is of the nature of thunderbolts to strike swiftly. There is no
parleying, no stopping for introductions, no delays. Therefore there
will be none in describing what happened next.
The sergeant sat up with a start; so did the doorman, and so did
everybody else in the place. There was the rattle of another
carriage!
CHAPTER XXIV.
BACK AGAIN.

The sergeant had gotten over his anger, but he meant to be


consistent, all the same. If this was another one of those “bloated
aristocrats” he’d better look out for trouble, that was all.
The carriage drew up in the usual fashion, the sergeant seized his
club. There was a flash of white shirt front and the sergeant made a
leap for the door. The next moment he staggered back as if he had
been shot. It was Millionaire No. 1, hatless and breathless, almost
coatless and senseless, dragging in his wake—the captain of the
precinct!
The sergeant saluted and gasped.
“I told you,” cried Millionaire No. 1.
“You’ve a prisoner here named Smith?” cried the captain.
“Er—yes,” stammered the sergeant.
“Send him here, quick!”
The poor officer was too much amazed and thunder-struck to be
chagrined at his defeat. He made a rush for the cell; shouted to the
prisoners; and half a minute later Chauncey, green August overcoat
and all, was in his uncle’s arms.
The sergeant turned to the smiling police captain.
“Allow me to present——”
He was interrupted by a yell; Chauncey had glanced up at the clock.
“Good heavens!” he cried. “We’ve ten minutes to make the train!”
Chauncey, aristocratic and Chesterfieldian Chauncey, alas, I blush to
record it, had forgotten in one instant that there was such a thing on
earth as a rule of etiquette. He forgot that there was such a person
on earth as a police captain. He never even looked at him. His two
friends at his side, he made one wild dash for the door.
He was not destined to get out of it, however. During the excitement
no one had noticed the approach of another white shirt front and in
rushed Millionaire No. 2.
No. 2 had the chief of police!
“You’ve a prisoner here named Smith——” cried the latter excitedly.
“Release——”
Just then the millionaire caught sight of Chauncey, and again there
were handshakes and apologies, another scurrying toward the door.
“I can’t stop, I tell you!” roared Chauncey. “I’ll miss the train—quick
—bah Jove, ye know, I’ll be ruined—I——”
There was another clatter of wheels at the door.
“Good gracious!” gasped the unfortunate cadet. “It’s somebody else!
Bah Jove! Deuce take the luck!”
Nothing has been said of the unfortunate sergeant during this. He
was leaning against his desk in a state of collapse. Millionaire No. 3
had entered the room.
Millionaire No. 3 had a police commissioner!
“You’ve a prisoner here named Smith,” cried he. “Release——”
This time the plebes were desperate. They could stand it no longer.
Chauncey had forced his way to the door and made a dash for one
of the carriages.
“Drive——” he began, and then he stopped long enough to see
another carriage rush up—Millionaire No. 4. Millionaire No. 4 had
somebody—Chauncey didn’t know who. But the agonized sergeant
did.
It was no less a personage than his honor, the mayor.
(His honor the mayor was mad, too, and you may bet the sergeant
caught it.)
With that our three friends had nothing to do. They had piled into
the carriage, Millionaire No. 1 with them, and likewise the captain, to
make sure that they weren’t arrested for fast driving. And away they
rattled down the street.
“Christopher Street—seven minutes!” roared Chauncey. “For your life
—bah Jove!”
After which there was fun to spare. New York streets aren’t made for
race tracks, and the way that carriage swayed and bumped was a
caution. The driver had taken them at their word and was going for
dear life. Three times the captain had to lean out of the window to
quell some policeman who was shouting at them to slow up.
As for the plebes, there was nothing for them to do but sit still and
wait in trembling anxiousness. Chauncey’s uncle had a watch in his
hand with the aid of which he told off the streets and the seconds.
“If we make it,” said he, “we won’t have ten seconds to spare.
Faster, there, faster!”
The poor cadets nearly had heart failure at that.
“If we miss it,” groaned Mark, “we are gone forever. The whole
story’ll come out and we’ll be expelled sure as we’re alive. What time
did you say it was?”
“Drive, there, drive!” roared Chauncey.
All things come to an end. Those that haven’t will some day. It
seemed an age to the suffering plebes, but that drive was over at
last. And the end of it was so terrible that they would have preferred
the suspense.
The carriage was yanked up and brought to stop in front of the ferry
gates just as the boat was gliding from her slip.
The look that was upon the faces of the three would have moved a
Sphinx to tears. They sank back in the carriage and never said one
word. It was all over. West Point was gone. To the three that meant
that life was no longer worth the living.
It seemed almost too terrible to be true. Mark Mallory pinched
himself to make sure he was alive; that all this dream had really
happened, that he really was beyond hope.
And then suddenly the police captain gave vent to a startled
exclamation and whacked his knee.
“Desbrosses Street!” he roared to the startled driver, and an instant
later the carriage was speeding away down along the wharves.
Where they were going, or why, none of them had the least idea,
except the captain; and he said nothing. The trip was a short one,
only three or four blocks. At the end of it he sprang from the
carriage.
“Quick, quick!” he cried, and made a dash for one of the piers.
The rest did not need to be urged to follow. They beat the captain
there in their haste. For they saw then where he was going; a police
tug was lying at the wharf.
“Quick!” roared the captain, leaping aboard. “Follow that ferry!”
And half a minute later the engines of the tug were throbbing and
the tug was sweeping out into the river.
A few minutes after that there were three tough-looking tramps
contentedly dozing in a Pullman car of the West Shore express.
The same three sneaked into Camp McPherson at the very moment
when Cadet Corporal Vance (of the Bull Harris gang) was
superintending the loading of the réveille gun.
CHAPTER XXV.
A CHALLENGE.

“Hey, there, wake up!”


“Um—um. Don’t bother me.”
“Wow! Git up, man——”
“Say, Texas, didn’t I tell you I wanted to sleep this hour? Haven’t I
been awake now two nights in succession helping you haze the
yearlings? Now I want to take a nap; so let me alone.”
“Wake up!” repeated Texas. “Ain’t you got sense enough, Mark
Mallory, to know I’m not pesterin’ you fo’ nothin’? Git yo’ eyes open
thar and listen. I got something to tell you. I know you’re sleepy—
thar ain’t no need tellin’ me that aire ag’in. I know you were up
night afore last hazin’ them ole yearlin’s, an’ last night, too, ’cause
they tied us up an’ fired us into that freight train goin’ to New York.
But this hyar’s more ’portant than sleepin’!”
“What is it?” demanded Mark.
“There’s a committee from the first class wants to see you.”
“What!”
“Thar, naow! I knew you’d get yo’ eyes open,” laughed the other
triumphantly.
“What do they want?” inquired Mark.
“You know what they want well as I do,” responded Texas. “They
want you. They want you ’cause you’re the most B. J. plebe ever
came to West Point, ’cause you dared to defy ’em, to refuse to be
hazed, to lick ’em when they tried it, an’ to all ’round raise the
biggest rumpus this hyar ole place ever see. That’s what!”
“Do you mean,” laughed Mark, “that they want me to fight some
more?”
“Course they do!” roared Texas. “You old idiot, you! Why ain’t yo’ up
hustlin’ fo’ the chance? You don’t appreciate yo’ opportunity, sah. Ef
I had the chance to wallop them ole cadets like you’ve got—wow!
You know what I’d do?”
“I’m not a fire-eating, wild and woolly cowboy hunting for fight,”
responded Mark.
“That’s all right,” grinned the other. “You’ll do it when the time
comes. I never see you run yit when you ought to be fightin’, an’
neither did them ole cadets. An’ say, Mark! There’s fun ahead!
Whoop! You remember ever since you had the nerve to go to the
hop, somethin’ no plebe ever dared do afore, them ole first class
fellers vowed they’d make you sorry. You made ’em madder since by
lickin’ one of ’em when they dared you to. An’ now they’re comin’
’roun’ to git square.”
“Do you mean they’re going to make me fight every man in the
class, as they said?” inquired Mark.
“That’s jes’ what I do!” cried Texas, gleefully. “Jes’ exactly! Come out
hyer an’ see ’em yo’self.”
Mark had been making his toilet before the little looking-glass that
hung on the tent pole; he turned then and accompanied his friend
out of camp and over to Trophy Point, where sat in all stateliness
and dignity three solemn-looking seniors, a committee from the first
class to Mark Mallory, the desperate and defiant and as yet untamed
“B. J.” plebe. But he wasn’t going to remain untamed very long if
that committee had anything to do with it.
They arose at his approach.
“Mr. Mallory?” said the spokesman.
Mr. Mallory bowed.
“You come from the first class, I believe,” he said. “Let us proceed
right to business.”
The committee, through its spokesman, cleared its throat with a
solemn “Ahem!”
“Mr. Mallory,” said he, “I presume you have not forgotten that a short
while ago you ventured to defy our class openly. The class has not
forgotten it, for such conduct in a plebe cannot be tolerated here.
Your conduct ever since you came has been unbearably defiant; you
have set at naught every cadet law of the academy. And therefore,
as the class warned you beforehand, you must expect trouble.”
Mr. Mallory bowed; he’d had a good deal of it already, he thought to
himself.
“The class has been waiting,” continued the other, “for you to
recover from the effects of a dislocated shoulder, an injury due to
another unpleasant—ahem—accident——”
“Or, to be more specific,” inserted Mark, very mildly, “due to the fact
that I was—er—attacked by some—ahem—fifty members of the first
class in a body.”
“Not quite so many,” said the chairman, flushing. “The incident is
regretted by the class.”
“By me also,” said Mark, rubbing his shoulder suggestively.
“It appears,” the other continued hurriedly, “that you are now
recovered. Therefore, to be brief, the class has sent us to inquire as
to your wishes concerning the duty you undertook when you
ventured to defy them. You know what I mean. You stand pledged,
and you will be compelled to defend yourself before every member
of our class in turn until you agree to apologize and become a plebe
once more.”
The spokesman stopped and Mark answered without hesitation,
looking him squarely in the eye.
“Tell the class,” said he, “that I am ready to meet any one it may
select, to-day if necessary, and in any place they choose. Tell them
also if they could manage to select one of those who helped to
injure my shoulder I should consider it a favor. Tell them that I have
nothing to apologize for. Tell them that I renew my defiance, with all
possible courtesy, of course; tell them I once more refuse to be
hazed, and shall refuse even when I am beaten; and——”
Here the excitable ex-cowboy, who had been listening with most
evident delight, sprang forward with a whoop.
“An’ tell ’em,” he roared, “doggone their boots, ef they lick Mark fair
or foul they ain’t hardly begun what they’ll have to do! Tell ’em, sah,
there’s a gennelman, what never yit run from man or devil, named
Jeremiah Powers, sah, son o’ the Honorable Scrap Powers, o’
Hurricane County, Texas. Tell ’em he’s jes’ roaring for a scrap, an’
that he’ll start in whar Mallory quits! An’ tell ’em——”
But the committee had turned away and started across the parade
ground by that time. The committee didn’t consider it necessary to
listen to Mr. Jeremiah Powers.
Mark had listened however; and as he took Texas by the hand the
excitable Texas saw in his eyes that he appreciated the offer.
“And now,” said Mark at last, “if I am to do some fighting I’d best go
back and finish that nap. I’ll need to make up for the sleep I’ve
missed.”
An important event had happened to that company that day, one
that had made a great change in their lives. A month and a half of
drill and discipline, the most rigorous possible, had been judged to
have had its effect. And that day the plebes were honored by being
put in the cadet battalion.
Previously they had “herded” alone, a separate roll call, separate
drills, separate seats in mess hall. But now all was changed. The
plebe company was broken up, the members each going to their
own company in the battalion, to hear their names called with the
others at roll call, to march down to meals and sit with them, too.
And that afternoon for the first time the plebes were to march on
parade, Mark and Texas under the command of Fischer, cadet-
captain of Company A.
Concerning Fischer, the high and mighty first classman, it may be
well to say a word, for he will figure prominently in this story. Fischer
was a member of the first class, and its idol. Tall, handsome and
athletic, he made an ideal captain; even the plebes thought that,
and strange to say, our B. J. plebes most of all. For Fischer was a
fair-minded, gentlemanly fellow and more than once he had
interfered to see that Mallory got fair play with his enemies.
He came in that same afternoon to have a word with Mark as to the
latest excitement; it was an unusual thing indeed for a cadet-captain
even to speak to a plebe, but Fischer chose to be different. And,
moreover, Mallory had earned for himself many privileges most
plebes had never dreamed of.
“I got a letter from your friend, Wicks Merritt,” said Fischer. “His
furlough is coming to an end. Poor Wicks is very much agitated for
fear you’ll be hazed out of West Point before he gets here. But I told
him there wasn’t much danger. I think you’ll stick.”
“I shall try,” laughed Mark, while Texas sat by in awe and gazed at
the young officer’s chevrons and sash. “I shall try. Have you heard of
my engagement—the latest?”
“Yes,” answered the other, “I have. That’s what I came in for. I don’t
envy you.”
“I don’t myself,” said the plebe thoughtfully. “I don’t like to fight. I’d
a thousand times rather not, and I always say ‘no’ when I can. But
I’ve vowed I wouldn’t stand the kind of hazing I got, and I don’t
mean to so long as I can see.”
“I wish you luck,” said Fischer. “I’ve told the men in my own class
that, for I haven’t forgotten, as they seem to, the time you rescued
that girl in the river.”
“Do you know who’ll be the first man I meet?” inquired the other,
changing the subject.
“I do not; the class is busily holding a conclave now to decide who’s
the best. They’ll send their prize bantam the first time, though I
doubt if we’ve a man much better than Billy Williams, the yearling
you whipped. Still you’ve got to be at your best, I want to tell you,
and I want you to understand that. When a man’s been three years
here at West Point, as we have, he’s in just about as perfect trim as
he ever will be in his life.”
“So am I,” responded Mark.
“You are not,” said Fischer, sharply. “That’s just the trouble. I
wouldn’t be warning you if you were. I’ve heard of the monkey
shines you’ve been kicking up; Bull Harris, that good-for-nothing
yearling, was blowing ’round that he’d put you on a train for New
York. The whole thing is you’ve been losing sleep.”
Mallory tried to pass the matter over lightly, but Fischer was bound
to say what he’d come for.
“I suppose it’s none of my business,” he continued, “but I’ve tried to
see you get fair play. And I want to say this: You rush in to fight
those fellows to-day, as they’ll try to make you, and you’ll regret it.
That’s all. As the challenged party the time is yours to name. If you
refuse for a week at least, I’ll back you up and see that it’s all right,
and if you don’t you’ll wish you had.”
Having delivered himself of which sage counsel the dignified captain
arose to go. Perhaps his conscience troubled him a little anyhow that
he’d stayed so long in a plebe tent.
He thought of that as he came out and espied three members of his
own class coming down the street and looking at him. They hailed
him as he passed.
“Hey, Fischer!”
They were three who had been the “committee”; they were a
committee still, but for a different purpose. Their purpose was to see
Fischer, and when he came toward them, they led him off to one
side. The message that committee had to give was brief, but it
nearly took Fischer off his feet.
“Fischer,” said one, “the fellows have decided about that Mallory
business.”
“Yes,” said Fischer. “What?”
“They’ve decided that you’ll be the man to meet him first.”
And the committee wondered what was the matter with Fischer.
CHAPTER XXVI.
“I HAVE THE COURAGE TO BE A COWARD.”

Something which happened immediately after Fischer left the tent


effectually drove from Mark’s mind all ideas of fights and first
classmen. It was the blessed long-expected signal, a roll upon the
drum, the summons to fall in for the evening’s dress parade.
And oh, how those plebes were “spruced up!” The four members of
the Banded Seven who roomed in Mark’s tent had taken turns
looking over each other in the effort to find a single flaw. A member
of the guard trying for colors was never more immaculate than those
anxious strangers. Of the many pair of duck trousers allotted to each
cadet every pair had been critically inspected so as to get the very
whitest. Buttons and belt plates were little mirrors, and every part of
guns and equipments shone. When those four “turned out” of their
tent they felt that they were worthy of the ceremony.
It was an honor to be in the battalion, even if you were in the rear
rank and could see nothing all the time but the stiffly marching
backs in front. And it was an honor to have your name called next to
a first classman’s on the roll. The cadet officer had known the roll by
heart and rattled it off in a breath or two; but now he had to read it
slowly, since the new names were stuck in, which bothered him if it
did delight the plebes.
It was a grand moment when each plebe answered very solemnly
and precisely to his own; and another grand moment when the
cadet band marched down the long line to its place; and another
when the cadet adjutant turned the parade over to the charge of the
officer in command; and finally, last of all, the climax, when the
latter faced about and gave the order, “Forward, march!” when the
band struck up a stirring tune and amid waving of flags and of
handkerchiefs from hundreds of spectators, the all-delighted plebes
strode forward on parade at last.
How tremblingly and nervously he stepped! How gingerly and
cautiously he went through the manual of arms! And with what a
gasp of relief he finally broke ranks at the sunset gun and realized
that actually he had gotten out of it without a blunder!
Then they marched him down to supper. Formerly the plebes had
marched dejectedly in the rear and sat over in an obscure corner of
the room. That had its advantages, however, for he did not have to
pour the water and wait till everybody else was helped, and he was
not subject quite so much to the merry badinage of the merciless
yearling. On the whole he was rather glad when supper was over
and after marching back to camp was dismissed for that day at last.
Mark and his chum, who as we have seen were now interested in
nothing quite so much as sleep, or lack of it, made for their tents
immediately to go to bed. But once more the fates were against
them, for scarcely had they entered the door before another cadet
rushed in. It was the excited first captain, and he was in such a
hurry that he had not even stopped to remove his sword and sash,
the remnants of “parade.” He bore the news that the committee had
imparted to him; and its effect upon Mallory may be imagined.
“Fight you,” he gasped. “For Heaven’s sake, man, you’re wild.”
“I’m as serious as I ever was in my life,” replied the other. “The
committee from the class told me just before parade.”
“What on earth made them select you?”
“I don’t know,” groaned Fischer. “I had a couple of fights here—I
whipped Wright, the man you knocked out the time when the class
attacked you so disgracefully. And they seem to think I’d stand the
most chance, at least that’s what the committee said.”
“And what did you tell them?” inquired Mark, in alarm.
“Tell them? I haven’t told them anything yet. I was too horrified to
say a word. I’ve come over to see you about it. I’m in a terrible fix.”
“Well, refuse, that’s all.”
“I can’t!”
“But why not?” demanded Mark.
“My dear fellow,” protested the other, “you don’t understand how the
class feels about such things. I’m a member of it, and when I’m
called upon to defend the class honor I daren’t say no. When you
have been here as long as I have you’ll understand how the cadets
would take it. They’d be simply furious.”
“Then do you mean,” gasped the other, staring at him in
consternation, “that I’m expected to fight you?”
“I don’t see what else,” responded the captain, reluctantly. “What
can I tell the class? If I simply say that I’ve been rather friendly with
you, they’ll say I had no business to be. And there you are.”
“No business to be,” echoed Mark, thoughtfully, gazing into space.
“No business to be! Because I’m a plebe, I suppose. And I’ve got to
fight you!”
“What else are we to do,” protested the other. “I’m sure I shan’t
mind if you whip me, which you probably will.”
“Whip you!” cried Mark; he had sprung to his feet, his hands
clinched. And then without another word he faced about and fell to
striding up and down the tent, the other watching him anxiously.
“Mr. Fischer,” he demanded suddenly, without looking at the other,
“suppose I refuse to fight you?”
“Don’t think of it!” cried Fischer, in horror.
“Why not?”
“Because you would be sneered at by the whole corps. Because they
would call you a coward and insult you as one, cut you dead! You
could not stand it one week.”
“What else?” inquired Mark, calmly.
“What else! What else could there be! For Heaven’s sake, man, I
won’t have it! I couldn’t make the class understand the reason.
You’d be an outcast all the time you were here.”
“Is that all?”
“Yes.”
And Mark turned and gazed at the other, his brown eyes flashing.
“Mr. Fischer,” he began, extending his hands to the other, “let me tell
you what I have thought of you. You have been the one friend I
have had in this academy outside of my own class and Wicks Merritt;
you have been the one man who has had the fairness to give me my
rights, the courage to speak for me. I have not always taken your
advice, but I have always respected you and admired you. And,
more than that, I owe my presence here to you.”
Mark paused a moment, while his thoughts went back to the time.
“I had enemies,” he continued at last, slowly, “and they had me in
their power. They had persuaded the superintendent that I was a
criminal, and I looked for nothing but disgrace. And it was you, then,
and you only of all the cadets of this academy, who had honor and
the courage to help Texas prove my innocence. And that debt of
gratitude is written where it can never be effaced. My debt to you!
And now they want me to fight you!”
The captain shifted uneasily.
“My dear fellow,” he began, “I can stand it.”
“It is not for you to stand,” said Mark. “It is for me. It is I who owe
the debt, and I shall not pay it with blows. Mr. Fischer, I shall not
fight you.”
“But what will you do? You will be reviled and insulted as a coward.”
“Yes,” said Mark, firmly; “I will. But as I once told Texas, there are a
few things worse than being called a coward, and one of them is
being one.”
“I know,” protested Fischer. “But then——”
“There are times,” Mark continued, without heeding him, “times, I
say, when to fight is wrong.”
“Yes!” cried the other. “This is one.”
“It is,” said Mark. “And at such times it takes more courage not to
fight than to fight. When an army goes out to battle for the wrong
the brave man stays at home. That is a time when it takes courage
to be a coward. And Mr. Fischer——”
Mark took the other by the hand and met his gaze.
“Mr. Fischer, I have the courage to be a coward.”
There was silence after that, except for a muttered “Oh!” from
Texas. Mark had said his say, and Fischer could think of nothing.
“Mr. Mallory,” he demanded at last, “suppose you let me do the
refusing?”
“It would be best for me to do it,” said Mark, with decision.
“Disgrace would be unbearable for you. You have your duty to your
class; I have no duty to any one but myself. And moreover, I am a
plebe, cut by everybody already and pledged to fight every one. To
fight them a few times more will not hurt. And I really like to defy
them. So just leave it to me.”
That was the end of the talk. Fischer sat and looked at Mark a few
moments more, feeling an admiration he did not try to express. But
when he arose to go the admiration was in the grip of his hand.
“Mr. Mallory,” he said. “You do not realize what you attempt. But you
may rest assured of one thing. I shall never forget this, never as
long as I live. Good-night.”
And as the captain’s figure strode up the street Mark turned and put
his hands on Texas’ shoulders.
“Old fellow,” said he, “and have you any courage?”
“Say,” protested Texas, solemnly, “I’ll fight——”
“I don’t mean that kind of courage,” said Mark. “I mean courage of
the eye, and the heart. Courage of the mind that knows it’s right and
cares for nothing else. I mean the courage to be called a coward?”
“I dunno,” stammered Texas, looking uneasy. Poor Texas had never
thought of that kind of courage. “I ain’t very sho’,” he said, “’bout
lettin’ anybody call me a coward.”
“That is what I mean to do,” said Mark. “I mean to let them call it,
and look them in the eye and laugh. And we’ll see what comes of it.
I won’t fight Fischer, and they can’t make me. The more they taunt
me, the better I’ll like it. When they get through perhaps I’ll get a
chance to show them how much of a coward I am.”
With which resolution Mark turned away and prepared for bed.
CHAPTER XXVII.
MARK, THE COWARD.

The taunting of which Mark spoke with such grim and quiet
determination was soon to begin; in fact, he was not destined to lie
down for that night of rest without a taste of it. He had barely
removed the weight of his uniform jacket, with its collar fastened
inside, before he heard a sound of voices near his tent.
He recognized them instantly; it was the “committee,” and a moment
later, in response to his invitation, the three first classmen entered,
bowing most courteously as usual.
“Mr. Mallory,” said the spokesman, “I have come, if you will pardon
my disturbing you, to deliver to you the decision of our class.”
“Yes,” said Mark, simply. “Well?”
It was evident that Fischer had not seen them, and that they
suspected nothing. A storm was brewing. Mark gritted his teeth.
“It might just as well come now as any time,” he thought. “Steady!”
“The class will send a man to meet you this evening in Fort Clinton,”
said the cadet.
“Ah,” responded Mark. “Thank you. And who is the man?”
“He is the captain of your company, Mr. Fischer. And that is about all,
I believe.”
“It is not all,” observed Mark, very quietly; and then, as the other
turned in surprise, he clinched his fists. “I refuse to fight Mr. Fischer,”
he said.
“Refuse to fight him?”
The three gasped it all at once, in a tone of amazement that cannot
be shown on paper.
“And pray,” added the spokesman, “why do you refuse to fight Mr.
Fischer?”
“My reasons,” said Mark, “are my own. I never try to justify my
conduct to others. I simply refuse to fight Mr. Fischer. I’ll fight any
other man you send.”
“You’ll fight no one else!” snapped the cadet. “Mr. Fischer is the
choice of the class. If you refuse to meet him, and give no reason, it
can only be because——”
“Because you know he’s too good a man for you!” put in one of the
others. “Because you’re afraid of him!”
Mark never winced at that; he gave the man a look straight in the
eye.
“There are some people,” he said, “I am not afraid of. I am not
afraid of you.”
The cadet’s face turned scarlet, and he clinched his fists angrily.
“You shall pay for that,” he cried. “You——”
But the spokesman of the committee seized him and forced him
back.
“Shut up, old man,” he exclaimed. “Don’t you see what he’s trying to
do. He’s afraid of Fischer, and he’s trying to force a fight with some
one else. He’s a dirty coward, so let him alone.”
Mark heard that plainly, but he never moved a muscle. It was too
much for our tinder-box Texan, however; Texas had been perspiring
like a man in a torture chamber during this ordeal, and just then he
leaped forward with a yell.
“You ole white-faced coyote, you, doggone your boots, I’ll——”
“Texas!” said Mark, in his quiet way.
And Texas shut up like an angry oyster and went back into the
corner.
“Now, gentlemen,” said Mark, “I think our interview is at an end. You
understand my point. And that is all.”
“And as for you,” retorted the other. “Do you understand your
position? You will be branded by the cadets as a coward. You will
fight Fischer as sure as the class can make you. And you will fight no
one else, either, until you fight him.”
Mark bowed.
“And you’ll allow me to express my opinion of you right here,”
snapped the insulted one, who was going to fight a moment ago.
“You needn’t get angry about it, either, because you’ve no redress till
you fight Fischer. You’re a coward, sir! Your whole conduct since you
came here has been one vulgar attempt to put up a bluff with
nothing to back it. And you lack the first instincts of a gentleman,
most of all, sir, because you’ll swallow such insults from me instead
of fighting, and taking the licking you’ve earned. You can’t fight me
till you’ve fought Fischer.”
“Can’t, hey! Say, d’ you think I’m a-goin’ to stan’ sich——”
“Texas!”
And once more there was quiet, at the end of which the indignant
committee faced about without a word and marched out in disgust.
“He’s not worth fooling with,” said the spokesman, audibly. “He’s a
coward.”
After which Mark turned to Texas and smiled.
“That was the first dose, old man,” said he. “How did you like it?”
From Texas’ face he liked it about as well as a mouthful of quinine,
and if Texas hadn’t been very, very sleepy he would probably have
lain awake all night growling like an irate volcano, and wondering
how Mark could snore away so happily while such things were
happening.
Though Mark slept, there were no end of others who didn’t sleep on
account of him. The committee, just as soon as they had gotten
outside, had rushed off to tell the story of “Mallory’s flunk,” and
pretty soon there were groups of first classmen and yearlings
standing about the camp indignantly discussing the state of affairs.
There were various opinions and theories, but only one conclusion:
That plebe Mallory’s a coward!
Fischer was not there to gainsay it, he being absent on duty, and so
the cadets had no one to shed any light on the matter, which they
continued to rave about right up to the time for tattoo. The first
class was so worked up over it that there was an impromptu
meeting gathered to discuss it just outside of the camp.
The angry mob was reduced to an orderly meeting a little later by
the president of the class, who appeared on the scene and called the
cadets to order to discuss ways and means of “swamping Mallory.”
For every one agreed that something ought to be done that very
night. As has been stated, they never dispersed until the very
moment of tattoo; by that time they had their campaign mapped
out. It was a very unpleasant programme for poor Mark.
He had to dress and turn out, of course, at tattoo to answer to his
name before he retired for the night. Not a word was said to him
then; yet he could see by the angry looks and frowns he met with
that the story of his conduct was abroad. But Mark had not the least
idea of what was coming, and he went back to his tent and fell
asleep again in no time.
It is an old, old story, an old, old incident. To tell it again would
weary the reader. That night a dozen men, chosen by the class for
their powerful build, instead of going to sleep when taps sounded,
lay awake and waited till the camp got quiet. They waited till the tac
had gone the rounds with his lantern, and then to his tent for the
night. They waited till the sentry’s call had been heard for the fourth
time since taps.
“Twelve o’clock and all’s we-ell!”
They they got up and dressed once more, and stole silently out into
the darkness of the night. Outside, in the company street, they met
and had a whispered consultation, then surrounded a certain “plebe
hotel” and finally stole away in triumph, bearing four helpless plebes
along with them. A while later they had passed the sentry and had
their victims bound and gagged, lying in a lonely corner of old Fort
Clinton.
The cadets thought four would be enough that night. They meant to
give those plebes the worst licking they had ever had in their lives.
That would be a pretty severe one, especially for Mallory, who had
been roughly handled before. But the first classmen had agreed
among themselves that there was no call for mercy here.
The reader may perhaps wish to be spared the details of the
preparation. Suffice it to say that those heavily bound unfortunates
were stretched out upon the ground, that their backs were bared,
and then that the four brawniest of the desperate cadets took four
pieces of rope in their hands and stepped forward. It was estimated
that when they stepped back those four plebes would be in a more
docile mood than previously.
A dead silence had fallen upon the group; it had increased in
numbers every moment, for other cadets had stolen out to see what
was being done. And just then every one of them was leaning
forward anxiously, staring at Mallory, for nobody cared anything
much about the other three, whether they were attended to or not.
It was Mallory, the coward, against whom all the hatred was;
Mallory, whom the biggest man had been deputed to attend to. All
the other “executioners” were waiting, leaning forward anxiously to
see how Mallory took it.
The cadet who held the rope seized it in a firm grip, and swung it
about his head. A moment later it came down through the air with a
whirr. It struck the white flesh of the helpless plebe with a thud that
made the crowd shudder. A broad red streak seemed to leap into
view, and the victim quivered all over. The cadet raised the lash once
more and once more brought it down; and again an instant later.
The end of it came soon, fortunately; and it came without waiting
the wish of the “hazers.”
Once before that game had been tried on Mallory, then by the
infuriated yearlings. An alarm from camp had interrupted it at an
earlier stage. And that happened again. This time there broke upon
the stillness of the midnight air the sharp report of a gun. It came
from nearby, too, and it brought no end of confusion with it,
confusion that will be told of later.
As to the hazers, they glanced at each other in consternation. That
gun would awaken the camp! And they would be discovered! There
was not a second to lose!
In a trice the four plebes were cut loose, left to get back to their
tent as best they could; and a few moments later a mob of hurrying
figures dashed past the sentry and into Camp McPherson, which
they found in an uproar. The hazing of Mallory was over for that
night beyond a doubt.

You might also like