Hands-On Scikit-Learn For Machine Learning Applications: Data Science Fundamentals With Python David Paper 2024 Scribd Download
Hands-On Scikit-Learn For Machine Learning Applications: Data Science Fundamentals With Python David Paper 2024 Scribd Download
com
https://textbookfull.com/product/hands-on-scikit-
learn-for-machine-learning-applications-data-
science-fundamentals-with-python-david-paper/
https://textbookfull.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-aurelien-geron/
textbookfull.com
https://textbookfull.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-1st-edition-aurelien-geron/
textbookfull.com
https://textbookfull.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-early-release-2nd-edition-aurelien-geron/
textbookfull.com
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
https://textbookfull.com/product/arteriovenous-and-cavernous-
malformations-robert-f-spetzler/
textbookfull.com
https://textbookfull.com/product/guide-for-hindu-missionaries-1st-
edition-siddhant-bhartee/
textbookfull.com
https://textbookfull.com/product/petroleum-industry-transformations-
lessons-from-norway-and-beyond-taran-thune/
textbookfull.com
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
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.
1. Introduction to Scikit-Learn
David Paper1
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.
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).
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:
feature set:
['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal
width (cm)']
targets:
['setosa' 'versicolor' 'virginica']
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).
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:
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']
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:
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:
target: 8
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.
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.
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
data subset:
(2379,) shape of train data
(1584,) shape of test data
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
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.]
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
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:
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 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.