Professional Documents
Culture Documents
PDF Just Enough R An Interactive Approach To Machine Learning and Analytics 1St Edition Richard J Roiger Ebook Full Chapter
PDF Just Enough R An Interactive Approach To Machine Learning and Analytics 1St Edition Richard J Roiger Ebook Full Chapter
https://textbookfull.com/product/artificial-intelligence-with-an-
introduction-to-machine-learning-2nd-edition-richard-e-
neapolitan/
https://textbookfull.com/product/physics-for-scientists-and-
engineers-an-interactive-approach-2nd-edition-peter-j-williams/
https://textbookfull.com/product/machine-learning-paradigms-
advances-in-learning-analytics-maria-virvou/
https://textbookfull.com/product/predictive-analytics-with-
microsoft-azure-machine-learning-barga/
Applied Analytics through Case Studies Using SAS and R:
Implementing Predictive Models and Machine Learning
Techniques Deepti Gupta
https://textbookfull.com/product/applied-analytics-through-case-
studies-using-sas-and-r-implementing-predictive-models-and-
machine-learning-techniques-deepti-gupta/
https://textbookfull.com/product/feature-engineering-for-machine-
learning-and-data-analytics-first-edition-dong/
https://textbookfull.com/product/business-analytics-using-r-a-
practical-approach-1st-edition-umesh-r-hodeghatta-dr/
https://textbookfull.com/product/abstract-algebra-an-interactive-
approach-second-edition-william-paulsen/
https://textbookfull.com/product/advanced-data-analytics-using-
python-with-machine-learning-deep-learning-and-nlp-examples-
mukhopadhyay/
Just Enough R!
. ( Taylor & Francis
Taylor & Francis Group
http://taylorandfrancis.com
Just Enough R!
An Interactive Approach to Machine
Learning and Analytics
Richard J. Roiger
Professor Emeritus, Computer Information Science Department,
Minnesota State University, Mankato
First edition published 2020
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot
assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers
have attempted to trace the copyright holders of all material reproduced in this publication and apologize to
copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been
acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or
utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including
photocopying, microfilming, and recording, or in any information storage or retrieval system, without written
permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com or contact the
Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. For works that are
not available on CCC please contact mpkbookspermissions@tandf.co.uk
Trademark notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Typeset in Minion
by codeMantra
Contents
Preface, xiii
Acknowledgment, xv
Author, xvii
v
vi ◾ Contents
Chapter 2 ◾ Introduction to R 25
2.1 INTRODUCING R AND RSTUDIO 25
2.1.1 Features of R 26
2.1.2 Installing R 26
2.1.3 Installing RStudio 28
2.2 NAVIGATING RSTUDIO 28
2.2.1 The Console 28
2.2.2 The Source Panel 30
2.2.3 The Global Environment 32
2.2.4 Packages 37
2.3 WHERE’S THE DATA? 38
2.4 OBTAINING HELP AND ADDITIONAL INFORMATION 38
2.5 SUMMARY 39
EXERCISES 39
BIBLIOGRAPHY, 321
T he title of my book reflects its purpose, which is to present just enough of the R
language, machine learning algorithms, statistical methodology, and analytics for you
to learn how to use data to solve complex problems. I wrote this book with two main goals
in mind:
• To make clear how, why, and when to use machine learning techniques
• To provide what you need to become productive with R as quickly as possible
Someone once said, “In order to learn something, you must almost already know it.” Several
of the scripts given in this book can be thought of as problem-solving templates that, with
slight modification, can be used again and again. As you develop a firm understanding of
these templates, using R will become second nature.
INTENDED AUDIENCE
In writing this text, I directed my attention toward four groups of individuals:
• Students who want to learn about machine learning and desire hands-on experience
with the R language
xiii
xiv ◾ Preface
SUPPLEMENTARY MATERIALS
All datasets and scripts used for illustrations and end-of-chapter exercises are described
in the text. The datasets come from several areas including business, health and medicine,
and science. The datasets and scripts can be downloaded at two locations:
If you have trouble obtaining any of these materials, please email me at: richard.roiger@
mnsu.edu
INSTRUCTOR SUPPLEMENTS
Supplements are provided to help the instructor organize lectures and write examinations.
Please note that these supplements are available to qualified instructors only. Contact
your CRC sales representative or get help by visiting https://www.crcpress.com/contactus
to access this material.
Acknowledgment
I am deeply indebted to my wife, Suzanne, for her extreme patience and consistent
support.
xv
. ( Taylor & Francis
Taylor & Francis Group
http://taylorandfrancis.com
Author
xvii
. ( Taylor & Francis
Taylor & Francis Group
http://taylorandfrancis.com
Chapter 1
Introduction to
Machine Learning
In This Chapter
1
2 ◾ Just Enough R!
• Building models to find structure in data has its roots in the fields of mathematics
and statistics. Statistical methods are differentiated from other techniques in that they
make certain assumptions about the nature of the data. Technically, if these assump-
tions are violated, the models built with these techniques may be inaccurate.
• Machine learning can be differentiated from statistical modeling in that assump-
tions about data distributions and variable independence are not a concern. Machine
learning is generally considered an area of specialization within the broader field of
artificial intelligence. However, most textbooks make little or no distinction between
machine learning and statistical methods.
• Data science or data analytics is often defined as the process of extracting meaningful
knowledge from data. Its methods come from several disciplines including computer
science, mathematics, statistics, data warehousing, and distributed processing to
name a few. Although machine learning is often seen in data science applications, it
is not required.
• Data mining first became popular in the academic community about 1995 and can
be defined as the process of using one or several machine learning algorithms to
find structure in data. The structure may take many forms including a set of rules,
a graph or network, a tree, one or several equations, and more. The structure can be
part of a complex visual dashboard or as simple as a list of political candidates and an
associated number representing voter sentiment based on twitter feeds.
• The phrase knowledge discovery in databases (KDD) was coined in 1989 to emphasize
that knowledge can be derived from data-driven discovery and is frequently used
interchangeably with data mining. In addition to performing data mining, a typical
KDD process model includes a methodology for extracting and preparing data as
well as making decisions about actions to be taken once data mining has taken place.
As much of today’s data is not found in a traditional data warehouse, KDD is most
often associated with knowledge discovery in data.
Although these general distinctions might be made, the most important point is that all
of these terms define techniques designed to solve problems by finding interesting struc-
ture in data. We prefer to use the term machine learning as our focus is both on how to
apply the algorithms and on understanding how the algorithms work. However, we often
interchange the terms machine learning and data mining.
Introduction to Machine Learning ◾ 3
1.2.1 Attribute-Value Format
To more clearly illustrate the idea of supervised learning, consider the hypothetical dataset
shown in Table 1.1. The dataset is very small and is relevant for illustrative purposes only.
The table data is displayed in attribute-value format where the first row shows names for
the attributes whose values are contained in the table. The attributes sore throat, fever, swol-
len glands, congestion, and headache are possible symptoms experienced by individuals
who have a particular affliction (a strep throat, a cold, or an allergy). These attributes are
known as input attributes and are used to create a model to represent the data. Diagnosis
is the attribute whose value we wish to predict. Diagnosis is known as the class, response,
or output attribute.
Starting with the second row of the table, each remaining row is an instance of data.
An individual row shows the symptoms and affliction of a single patient. For example, the
patient with ID = 1 has a sore throat, fever, swollen glands, congestion, and a headache. The
patient has been diagnosed as having strep throat.
Suppose we wish to develop a generalized model to represent the data shown in Table 1.1.
Even though this dataset is small, it would be difficult for us to develop a general represen-
tation unless we knew something about the relative importance of the individual attributes
and possible relationships among the attributes. Fortunately, an appropriate supervised
learning algorithm can do the work for us.
The decision tree tells us that we can accurately diagnose a patient in this dataset by
concerning ourselves only with whether the patient has swollen glands and a fever.
The attributes sore throat, congestion, and headache do not play a role in determining
a diagnosis. As you can see, the decision tree has generalized the data and provided us
with a summary of those attributes and attribute relationships important for an accurate
diagnosis.
Let’s use the decision tree to classify the first two instances shown in Table 1.2.
Swollen
Glands
No Yes
Fever
No Yes
• Since the patient with ID = 11 has a value of Yes for swollen glands, we follow the right
link from the root node of the decision tree. The right link leads to a terminal node,
indicating the patient has strep throat.
• The patient with ID = 12 has a value of No for swollen glands. We follow the left link
and check the value of the attribute fever. Since fever equals Yes, we diagnose the
patient with a cold.
We can translate any decision tree into a set of production rules. Production rules are rules
of the form:
IF antecedent conditions
THEN consequent conditions
The antecedent conditions detail values or value ranges for one or more input attributes. The
consequent conditions specify the values or value ranges for the output attributes. The tech-
nique for mapping a decision tree to a set of production rules is simple. A rule is created by
starting at the root node and following one path of the tree to a leaf node. The antecedent
of a rule is given by the attribute-value combinations seen along the path. The consequent
of the corresponding rule is the value at the leaf node. Here are the three production rules
for the decision tree shown in Figure 1.1:
Let’s use the production rules to classify the table instance with patient ID = 13. Because
swollen glands equals No, we pass over the first rule. Likewise, because fever equals No,
the second rule does not apply. Finally, both antecedent conditions for the third rule are
satisfied. Therefore, we are able to apply the third rule and diagnose the patient as having
an allergy.
The instances used to create the decision tree model are known as training data. At
this point, the training instances are the only instances known to be correctly classified
6 ◾ Just Enough R!
by the model. However, our model is useful to the extent that it can correctly classify new
instances whose classification is not known. To determine how well the model is able to be
of general use, we test the accuracy of the model using a test set. The instances of the test
set have a known classification. Therefore, we can compare the test set instance classifica-
tions determined by the model with the correct classification values. Test set classification
correctness gives us some indication about the future performance of the model.
Our decision tree example is a very simple example of one of several supervised learning
techniques. You will learn much more about decision trees in Chapter 6. Other supervised
techniques include rule-based systems (Chapter 7), some neural network structures
(Chapter 8), linear regression (Chapter 5), and many more. The next section examines the
general categories of machine learning strategies.
Machine Learning
Strategies
1.3.1 Classification
Classification is probably the best understood of all strategies. Classification tasks have
three common characteristics:
• Learning is supervised.
• The dependent variable is categorical.
• The emphasis is on building models able to assign new instances to one of a set of
well-defined classes.
Notice that each example deals with current, rather than future, behavior. For example, we
want the car loan application model to determine whether an applicant is a good credit risk at
this time rather than in some future time period. Prediction models are designed to answer
questions about future behavior. Prediction models are discussed later in this section.
1.3.2 Estimation
Like classification, the purpose of an estimation model is to determine a value for an
unknown output attribute. However, unlike classification, the output attribute for an
estimation problem is numeric rather than categorical. Here are three examples of
estimation tasks:
• Estimate the number of minutes before a thunderstorm will reach a given location.
• Estimate the return on investment for an advertising campaign.
• Estimate the likelihood that a credit card has been stolen.
Most supervised techniques are able to solve classification or estimation problems, but not
both. If our learning tool supports one strategy but not the other, we can usually adapt a
problem for solution by either strategy. To illustrate, suppose the output attribute for the orig-
inal training data in the stolen credit card example above is a numeric value between 0 and 1,
with 1 being a most likely case for a stolen card. We can make discrete categories for the out-
put attribute values by replacing scores ranging between 0.0 and 0.3 with the value unlikely,
8 ◾ Just Enough R!
scores between 0.3 and 0.7 with likely, and scores greater than 0.7 with highly likely. In this
case, the transformation between numeric values and discrete categories is straightforward.
Cases such as attempting to make monetary amounts discrete present more of a challenge.
1.3.3 Prediction
It is not easy to differentiate prediction from classification or estimation. However, unlike a
classification or estimation model, the purpose of a predictive model is to determine future
outcome rather than current behavior. The output attribute(s) of a predictive model can be
categorical or numeric. Here are several examples of tasks appropriate for predictive data
mining:
• Predict the total number of touchdowns a National Football League (NFL) running
back will score during the current NFL season.
• Determine whether a credit card customer is likely to take advantage of a special offer
made available with their credit card billing.
• Predict next week’s closing price for the Dow Jones Industrial Average.
• Forecast which cell phone subscribers are likely to change providers during the next
3 months.
The second dataset has categorical conversions for seven of the original numeric attributes.
The table column labeled Mixed Values shows the value Numeric for attributes that were
not converted to a categorical equivalent. For example, the values for attribute Age are
identical for both datasets. However, the attribute Fasting Blood Sugar < 120 has values
True or False in the converted dataset and values 0 and 1 in the original data.
Table 1.4 lists four instances from the mixed form of the dataset. Two of the instances
represent typical examples from each respective class. The remaining two instances are
atypical class members. Some differences between a typical healthy and a typical sick
patient are easily anticipated, for example, Resting ECG and Induced Angina. Surprisingly,
we do not see expected differences in cholesterol and blood pressure readings between
most and least typical healthy and individuals.
Here are two rules generated from this dataset. Class is specified as the output attribute:
TABLE 1.4 Typical and Atypical Instances from the Cardiology Domain
Typical Atypical Typical Sick Atypical Sick
Attribute Name Healthy Class Healthy Class Class Class
Age 52 63 60 62
Gender Male Male Male Female
Chest pain type NoTang Angina Asymptomatic Asymptomatic
Blood pressure 138 145 125 160
Cholesterol 223 233 258 164
Fasting blood False True False False
sugar < 120
Resting ECG Normal Hyp Hyp Hyp
Maximum heart 169 150 141 145
rate
Induced angina? False False True False
Old peak 0 2.3 2.8 6.2
Slope Up Down Flat Down
Number of 0 0 1 3
colored vessels
Thal Normal Fix Rev Rev
• IF Thal = Rev
THEN Class = Sick
Rule Precision: 76.30%
Rule Coverage: 38.90%
Let’s consider the first rule. Rule coverage gives us the percent of data instances that satisfy
the rule’s preconditions. Rule coverage reveals that of the 303 individuals represented in
the dataset, 40.6% or 123 patients have a maximum heart rate greater than 158.333. Rule
precision tells us that of the 123 individuals with maximum heart rate ≥ 158.333, 75.6% or
93 are healthy patients. That is, if a patient in the dataset has a maximum heart rate greater
than 158.333, we will be correct more than 75 times out of 100 in identifying the patient as
healthy. When we combine this knowledge with the maximum heart rate values shown in
Table 1.4, we are able to conclude that healthy patients are likely to have higher maximum
heart rate values.
Is this first rule appropriate for classification or prediction? If the rule is predictive, we
can use it to warn healthy folks with the statement:
Warning 1: Have your maximum heart rate checked on a regular basis. If your maximum heart
rate is low, you may be at risk of having a heart attack!
If the rule is appropriate for classification but not prediction, the scenario reads:
Warning 2: If you have a heart attack, expect your maximum heart rate to decrease.
Another random document with
no related content on Scribd:
realized that the phonograph had all along seemed to these people
more or less uncanny—the apparatus always stood so that they could
only see the mouthpiece and the smooth front, the rotating cylinder
being invisible to them. They had seen, indeed, that Knudsen or I
went through some manipulation of the instrument, but none of
them had formed any idea as to the nature of the process. Thus the
inexplicable assumed the aspect of the occult, and I was promoted to
the rank of a wizard who robbed people of their voices. I must in this
connection make honourable mention of the enterprising Zuza.
Once, though only after the spell had been broken in another way, he
seized a favourable opportunity to walk round the apparatus and see
the revolving cylinder. Since that day this intelligent man and the
more enlightened of his followers look on the phonograph as a mere
machine, as innocent as any other brought by the white man from
distant Ulaya.
In regard to my magic for stripping people of their clothes, I took
very energetic steps. We used all our persuasions to get a few men
and women to pose before the camera, took the photographs,
developed them on the spot, printed them and exhibited the finished
picture-postcards. “Well, are you naked in this picture, or are you
clothed? And are these the very same clothes you are now wearing on
your black bodies, or are they not?” Half-timid, half-startled at the
novel spectacle, both men and women stared at the wonder of the
picture; then they all went off with their portraits and the parting
injunction to tell everyone that the white man was no sorcerer and
did not rob people of their clothes, but that they were dressed in his
pictures exactly as in real life. This proved quite effectual, and to-day
the natives gather round us as confidingly as they did at first.
On the whole they might now save themselves the trouble, for I
find that I no longer require them. The objects they bring for sale are
the same as I already possess by the hundred, and my photographs
reveal no further novelties—it is always the same type, the same
keloids, the same pelele. I therefore find it best to devote the greater
part of my time to languages, and the remainder to desultory notes
on points which turn up of themselves during my excursions in the
neighbourhood. A few days ago, I came across the strangest thing I
have yet met with in this country where strange things are so
common. For some weeks past, Namalowe had spoken of a custom of
the Makua girls, who, he said, carry a collection of pebbles under
their tongues as in a nest. I had laughed at the man—with a
significant gesture towards my forehead—every time he said this.
The day before yesterday, we five were assembled in the baraza as
usual, and worrying ourselves over some peculiarly difficult forms in
Yao. Namalowe, being a Makua, was not wanted just then, so
excused himself and left the baraza. We were hardly thinking of him
when I heard steps approaching and a slender figure of a girl
appeared between the mat screen and the clay parapet, immediately
followed by that of the native teacher. The next moment the pretty
young creature stood before us, shyly smiling. “Hapa namangahlu,
Bwana” (“Here are the mouth-stones, sir”), said Namalowe, pointing
with a triumphant gesture to the girl’s mouth which was adorned
with a pelele of only moderate dimensions. We all rose to our feet in
the greatest excitement. Sefu, Namalowe and Akuchigombo all talked
to her at once for some time, and at last reluctantly putting her hand
to her mouth she produced an oval pebble, as large as the kernel of a
hazel-nut, worn quite smooth, and almost transparent, and held it
out to us on her open palm. A second, third and fourth followed, and
I stood dumb with surprise, while Namalowe could scarcely contain
himself for satisfaction. Is it a hallucination? or has the good
schoolmaster been cheating? The girl takes a fifth pebble out of her
mouth—then a sixth; at last, after the seventh and eighth, the nest
appears to be empty. My three savants informed me that these
namangahlu are quartz pebbles found in the gravel of all the rivers
hereabouts, though the finest and clearest are those from the
Rovuma, so that it is a point of honour for the young men to bring
them from thence as presents to their innamoratas. Pearl necklaces
and settings à jour are as yet beyond the aspirations of fashion on
the Makonde plateau, and pockets are also an unknown refinement
of luxury, so that the mouth is the only place for storing these jewels.
This at least is how I explain the unique method of carrying about the
stones. According to my informants, the meaning of the custom is
equivalent to a troth-plight, and therefore the pebbles are the African
for an engagement ring, except that, in contrast to the latter, they are
seen by no one but the lover. My first instinctive suspicion of a hoax
was, I may safely assume, unfounded. I have since studied the matter
on my own account, and found several young Makua women carrying
the stones in the manner described, so that I have independent
evidence for the custom.[63] It really seems as if there were no degree
of lunacy of which human beings are incapable!
The climate of Newala has been growing worse and worse. We
enjoyed a short interval of lovely weather resembling that of a fine
autumn in Central Germany; but now the mist shrouds the boma
every morning up to about half-past eight, and in the evening the
east wind blows more icily than ever. We two Europeans are afflicted
with chronic colds, and our men are in a sorry plight. They have not
much in the way of clothes, the carriers being without even a change
of calico; and the commissariat of the poor wretches is not all that
could be desired. When we consider in addition that the water is far
from pure, I am not surprised that the sick list grows from week to
week. On every side I hear indications of severe bronchial catarrh,
and almost fancy myself back again with Ewerbeck’s company of
coughers. Cases of dysentery, too, are not rare, neither are those of
sexual disease. Most of the patients have sufficient confidence in
their mzungu to come voluntarily and take in the most heroic
manner any kind of dawa that is put into their mouths. I have to
treat my soldiers in military fashion by having them up for medical
inspection from time to time. At the same time, as one might expect
from the native character, they will very often carry on a concurrent
treatment with mshenzi medicines. Whenever Knudsen and I take a
stroll along any of the roads leading out of Newala, we are pretty sure
to come upon curious objects at places where two paths meet or
cross. The ground has been carefully cleared of leaves, branches, etc.,
and in the middle of the level space thus made, an unknown hand
has traced with snow-white meal, a magic circle about a foot in
diameter and never quite regular. Within the circle little heaps of
flour are arranged according to some recognised system, with more
or less regularity, in rows of three or four.
AN OFFERING TO THE SPIRITS
It was some time before I could get any explanation of the object
and meaning of these figures, which I had also seen before coming to
Newala. This kind of therapeutics can only be understood if the
native’s views as to a life after death and the action of supernatural
powers are considered as a whole. In his belief human life by no
means ceases with death. It is true that the body is buried and
decomposes, but the soul lives on, and that in the same locality
where it was active during life. Its favourite abode is a conspicuous
tree. The religion of these southern tribes is thus distinctly tree-
worship, in so far as the natives sacrifice and pray to their deceased
ancestors by laying food and drink at the foot of such a tree, and
addressing their petitions to its crown.
LANDSCAPE ON THE ROVUMA. VIEW FROM MY CAMP UP
THE RIVER, IN LONG. 39° 6′ E.
The msolo tree (in Makonde mholo) is the one here distinguished
as the abode of the gods. To this tree the native goes when there is
sickness in his family, or when he is about to undertake a long
journey, or go on the war-path. He does not come empty-handed, but
decorates the trunk with coloured stuff, so that, with all the gaudy
rags previously fastened there by other distressed petitioners, the
spectacle presented is more curious than beautiful. He sweeps the
ground about the tree with a bunch of leaves, sprinkles flour on it,
and pours strengthening pombe into the jar placed there for the
purpose. These are the voluntary offerings of the living. But the giver
being only human, and not only human, but African, expects a quid
pro quo on the part of the dead. “I have given you cloth and brought
you meal and beer; you, my ancestor, know that we are going to war
against our enemies the Mavia. We are to march to-morrow; let no
bullet strike me, no arrow, and no spear.” The tree rustles in the
evening breeze, and the believer departs reassured.
But the souls do not always live in the msolo tree. As a rule, they
are restlessly wandering about the country, and naturally prefer the
main roads, as they did while in the flesh. There, and above all in
places where several roads meet, they are most commonly to be
found, and their protection is most likely to be successfully invoked.
This at least is the best explanation that occurs to me of the flour
offering being made by preference at the cross-roads. The sick see
the possibility of cure only, or at least principally, in the help of the
ancestral spirits who are presumably endowed with greater powers
than they enjoyed in this life. What, therefore, is more natural than
to sacrifice to these spirits at the spots which they may be supposed
to pass most frequently, at the cross-roads and at the junction of two
paths? This is the view taken by my informants, in which I am quite
disposed to concur; it seems extremely probable, while at the same
time I admit that there may conceivably be another idea underlying
the flour circles.
The planting of special trees at the graves seems to be closely
connected with tree-worship. In the plains—and among the Yaos in
particular—I noticed no such trees, but here on the plateau they are
very common. On recent graves I find young, slender saplings; in
other spots, where only the old men remember that anyone is buried,
there are enormous trees with mighty trunks sixty feet high and
more. More than one place near the boma of Newala is rendered
solemnly impressive by a number of such old sepulchral trees. The
tree is the one called kamuna, and is always planted at the head of
the grave.
TREES IN THE BURYING-GROUND AT NEWALA
Whether the natives believe that the spirit has its abode for a time
in these trees, I have hitherto been unable to make out. In fact, it is
exceedingly difficult to get any definite statements at all as to the
abiding-place of the soul. The Yaos gave no information whatever on
this point. The Makua said: “The shadow of the man goes to God,
and God lives up there.” But what the shadow does “up there,” and
how it fares in that mysterious abode, they, too, do not know. The
ghost stories current among the natives of these parts are horrible
and awe-inspiring enough, to judge by the specimens I have heard. I
will give one of them. Both Wayao and Wamakua have a ghost called
itondosha (or in Yao, ndondosha). If a magician has killed a child—
like all peoples in the primitive stage, the African does not look on
death as a natural occurrence, but always attributes it to magical
practices—he takes it out of the grave, brings it to life again, and cuts
off both legs at the knee-joint. The sorcerer throws away the severed
limbs, and sets the mutilated body of the child secretly in a certain
place. Then people come from every direction and bring the
itondosha porridge, beer, fruits and cloth. If this is done regularly
and in sufficient quantities, nothing more is heard of the ghost, but if
the people, as time goes on, forget it, it suddenly raises piercing and
uncanny shrieks, which frighten the people and cause them to renew
their offerings to the itondosha.[64]
With the usual good fortune which has attended my inquiries, I
obtained possession, quite accidentally, of a song referring to this
itondosha. This was given me by Anastasio, or as he called himself,
Anestehiu,[65] a pupil of the Universities’ Mission, who distinguished
himself among the inhabitants of Newala by his willingness to face
my phonograph. His zeal, indeed, was more conspicuous than his
musical ability, but his services to the cause of science deserve
recognition all the same.
The words of his song run as follows:—
“I went to Masasi; I went again to Masasi. In the evening I heard
screams; I turned round and saw the itondosha. ‘My cousin
Cheluka!’ (I cried), ‘Give me a gun and caps and a bullet.’ ‘Load it
yourself,’ (said my cousin). ‘Come and let us pursue the itondosha; it
went through a hole in the side wall of the house.’ My brother
(cousin) turned round and said: ‘It has its legs stretched out straight
before it, like a beard on the chin.’ It was seated, and we tried to tame
the itondosha, the girl of Ilulu. Elo (Yes), that is so.”
A less uncanny subject was broached by an old Makonde by means
of a little gift which he brought me. We had been talking about the
method of reckoning time among these tribes, and had arrived at the
fact that they were as backward, and at the same time as practical, in
this respect as in their way of marking the hours of the day.
The recording of events by means of knots on a string is a
contrivance adopted by mankind at different times and in different
places. The famous quipu of the Peruvians is one example. Others
have been discovered in the Pacific, and also in West Africa. Here on
the Makonde Plateau it is still in daily use, for the number of children
learning to read and write in the German Government Schools at
Lindi and Mikindani is as yet but small.
KNOTTED STRING SERVING AS CALENDAR
The only really tall man is old Makachu, the headman of the
neighbouring village, and at the same time the chief of one of the two
clans into which the Wangoni living here are divided. I measured
Makachu and found his height to be a fraction under six feet. If this
stature makes him look like Saul among his people, it is obvious how
very poorly developed the rest of them must be. Indeed the old men
of the tribe, as they drag themselves up to the baraza to talk to me,
seem quite emaciated with chronic underfeeding; and the rising
generation does not promise much better. “No—these are no Zulus,”
I said to myself on first seeing them; and I have since found this
conclusion confirmed by all sorts of proofs.
MAJALIWA, SAIDI AND MAKACHU
In the first place, there is not a single South African touch in the
arrangement and construction of their huts. The widely-scattered
villages, through which we have marched for the last few hours of the
road from Mahuta, are exactly like the villages in the plains west of
the plateau. The only difference is that the fields here appear to be
better kept, and to have been better cleared and broken up, to begin
with. But then it is one thing to clear ground in a large timber forest,
and another to burn off the sort of bush that grows up in these parts.
The details of hut-construction, too, are exactly the same, and the
interiors just as wildly untidy, and furnished with the same sort of
grain-stores, pots and bark boxes, the same bedsteads and the same
smouldering log on the hearth as at Mchauru or Akundonde’s; while
the outer walls are daubed over with the same sort of childish
paintings found elsewhere in the country.
But let us consider the language and history of this group of
people. Among my carriers we have in the person of Mambo sasa a
genuine Zulu, a Mngoni from Runsewe. These Wangoni are the
descendants of that wave of Zulus which penetrated furthest north.
While the main body of the warriors who, three quarters of a century
ago, crossed the Zambezi,[67] settled on both shores of Nyasa, and
founded kingdoms there, amid sanguinary struggles, these Wangoni
kept on northward along the eastern shore of Tanganyika, till their
advance, too, was checked in north-western Unyamwezi. Under the
name of Watuta, the descendants of these first conquerors continued
their predatory career for some decades, till Captain Langheld, in the
nineties, settled them in the bush at Runsewe where they now live.
“Now, Mambo sasa, you can go ahead and interpret!” I remarked to
my merry friend, when the Wangoni made their appearance. I have
already more than once mentioned Mambo; he is jester-in-ordinary
to the whole company; his voice, though not melodious, is powerful
and untiring, and his improvised ditties never cease during the day,
whether on the march or in camp. With the Wangoni of Nchichira
confronting the Mngoni from Runsewe, I prepared to take notes in
my usual way. Mambo, when I had made sure that he understood my
first question, repeated it in his mother tongue—but there was no
answer; the men simply stared at him in bewilderment. Repeated
experiments led to the same result; it was abundantly clear that the
alleged fellow-tribesmen could not understand one another’s speech.
Subsequently I questioned both parties separately, and noted down
as much of their respective languages as the incredible and equal
stupidity of the good Mambo sasa and the Nchichira elders would
allow. So far as I have been able to get a connected view of the result,
my supposition is confirmed; the Wangoni of this district have
nothing beyond the name in common with those in the hill country
near Songea. They are just such a congeries of broken tribes as we
find elsewhere in the south of our colony.
A clear proof that I am right in the above opinion was afforded me
when talking over the history of the tribe. After the giant Makachu,
my principal informant is old Majaliwa, within the area of whose
village the boma is built, and whose guests, in a manner of speaking,
we therefore are. He is also the chief of the second clan previously
mentioned. The younger and more “educated” element is
represented by Saidi, the teacher at Nkundi, who arrived to act as
interpreter in response to my urgent appeal for his help. The people
here are, after all, too primitive for anything. Half-a-dozen other
men, mostly elderly, who seem more concerned with expectorating
all over my baraza than with adding to my knowledge of their tribal
history, serve to fill up the background behind the above three
worthies.
In the first place Majaliwa and Makachu enlighten me as to their
respective families. The former belongs to the lukohu (= lukosyo) of
the Makale, the latter to that of the Wakwama. Makachu, the effect of
whose fine stature is somewhat spoilt by very high shoulders,
between which his head appears quite sunk, then, uninvited, begins
to relate how he was born near the Lukimwa River, but his people
were driven thence to the Mluhezi when he was a boy. Quite
mechanically, at the word boy, the old man, as he sits on the ground,
raises his arm to a horizontal position, and as mechanically his hand
rises so as to make a right angle with his arm. It was the Wangoni, he
goes on, who drove them away.
“The Wangoni?” I ask in astonishment, “but you are a Mngoni
yourself!”
“Yes, but it was the Wangoni, all the same.”
I thought it best for the moment not to confuse the old man, so
made no further remark, and he went on: “When my beard was just
beginning to grow”—Makachu’s short beard is now quite white—“the
Wangoni came again, but that time they were as many as the locusts,
and we were driven away as far as Namagone’s.”