Machine Learning Step by Step Guide To Implement Machine Learning Algorithms with Python 1st Edition by Rudolph Russell ISBN 9781719528405pdf download
Machine Learning Step by Step Guide To Implement Machine Learning Algorithms with Python 1st Edition by Rudolph Russell ISBN 9781719528405pdf download
https://ebookball.com/product/introduction-to-machine-learning-
with-python-a-guide-for-data-scientists-1st-edition-by-andreas-
ma1-4ller-sarah-guido-1449369413-9781449369415-17196/
https://ebookball.com/product/mastering-machine-learning-with-
python-in-six-steps-a-practical-implementation-guide-to-
predictive-data-analytics-using-python-1st-edition-by-manohar-
swamynathan-isbn-1484228669-9781484228661-16112/
https://ebookball.com/product/mastering-machine-learning-with-
python-in-six-steps-a-practical-implementation-guide-to-
predictive-data-analytics-using-python-1st-edition-by-manohar-
swamynathan-isbn-1484228669-9781484228661-16088/
Python Machine Learning 1st Edition by Sebastian Raschka 1783555130
9781783555130
https://ebookball.com/product/python-machine-learning-1st-
edition-by-sebastian-raschka-1783555130-9781783555130-17162/
https://ebookball.com/product/excel-vba-step-by-step-guide-to-
learning-excel-programming-language-for-beginners-1st-edition-by-
jason-jay-isbn-1976198127-9781976198120-15878/
https://ebookball.com/product/java-easy-java-programming-for-
beginners-step-by-step-guide-to-learning-java-1st-edition-by-
felix-alvaro-isbn-1539509362-9781539509363-15874/
Learning PHP MySQL JavaScript CSS and HTML5 A Step by Step Guide to
Creating Dynamic Websites 3rd Edition by Robin Nixon ISBN 1491906979
9781491906972
https://ebookball.com/product/learning-php-mysql-javascript-css-
and-html5-a-step-by-step-guide-to-creating-dynamic-websites-3rd-
edition-by-robin-nixon-isbn-1491906979-9781491906972-15996/
https://ebookball.com/product/hands-on-machine-learning-with-
scikit-learn-and-tensorflow-techniques-and-tools-to-build-
learning-machines-3rd-edition-by-oreilly-media-
isbn-9781098122461-1098122461-15618/
Machine Learning
Author
Rudolph Russell
© Copyright 2018 - All rights reserved.
If you would like to share this book with another person, please purchase an
additional copy for each recipient. Thank you for respecting the hard work of
this author. Otherwise, the transmission, duplication or reproduction of any of
the following work including specific information will be considered an illegal
act irrespective of if it is done electronically or in print. This extends to creating
a secondary or tertiary copy of the work or a recorded copy and is only allowed
with an express written consent from the Publisher. All additional right reserved.
Table of Contents
CHAPTER 1
INTRODUCTION TO MACHINE LEARNING
Theory
What is machine learning?
Why machine learning?
When should you use machine learning?
Types of Systems of Machine Learning
Supervised and unsupervised learning
Supervised Learning
The most important supervised algorithms
Unsupervised Learning
The most important unsupervised algorithms
Reinforcement Learning
Batch Learning
Online Learning
Instance based learning
Model-based learning
Bad and Insufficient Quantity of Training Data
Poor-Quality Data
Irrelevant Features
Feature Engineering
Testing
Overfitting the Data
Solutions
Underfitting the Data
Solutions
EXERCISES
SUMMARY
REFERENCES
CHAPTER 2
CLASSIFICATION
Installation
The MNIST
Measures of Performance
Confusion Matrix
Recall
Recall Tradeoff
ROC
Multi-class Classification
Training a Random Forest Classifier
Error Analysis
Multi-label Classifications
Multi-output Classification
EXERCISES
REFERENCES
CHAPTER 3
HOW TO TRAIN A MODEL
Linear Regression
Computational Complexity
Gradient Descent
Batch Gradient Descent
Stochastic Gradient Descent
Mini-Batch Gradient Descent
Polynomial Regression
Learning Curves
Regularized Linear Models
Ridge Regression
Lasso Regression
EXERCISES
SUMMARY
REFERENCES
Chapter 4
Different models combinations
Implementing a simple majority classifer
Combining different algorithms for classification with majority vote
Questions
CHAPTER 1
∙ In the beginning, you'd take a look at what spam e-mails looks like. You might
select them for the words or phrases they use, like “debit card,” “free,” and so
on, and also from patterns that are used in the sender’s name or in the body of
the email
∙ Second, you'd write an algorithm to detect the patterns that you've seen, and
then the software would flag emails as spam if a certain number of those patterns
are detected.
∙ Finally, you'd test the program, and then redo the first two steps again until the
results are good enough.
Because the program is not software, it contains a very long list of rules that are
difficult to maintain. But if you developed the same software using ML, you'll
be able to maintain it properly.
In addition, the email senders can change their e-mail templates so that a word
like “4U” is now “for you,” since their emails have been determined to be
spam. The program using traditional techniques would need to be updated,
which means that, if there were any other changes, you would l need to update
your code again and again and again.
On the other hand, a program that uses ML techniques will automatically detect
this change by users, and it starts to flag them without you manually telling it to.
Also, we can use ,machine learning to solve problems that are very complex for
non-machine learning software. For example, speech recognition: when you say
“one” or “two”, the program should be able to distinguish the difference. So, for
this task, you'll need to develop an algorithm that measures sound.
In the end, machine learning will help us to learn, and machine-learning
algorithms can help us see what we have learned.
When should you use machine learning?
• When you have a problem that requires many long lists of rules to find the
solution. In this case, machine-learning techniques can simplify your code and
improve performance.
• Very complex problems for which there is no solution with a traditional
approach.
• Non- stable environments’: machine-learning software can adapt to new data.
Types of Systems of Machine Learning
There are different types of machine-learning systems. We can divide them into
categories, depending on whether
• They have been trained with humans or not
- Supervised
- Unsupervised
- Semi-supervised
- Reinforcement Learning
• If they can learn incrementally
• If they work simply by comparing new data points to find data points, or can
detect new patterns in the data ,and then will build a model.
Supervised and unsupervised learning
We can classify machine learning systems according to the type and amount of
human supervision during the training. You can find four major categories, as
we explained before.
- Supervised learning
- Unsupervised learning
- Semi-supervised learning
- Reinforcement learning
Supervised Learning
In this type of machine-learning system, the data that you feed into the
algorithm, with the desired solution, are referred to as “labels.”
Another example is to predict a numeric value like the price of a flat, given a set
of features (location, number of rooms, facilities) called predictors; this type of
task is called regression.
You should keep in mind that some regression algorithms can be used for
classifications as well, and vice versa.
There are some very important algorithms, like visualization algorithms; these
are unsupervised learning algorithms. You'll need to give them many data and
unlabeled data as an input, and then you'll get 2D or 3D visualization as an
output.
The goal here is to make the output as simple as possible without losing any of
the information. To handle this problem. it will combine several related features
into one feature: for example, it will cmbn a car’s make with its model. This is
called feature extraction.
Reinforcement Learning
Reinforcement learning is another type of machine-learning system. An agent
“AI system” will observe the environment, perform given actions, and then
receive t rewards in return. With this type, the agent must learn by itself. Ties
called a policy.
You can find this type of learning type in many robotics applications that learn
how to walk
Batch Learning
In this kind of machine-learning systems, the system can’t learn incrementally:
the system must obtain all the needed data . That means it will require many
resources and a huge amount of time, so it’s always done offline. So, to work
with this type of learning, the first thing to do is to train the system, and then
launch it without any learning.
Online Learning
This kind of learning is the opposite of batch learning. I mean that, here, the
system can learn incrementally by providing the system with all the available
data as instances (groups or individually), and then the system can learn on the
fly.
You can use this type of system for problems that require the continuous flow of
data, which also needs to adapt quickly to any changes. Also, you can use this
type of system to work with very large data sets,
You should know how fast your system can adapt to any changes in the data’s
“learning rate.” If the speed is high, means that the system will learn quite,
quickly, but it also will forget old data quickly.
Instance based learning
This is the simplest type of learning that you should learn by heart. By using
this type of learning in our email program, it will flag all of the emails that were
flagged by users.
.
Model-based learning
There is another type of learning in which learning from examples allows
construction to make predictions
Bad and Insufficient Quantity of Training Data
Machine-learning systems are not like children, who can distinguish apples and
oranges in all sorts of colors and shapes, but they require lot of data to work
effectively, whether you're working with very simple programs and problems, or
complex applications like image processing and speech recognition. Here is an
example of the unreasonable effectiveness of data, showing the MS project,
which includes simple data and the complex problem of NLP.
Poor-Quality Data
If you're working with training data that is full of errors and outliers, this will
make it very hard for the system to detect patterns , so it won't work properly.
So, if you want your program to work well, you must spend more time cleaning
up your training data.
Irrelevant Features
The system will only be able to learn if the training data contains enough
features and data that aren’t too irrelevant. The most important part of any ML
project is to develop good features “of feature engineering”.
Feature Engineering
The process of feature engineering goes like this:
. Selection of features: selecting the most useful features.
. Extraction of features: combining existing features to provide more useful
features.
. Creation of new features: creation of new features, based on data.
Testing
If you'd like to make sure that your model is working well and that model can
generalize with new cases, you can try out new cases with it by putting the
model in the environment and then monitoring how it will perform. This is a
good method, but if your model is inadequate, the user will complain.
You should divide your data into two sets, one set for training and the second
one for testing, so that you can train your model using the first one and test it
using the second. The generalization error is the rate of error by evaluation of
your model on the test set. The value you get will tell you if your model is good
enough, and if it will work properly.
If the error rate is low, the model is good and will perform properly. In contrast,
if your rate is high, this means your model will perform badly and not work
properly. My advice to you is to use 80% of the data for training and 20% for
testing purposes, so that it’s very simple to test or evaluate a model.
Overfitting the Data
If you're in a foreign country and someone steals something of yours, you might
say that everyone is a thief. This is an overgeneralization, and, in machine
learning, is called “overfitting”. This means that machines do the same thing:
they can perform well when they're working with the training data, but they can't
generalize them properly. For example, in the following figure you'll find a high
degree of life satisfaction model that overfits the data, but it works well with the
training data.
Solutions
To solve the overfitting problem, you should do the following:
- Gather more data for “training data”
- Reduce the noise level
- Select one with fewer parameters
Underfitting the Data
From its name, underfitting is the opposite of overfitting, and you'll encounter
this when the model is very simple to learn. For example, using the example of
quality of life, real life is more complex than your model, so the predictions
won't yield the same, even in the training examples.
Solutions
To fix this problem:
- Select the most powerful model, which has many parameters.
- Feed the best features into your algorithm. Here, I'm referring to feature
engineering.
- Reduce the constraints on your model.
EXERCISES
In this chapter, you've learned many useful concepts, so let’s review some
concepts that you may feel a bit lost with. Machine learning: ML refers to
making machines work better at some task, using given data.
. To perform an ML project, you need to gather data in a training set, and then
feed that set to a learning algorithm to get an output, “predictions”.
. If you want to get the right output, your system should use clear data, which is
not too small and which does not have irrelevant features.
REFERENCES
.
http://static.googleusercontent.com/media/research.google.com/fr//pubs/archive/35179.pdf
CHAPTER 2
CLASSIFICATION
Installation
You'll need to install Python, Matplotlib and Scikit-learn for this chapter. Just go
to the references section and follow the steps indicated.
The MNIST
In this chapter, you'll go deeper into classification systems, and work with the
MNIST data set. This is a set of 70,000 images of digits handwritten by students
and employees. You'll find that each image has a label and a digit that represents
it. This project is like the “Hello, world” example of traditional programming.
So every beginner to machine learning should start with this project to learn
about the classification algorithm. Scikit-Learn has many functions, including
the MNIST. Let’s take a look at the code:
>>> from sklearn.data sets import fetch_mldata
>>> mn= fetch_mldata('MNIST original')
>>> mn
{'COL_NAMES': ['label', 'data'],
'Description': 'mldata.org data set: mn-original',
'data': array([[0, 0, 0,..., 0, 0, 0],
[0, 0, 0,..., 0, 0, 0],
[0, 0, 0,..., 0, 0, 0],
...,
[0, 0, 0,..., 0, 0, 0],
[0, 0, 0,..., 0, 0, 0],
[0, 0, 0,..., 0, 0, 0]], dataType=uint8),
'tar': array([ 0., 0., 0.,..., 9., 9., 9.])} de
. Description is a key that describes the data set.
. The data key here contains an array with just one row for instance, and a
column for every feature.
. This target key contains an array with labels.
Let’s work with some of the code:
>>> X, y = mn["data"], mn["tar"]
>>> X.shape
(70000, 784)
>>> y.shape
(70000,)
. 7000 here means that there are 70,000 images, and every image has more than
700 features: “784”. Because, as you can see, every image is 28 x 28 pixels, you
can imagine that every pixel is one feature.
Let’s take another example from the data set. You'll only need to grab an
instance’s feature, then make it 26 x 26 arrays, and then display them using the
imshow function:
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
yourDigit = X[36000]
Your_image = your_image.reshape(26, 26)
plt.imshow(Your_image, cmap = matplotlib.cm.binary,
interpolation="nearest")
plt.axis("off")
plt.show()
As you can see in the following image, it looks like the number five, and we can
give that a label that tells us it’s five.
In the following figure, you can see more complex classification tasks from the
MNIST data set.
Also, you should create a test set and make it before your data is inspected.
The MNIST data set is divided into two sets, one for training and one for testing.
x_tr, x_tes, y_tr, y_te = x [:60000], x[60000:], y[:60000], y[60000:]
Let’s play with your training set as follows to make the cross-validation to be
similar (without any missing of any digit)
Import numpy as np
myData = np.radom.permutaion(50000)
x_tr, y_tr = x_tr[myData], y_tr[myData]
Now it’s time to make it simple enough, we'll try to just identify one digit, e.g.
the number 6. This “6-detector” will be an example of the binary classifier, to
distinguish between 6 and not 6, so we'll create the vectors for this task:
Y_tr_6 = (y_tr == 6) // this means it will be true for 6s, and false for any other
number
Y_tes_6 = (Y_tes == 6)
After that, we can choose a classifier and train it. Begin with the SGD
(Stochastic Gradient Descent) classifier.
The Scikit-Learn class has the advantage of handling very large data sets. In this
example, the SGD will deal with instances separately, as follows.
from sklearn.linear_model import SGDClassifier
mycl = SGDClassifier (random_state = 42)
mycl.fit(x_tr, y_tr_6)
to use it to detect the 6
>>>mycl.prdict([any_digit)]
Measures of Performance
If you want to evaluate a classifier, this will be more difficult than a regressor, so
let’s explain how to evaluate a classifier.
In this example, we'll use across-validation to evaluate our model.
from sklearn.model_selection import StratifiedKFold
form sklearn.base import clone
sf = StratifiedKFold(n=2, ran_state = 40)
for train_index, test_index in sf.split(x_tr, y_tr_6):
cl = clone(sgd_clf)
x_tr_fd = x_tr[train_index]
y_tr_fd = (y_tr_6[train_index])
x_tes_fd = x_tr[test_index]
y_tes_fd = (y_tr_6[test_index])
cl.fit(x_tr_fd, y_tr_fd)
y_p = cl.predict(x_tes_fd)
print(n_correct / len(y_p))
. We use the StratifiedFold class to perform stratified sampling that produces
folds that contain a ration for every class. Next, every iteration in the code will
create a clone of the classifier to make predictions on the test fold. And finally, it
will count the number of correct predictions and their ratio
Now we're ready to get the matrix using the following code.
from sklearn.metrics import confusion_matrix
confusion_matrix (y_tr_6, y_tr_pred)
You'll get an array of 4 values ,“numbers”.
Every row represents a class in the matrix, and every column represents a
predicted class.
The first row is the negative one: that “contain non-6 images”. You can learn a
lot from the matrix.
But there is also a good one that's , interesting to work with if you'd like to get
the accuracy of the positive predictions, which is the precision of the classifier
using this equation.
Precision = (TP)/ (TP+FP)
TP: number of true positives
FP: number of false positives
Recall = (TP) /(TP+FN) “sensitivity”: it measure the ratio of positive instances.
Recall
>>> from sklearn.metrics import precision_score, recall_score
>>> precision_score(y_tr_6, y_pre)
>>>recall_score(y_tr_6, y_tr_pre)
It’s very common to combine precision and recall into just one metric, which is
the F1 score.
F1 is the mean of both precision and recall. We can calculate the F1 score with
the following equation:
F1 = 2 / ((1/precision) + (1)/recall)) = 2 * (precision * recall) / (precision +
recall) = (TP) / ((TP) + (FN+FP)/2)
To calculate the F1 score, simply use the following function:
>>> from sklearn.metrics import f1_score
>>>f1_score (y_tr_6, y_pre)
Recall Tradeoff
To get to this point, you should take a look at the SGDClassifier and how it
makes decisions regarding classifications. It calculates the score based on the
decision function, and then it compares the score with the threshold. If it’s
greater than this score, it will assign the instance to the “positive or negative”.
class
For example, if the decision threshold is at the center, you'll find 4 true + on the
right side of the threshold, and only one false. So the precision ratio will be only
80%.
In Scikit-Learn, you can't set a threshold directly. You'll need to access the
decision scores, which use predictions, and by y calling the decision function,
().
>>> y_sco = sgd_clf.decision_funciton([any digit])
>>> y_sco
>>> threshold = 0
>>>y_any_digit_pre = (y_sco > threshold)
In this code, the SGDClassifier contains a threshold, = 0, to return the same
result as the the predict () function.
>>> threshold = 20000
>>>y_any_digit_pre = (y_sco > threshold)
>>>y_any_digit_pre
This code will confirm that, when the threshold increases, the recall decreases.
y_sco = cross_val_predict (sgd_cl, x_tr, y_tr_6, cv =3, method=”decision
function)
It’s time to calculate all possible precision and recall for the threshold by calling
the precision_recall_curve()function
from sklearn.metrics import precision_recall_curve
precisions, recalls, threshold = precision_recall_curve (y_tr_6, y_sco)
and now let’s plot the precision and the recall using Matplotlib
def plot_pre_re(pre, re, thr):
plt.plot(thr, pre[:-1], “b—“, label = “precision”)
plt.plot(thr, re[:1], “g-“, label=”Recall”)
plt.xlabel(“Threshold”)
plt.legend(loc=”left”)
plt.ylim([0,1])
plot_pre_re(pre, re, thr)
plt.show
ROC
ROC stands for receiver operating characteristic and it's a tool that used with
binary classifiers.
This tool is similar to the recall curve, but it doesn’t plot the precision and recall:
it plots the positive rate
and false rate. You'll work also with FPR, which is the ratio of negative
samples. You can imagine if it's like (1 – negative rate. Another concept is the
TNR and it's the specificity. Recall = 1 – specificity.
Let’s play with the ROC Curve. First, we'll need to calculate the TPR and the
FPR, just by calling the roc-curve () function,
from sklearn.metrics import roc_curve
fp,tp, thers = roc_curve (y_tr_6, y_sco)
After that, you'll plot the FPR and TPR with Matplotlib according to the
following instructions.
def_roc_plot (fp, tp, label=none):
plt.plot(fp, tp, linewidth=2, label = label)
plt.plot([0,1)], [0,1], “k--”)
plt.axis([0,1,0,1])
plt.xlabel(‘This is the false rate’)
plt.ylabel(‘This is the true rate’)
roc_plot (fp, tp)
plt.show
Multi-class Classification
We use binary classifiers to distinguish between any two classes, but what if
you'd like to distinguish between more than two?
You can use something like random forest classifiers or Bayes classifiers, which
can compare between more than two. But, on the other hand, SVM (the Support
Vector Machine) and linear classifiers function like binary classifiers.
If you'd like to develop a system that classifies images of digit into 12 classes
(from 0 to 11) you'll need to train 12 binary classifiers, and make one for every
classifier (such as 4 – detector, 5-detector, 6-detector and so on ), and then you'll
need to get the DS, the “ decision score,” of every classifier for the image. Then,
you'll choose the highest score classifier. We call this the OvA strategy: “one-
versus-all.”
The other method is to train a binary classifier for each pair of digits; for
example, one for 5s and 6s and another one for 5s and 7s. — we call this method
OvO, “one-versus-one” — to count how many classifiers you'll need, based on
the number of classes that use the following equation: “N = number of classes”.
N * (N-1)/2. If you'd like to use this technique with the MNIST 10 * (10-1)/2,
the output will be 45 classifiers, “binary classifiers”.
In Scikit-Learn, you execute OvA automatically when you use a binary
classification algorithm.
>>> sgd_cl.fit(x_tr, y_tr)
>>>sgd_cl.Predict([any-digit])
Additionally, you can call the decision_function () to return the scores “10 scores
for one class”
>>>any_digit_scores = sgd_cl.decision_function([any_digit])
>>> any_digit_scores
Array([“num”, “num”, “num”, “num”, “num”, “num”, “num”, “num”, “num”
,”num”]])
Training a Random Forest Classifier
>>> forest.clf.fit(x_tr, y_tr)
>>> forest.clf.predict([any-digit])
array([num])
As you can see, training a random forest classifierwth only two lines of code is
very easy.
The Scikit-Learn didn’t execute any OvA or OvO functions because this kind of
algorithm — “random forest classifiers” — can automatically work multiple
classes. If you'd like to take a look at the list of classifier possibilities, you can
call the predict_oroba () function.
>>> forest_cl.predict_proba([any_digit])
array([[0.1, 0, 0, 0.1, 0, 0.8, 0, 0, 0]])
The classifier is very accurate with its prediction, as you can see in the output;
there is 0.8 at index number 5.
Let’s evaluate the classifier using the cross_val_score() function.
>>> cross_val_score(sgd_cl, x_tr, y_tr, cv=3, scoring = “accuracy”)
array([0.84463177, 0.859668, 0.8662669])
You'll get 84% more n the folds. When using a random classifier, you'll get, in
this case, 10% for the accuracy score. Keep in mind that the higher this value is,
the better.
Error Analysis
First of all, when developing a machine learning project:
1. Determine the problem;
2. Collect your data;
3. Work on your data and explore it;
4. Clean the data
5. Work with several models and choose the best one;
6. Combine your models into the solution;
7. Show your solution;
8. Execute and test your system.
First, you should work with the confusion matrix and make predictions by
the cross-val function. Next, you'll call the confusion matrix function:
First, you should divide every value in the matrix by the number of images in the
class, and then you'll compare the error rates.
rw_sm = cn_mx.sum(axis=1, keepdims=True)
nm_cn_mx = cn_mx / rw_sum
The next step is to make all the zeros on the diagonal, and that will keep the
errors from occurring.
np.fill_diagonal (nm_cn_mx, 0)
plt.matshow(nm_cn_mx, cmap=plt.cm.gray)
plt.show()
The errors are easy to spot in the above schema. One thing to keep in mind is
that the rows represent classes and the columns represent the predicted values.
Other documents randomly have
different content
Or, prying with most curious eye
Into dark hollows, to descry
Some robber haunt or hidden grot,
Where haply it might be my lot,
Like Alla-Ad-Deen, to find a treasure
Of gems and jewels without measure.
But what a change is wrought since then!
I've mingled with the world and men,
Who scoff at boyhood's guiltless joys,
Yet scorn them but for greater toys.
Well—let them mar their health for fame,
And waste their days, to gain a name,
Built on the rabble's wretched praise,
Whose voice awhile may sink or raise,
But cannot rescue from the lot
Old Time, the despot, hath assigned
Impartially to all earth's kind.
Such record vain I envy not,
Nor burn with mightier men to mate—
The followers of a fiercer fate,
Who trample on all human good
To win awards least understood.
Such is renown reaped with the sword—
Such glory! Empty, fatal word,
That lures men on through fire and flood—
Through scenes of rapine, crime and blood,
To write in history's page, a tale,
O'er which their fellow man grows pale.
Could half the tears they cause to flow
Bedew that page—how few could read
The blotted record of each deed,
Which laid the brave by thousands low
And broke more living hearts with wo,
That ONE might be what good men hate,
And fools and knaves miscal "THE GREAT."
ORIGINAL LITERARY NOTICES.
Nor does he attach less importance to the study of the Greek and
Roman languages. In the opinion of President Olin they "give useful
employment to the intellectual faculties at a period when they are
incompetent to more abstract and severe occupations. They call up
the attention to such short and easy, but repeated efforts, as are
best calculated to correct its wanderings and increase its energies.
The mind is accustomed to analysis and comparison, and its powers
of discrimination are improved by frequent exercises in declension,
inflexion and derivation, and by the constant necessity that is
imposed upon it, of deciding between the claims of rival definitions.
The memory is engaged in the performance of such tasks as are
precisely fitted for its development, and the judgment and other
reasoning faculties find ample and invigorating employment in the
application of grammatical rules, and the investigation of philological
principles." We wish we had space for the whole of Mr. Olin's
remarks upon classical learning. He considers the growing scepticism
in reference to its utility and importance as an evil omen.
Next to pure and mixed mathematics and the learned languages, the
President is inclined to give a place to intellectual philosophy. "It
familiarises the student with the laws and the phenomena of mind,
and with such efforts of subtle analysis and difficult combination as
are best fitted to enlarge and fill the grasp of the highest intellectual
capacities." He also recommends as subordinate, but highly
important studies—composition and eloquence—moral and natural
philosophy—chemistry—the French language—and geology and
mineralogy.
Upon the subject of moral restraint and college discipline, Mr. Olin is
forcible and interesting. With a mind well organized for the clear
perception of truth, we take the President to be fearless in
proclaiming his convictions, without stopping to calculate the
strength of opposing prejudices and opinions. He does not hesitate
to come up boldly to the mark, and to advocate the only rational
system by which our erring nature, and especially our youthful
nature, can be brought to a just sense of what is due to its own
interests, as well as to the requirements of society. Upon this
subject, however, we prefer that the President should speak for
himself.
"In proportion as virtue is more valuable than knowledge, pure
and enlightened morality will be regarded by every considerate
father the highest recommendation of a literary institution. The
youth is withdrawn from the salutary restraints of parental
influence and authority, and committed to other guardians, at a
time of life most decisive of his prospects and destinies. The
period devoted to education usually impresses its own character
upon all his future history. Vigilant supervision, employment,
and seclusion from all facilities and temptations to vice, are the
ordinary and essential securities which every institution of
learning is bound to provide for the sacred interests which are
committed to its charge. But safeguards and negative provisions
are not sufficient. The tendencies of our nature are retrograde,
and they call for the interposition of positive remedial
influences. The most perfect human society speedily
degenerates, if the active agencies which were employed in its
elevation are once withdrawn or suspended. What then can be
expected of inexperienced youth, sent forth from the pure
atmosphere of domestic piety, and left to the single support of
its own untested and unsettled principles, in the midst of
circumstances which often prove fatal to the most practised
virtue! I frankly confess that I see no safety but in the preaching
of the cross, and in a clear and unfaltering exhibition of the
doctrines and sanctions of christianity. The beauty and
excellence of virtue are excusable topics, though they must ever
be inefficient motives, with those who reject the authority of
revelation; but in a christian land, morality divorced from
religion, is the emptiest of all the empty names by which a
deceitful philosophy has blinded and corrupted the world. I
venture to affirm, that this generation has not given birth to
another absurdity so monstrous, as that which would exclude
from our seminaries of learning the open and vigorous
inculcation of the religious faith which is acknowledged by our
whole population, and which pervades every one of our free
institutions. Our governors and legislators, and all the
depositaries of honor and trust, are prohibited from exercising
their humblest functions till they have pledged their fidelity to
the country upon the holy gospels. The most inconsiderable
pecuniary interest is regarded too sacred to be entrusted to the
most upright judge or juror, or to the most unsuspected
witness, till their integrity has been fortified by an appeal to the
high sanctions of christianity. Even the exercise of the elective
franchise is usually suspended upon the same condition. The
interesting moralities of the domestic relations—the laws of
marriage and divorce—the mutual obligations of parents and
children—are all borrowed from the christian scriptures. The
fears of the vicious and the hopes of the upright—the profane
ribaldry of the profligate, no less than the humble thanksgiving
of the morning and evening sacrifice, do homage to the gospel
as the religion of the American people. Our eloquence and our
poetry—our periodical and popular literature in all their varieties
—the novel, the tale, the ballad, the play, all make their appeal
to the deep sentiments of religion that pervade the popular
bosom. Christianity is our birthright. It is the richest inheritance
bequeathed us by our noble fathers. It is mingled in our hearts
with all the fountains of sentiment and of faith. And are the
guardians of public education alone 'halting between two
opinions?' Do they think that in fact, and for practical purposes,
the truth of christianity is still a debateable question? Is it still a
question whether the generations yet to rise up and occupy the
wide domains of this great empire—to be the representatives of
our name, our freedom and our glory, before the nations of the
earth, shall be a christian or an infidel people? Can wise and
practical men who are engaged in rearing up a temple of
learning to form the character and destinies of their posterity,
for a moment hesitate to make 'Jesus Christ the chief corner
stone?"
A DISCOURSE ON THE LIFE AND CHARACTER OF WM. WIRT, late Attorney General of the
United States; pronounced at the request of the Baltimore Bar before the Citizens of
Baltimore, on the 20th of May, 1834, by John P. Kennedy. Baltimore: Wm. & Joseph
Neal. 1834.
"In taking this survey of the chief productions of Mr. Wirt's pen,
I am tempted to pause for a moment, to express my regret that
the pursuits of his life had not been more decidedly applied to
literary labors, than either circumstances or his own choice
seem to have permitted. He was remarkably qualified by the
character of his mind, and, I think I am warranted in saying, by
his inclination, to attain great distinction in these pursuits. A
career, in a larger degree, directed to this end would certainly
have been not less honorable to himself, nor less useful to his
country, and, I would fain persuade myself, not less profitable,—
although the consideration of gain be but an unworthy stimulant
to the glorious rewards which should interest the ambition of
genius. He had, however, a large family around him who
depended upon him for protection; and it may be that,
surveying the sad history of the gifted spirits who have lighted
the path of mankind with the lamps of their own minds and
made their race rich with the treasures of wisdom and science,
he has turned distrustfully from the yearnings of his ambition,
and followed the broader and more certain track that led to
professional fame and wealth. I can excuse him for the choice,
whilst I lament over the dispensation of human rule by which
the latter pursuits should have such an advantage.
"As a literary man he would have acquired a more permanent
renown than the nature of professional occupation or the
exercises of the forum are capable of conferring upon their
votaries. The pen of genius erects its own everlasting
monument; but the triumphs of the speaker's eloquence, vivid,
brilliant and splendid as they are, live but in the history of their
uncertain effects and in the intoxicating applause of the day:—
to incredulous posterity they are distrusted tradition, the
extravagant boasting of an elder age prone by its nature to
disparage the present by the narrated glories of the past. So
has it, even now, befallen the name of Patrick Henry, whom not
all his affectionate biographer's learned zeal has rescued from
the unbelieving smile of but a second generation. The glory of
Cicero lives more conspicuously in his written philosophy than
even in his speeches, which, although transmitted by his own
elaborate and polished hand, may rather be assigned to his
literary than to his forensic fame.
"He was a powerful orator, and had the art to sway courts and
juries with a master's spirit. The principal traits of his eloquence
were great clearness and force in laying the foundations of an
argument, and the steady pursuit of it through the track of
logical deduction. He was ingenious in choosing his position,
and, that once taken, his hearers were borne to his conclusion
upon a tide almost as irresistible as that which wafts the idle
skiff upon the Potomac, downward from the mountains to the
last cataract that meets the ebb and flood of the sea. In this
train of earnest argumentation the attention of his auditory was
kept alive by a vivid display of classic allusion, by flashes of wit
and merriment, and by the familiar imagery which was called in
aid to give point to his demonstrations, or light to what the
subject rendered obscure to the common apprehension. He
sometimes indulged in satire and invective, and, where the
subject called for it, in stern denunciation. Many have felt with
what indignant power these weapons have been wielded in his
hand. His utterance, in early life, was said to have been
confused and ungraceful. Practice had conquered these defects,
and no man spoke with a more full, effortless and unobstructed
fluency. His diction was scrupulously neat, and might have often
deceived an audience into the opinion that his speeches were
prepared in the closet. His manner was remarkably impressive.
Endowed with a commanding figure, a singularly graceful
carriage and with a countenance of manly and thoughtful
beauty, that struck an instant sense of respect into all that
looked upon him, he was pre-eminent in that most significant
trait of an orator, action. We can all remember the rich and
flowing music of that voice which was wont to stir the inmost
souls of our tribunals and bring down the loud applause of
delighted bystanders; the dignity with which we have seen his
majestic person dilate itself before the judgment seat; the
ineffable grace that beamed upon the broad expanse of his
brow, and the kindled transport of his fine face, in those wrapt
moments when his mind was all in a blaze with the inspirations
of his own eloquence. These were the rare gifts that imparted a
charm to his oratory, which often wrought more powerfully for
the success of his cause than even the efficacy of 'right words
set in order.'"
We shall conclude with one more passage, in which the man who
filled so large a space in the public eye—whose eloquence placed
him on the highest pedestal of fame, and whose writings have
charmed by their richness and beauty so many thousand readers—is
exhibited in a light more attractive and enduring than the highest
human attainments are able to bestow. Mr. Wirt looked far beyond
the narrow bounds of earth for his reward. He saw that neither
wealth, nor power, nor fame, could satisfy the immortal cravings of
the mind—and he lifted up his thoughtful eye to another and more
permanent state of being.
"Lastly, he was a zealous and faithful christian. In such a mind
as his, so inquiring, so masterly, so discriminating, religion was
the child of his judgment, not the creation of his passion. It was
an earnest, abiding sense of truth, and showed itself in daily
exercise and constant acknowledgment. With the sublime
system of revelation resting ever in his thoughts, the christian
law hung like a tablet upon his breast, and duty ever pointed
her finger to the sculptured commands that were graven there
to serve him as a manual of practice. He loved old forms and
old opinions, and, with something like a patriarch's reverence,
he headed his little family flock on their Sunday walks to church:
morning and evening he gathered them together, and on
bended knee, invoked his Father's blessing on his household;
and at the daily meal bowed his calm and prophet-like figure
over the family repast, to ask that grace of the Deity, on which
his heart rested with its liveliest hope, and to express that
thankfulness which filled and engrossed his soul. Such was this
man in the retirement of his domestic hearth, and thus did his
affections, in that little precinct, bloom with the daily increasing
virtues of love of family, of friends, of his country and of his
God."
and this is the book which has turned the brains of half Paris,
which has gone through fifteen editions in a few weeks, which
not to admire is 'pitoyable,' and not to have read 'quelque chose
d'inouie.'"
Again,
"This is the place to live in for the merry poor man, or the
melancholy rich one; for those who have too much money, and
those who have too little; for those who only wish like the
Irishman, 'to live all the days of their life,'—prendre en légère
monnoie la somme des plaisirs—but to the thinking, the feeling,
the domestic man, who only exists, enjoys, suffers through his
affections—
At Milan the fair invalid was induced to visit the Scala, where she
saw the Didone Abandonnato, a ballet by Vigano. This piece was
founded upon the loves of Dido and Eneas, and the celebrated
cavern scene in the 4th book of Virgil was copied almost to the life.
A noble English family just arrived at Milan, was present at the
performance, and the effect upon one of its members is thus
described:
"In the front of the box sat a beautiful girl, apparently not
fifteen, with laughing lips and dimpled cheeks, the very
personification of blooming, innocent, English loveliness. I
watched her, (I could not help it, when my interest was once
awakened,) through the whole scene. I marked her increased
agitation: I saw her cheeks flush, her eyes glisten, her bosom
flutter, as if with sighs I could not overhear, till at length,
overpowered with emotion, she turned away her head, and
covered her eyes with her hand. Mothers!—English mothers!
who bring your daughters abroad to finish their education—do
ye well to expose them to scenes like these, and force the
young bud of early feeling in such a precious hotbed as this?—
Can a finer finger on the piano,—a finer taste in painting, or any
possible improvement in foreign arts, and foreign graces,
compensate for one taint on that moral purity, which has ever
been, (and may it ever be!) the boast, the charm of
Englishwomen? But what have I to do with all this?—I came
here to be amused and to forget:—not to moralize, or to
criticise."
"After dinner I had a chair placed on the balcony of our inn, and
sat for some time contemplating a scene altogether new and
delightful. The arch of the Rialto, just gleamed through the
deepening twilight; long lines of palaces, at first partially
illuminated, faded away at length into gloomy and formless
masses of architecture; the gondolas glided to and fro, their
glancing lights reflected on the water. There was a stillness all
around me, solemn and strange in the heart of a great city. No
rattling carriages shook the streets, no trampling of horses
echoed along the pavement:—the silence was broken only by
the melancholy cry of the gondoliers, and the dash of their oars;
by the low murmur of human voices, by the chime of the vesper
bells, borne over the water, and the sounds of music raised at
intervals along the canals. The poetry, the romance of the scene
stole upon me unawares. I fell into a reverie, in which visionary
forms and recollections gave way to dearer and sadder realities,
and my mind seemed no longer in my own power. I called upon
the lost, the absent, to share the present with me—I called
upon past feelings to enhance that moment's delight. I did
wrong—and memory avenged herself as usual. I quitted my
seat on the balcony, with despair at my heart, and drawing to
the table took out my books and work. So passed our first
evening at Venice."
At Florence she met with the poet Rogers, who seems to have been
a familiar acquaintance:
"Rogers with equal good nature and good sense, neither noticed
these lines, nor withdrew his friendship and intimacy from the
writer."
The fine arts which are cultivated with so much distinction in the
"Etrurian Athens," attracted the particular attention of our
accomplished traveller. Referring to the Dutch school and the Salle
des Portraits,—she says,
"The Dutch and Flemish painters (in spite of their exquisite pots
and pans, and cabbages and carrots, their birch brooms, in
which you can count every twig, and their carpets in which you
can reckon every thread) do not interest me; their landscapes
too, however natural, are mere Dutch nature (with some
brilliant exceptions,) fat cattle, clipped trees, boors and wind-
mills. Of course I am not speaking of Vandyke, nor of Rubens,
he that 'in the colors of the rainbow lived,' nor of Rembrandt,
that king of clouds and shadows; but for mine own part, I would
give up all that Mieris, Netscher, Teniers and Gerard Duow ever
produced, for one of Claude's Eden-like creations, or one of
Guido's lovely heads—or merely for the pleasure of looking at
Titian's Flora once a day, I would give a whole gallery of
Dutchmen, if I had them."
But it was in Rome, "the city of the soul," that the spirit of the
authoress revelled amidst the magnificent trophies of art, and was
refreshed in spite of pain and despondency, by the reviving beauties
of nature.
On the Palatine Hill were the houses of Cicero and the Gracchi:
Horace, Virgil, and Ovid resided on the Aventine; and Mecænas
and Pliny on the Æsquiline. If one little fragment of a wall
remained, which could with any shadow of probability be
pointed out as belonging to the residence of Cicero, Horace, or
Virgil, how much dearer, how much more sanctified to memory
would it be than all the magnificent ruins of the fabrics of the
Cæsars! But no—all has passed away. I have heard the remains
of Rome coarsely ridiculed, because after the researches of
centuries, so little is comparatively known, because of the
endless disputes of antiquarians, and the night and ignorance in
which all is involved. But to the imagination there is something
singularly striking in this mysterious veil which hangs like a
cloud upon the objects around us. I trod to-day over shapeless
masses of building, extending in every direction as far as the
eye could reach. Who had inhabited the edifices I trampled
under my feet? What hearts had burned—what heads had
thought—what spirits had kindled there, where nothing was
seen but a wilderness and waste, and heaps of ruins, to which
antiquaries—even Nibby himself, dare not give a name? All
swept away—buried beneath an ocean of oblivion, above which
rise a few great and glorious names, like rocks, over which the
billows of time break in vain."
Her journey from Rome to Naples was short and delightful. The
following is one among innumerable descriptive passages in her
diary:
After spending the day with a select party of friends amidst the ruins
of Pompeii, she draws the following picture of the celebrated
environs of Naples.
"Of all the heavenly days we have had since we came to Naples,
this has been the most heavenly; and of all the lovely scenes I
have beheld in Italy, what I saw to-day has most enchanted my
senses and imagination. The view from the eminence on which
the old temple stood, and which was anciently the public
promenade, was splendidly beautiful: the whole landscape was
at one time overflowed with light and sunshine; and appeared
as if seen through an impalpable but dazzling veil. Towards
evening, the outlines became more distinct: the little white
towns perched upon the hills, the gentle sea, the fairy island of
Rivegliano with its old tower, the smoking crater of Vesuvius, the
bold forms of Mount Lactarius and Cape Minerva, stood out full
and clear under the cloudless sky; and as we returned, I saw
the sun sink behind Capri, which appeared by some optical
illusion, like a glorious crimson transparency suspended above
the horizon: the sky, the earth, the sea, were flushed with the
richest rose color, which gradually softened and darkened into
purple: the short twilight faded away, and the full moon, rising
over Vesuvius, lighted up the scenery with a softer radiance."
Again; what can be more affecting than her final adieu to Naples.
ebookball.com