100% found this document useful (1 vote)
683 views55 pages

Machine Learning With R The Tidyverse and MLR 1st Edition Hefin I Rhys 2024 Scribd Download

Rhys

Uploaded by

ribadudimpas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
683 views55 pages

Machine Learning With R The Tidyverse and MLR 1st Edition Hefin I Rhys 2024 Scribd Download

Rhys

Uploaded by

ribadudimpas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Machine Learning with R the tidyverse and mlr 1st


Edition Hefin I Rhys

https://textbookfull.com/product/machine-learning-with-r-
the-tidyverse-and-mlr-1st-edition-hefin-i-rhys/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


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

Machine Learning with R, the tidyverse, and mlr 1st


Edition Hefin Ioan Rhys

https://textbookfull.com/product/machine-learning-with-r-the-
tidyverse-and-mlr-1st-edition-hefin-ioan-rhys/

textboxfull.com

Supervised machine learning: optimization framework and


applications with SAS and R First Edition Kolosova

https://textbookfull.com/product/supervised-machine-learning-
optimization-framework-and-applications-with-sas-and-r-first-edition-
kolosova/
textboxfull.com

Introduction to machine learning with R rigorous


mathematical analysis First Edition Burger

https://textbookfull.com/product/introduction-to-machine-learning-
with-r-rigorous-mathematical-analysis-first-edition-burger/

textboxfull.com

Machine Learning with R Cookbook Second Edition Analyze


data and build predictive models Bhatia

https://textbookfull.com/product/machine-learning-with-r-cookbook-
second-edition-analyze-data-and-build-predictive-models-bhatia/

textboxfull.com
Machine Learning with Spark Nick Pentreath

https://textbookfull.com/product/machine-learning-with-spark-nick-
pentreath/

textboxfull.com

Statistical Inference via Data Science A ModernDive into R


and the Tidyverse Chapman Hall CRC The R Series 1st
Edition Chester Ismay
https://textbookfull.com/product/statistical-inference-via-data-
science-a-moderndive-into-r-and-the-tidyverse-chapman-hall-crc-the-r-
series-1st-edition-chester-ismay/
textboxfull.com

MATLAB Deep Learning: With Machine Learning, Neural


Networks and Artificial Intelligence 1st Edition Phil Kim

https://textbookfull.com/product/matlab-deep-learning-with-machine-
learning-neural-networks-and-artificial-intelligence-1st-edition-phil-
kim/
textboxfull.com

Deep Learning with R 1st Edition François Chollet

https://textbookfull.com/product/deep-learning-with-r-1st-edition-
francois-chollet/

textboxfull.com

Machine Learning with PySpark: With Natural Language


Processing and Recommender Systems 1st Edition Pramod
Singh
https://textbookfull.com/product/machine-learning-with-pyspark-with-
natural-language-processing-and-recommender-systems-1st-edition-
pramod-singh/
textboxfull.com
Machine Learning with R, the
tidyverse, and mlr
Hefin I. Rhys
Copyright
For online information and ordering of this and other Manning books,
please visit www.manning.com. The publisher offers discounts on
this book when ordered in quantity. For more information, please
contact

Special Sales Department

Manning Publications Co.

20 Baldwin Road

PO Box 761

Shelter Island, NY 11964

Email: [email protected]

©2020 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval


system, or transmitted, in any form or by means electronic,
mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to


distinguish their products are claimed as trademarks. Where those
designations appear in the book, and Manning Publications was
aware of a trademark claim, the designations have been printed in
initial caps or all caps.

Recognizing the importance of preserving what has been written,


it is Manning’s policy to have the books we publish printed on acid-
free paper, and we exert our best efforts to that end. Recognizing
also our responsibility to conserve the resources of our planet,
Manning books are printed on paper that is at least 15 percent
recycled and processed without the use of elemental chlorine.
Manning Publications Co.

20 Baldwin Road

PO Box 761

Shelter Island, NY 11964

Development editor: Marina Michaels

Technical development editor: Doug Warren

Review editor: Aleksandar Dragosavljević

Production editor: Lori Weidert

Copy editor: Tiffany Taylor

Proofreader: Katie Tennant

Technical proofreader: Kostas Passadis

Typesetter: Dennis Dalinnik

Cover designer: Marija Tudor

ISBN: 9781617296574

Printed in the United States of America


Brief Table of Contents
Copyright
Brief Table of Contents
Table of Contents
Preface
Acknowledgments
About this book
About the author
About the cover illustration

1. Introduction
Chapter 1. Introduction to machine learning
Chapter 2. Tidying, manipulating, and plotting data with the
tidyverse

2. Classification
Chapter 3. Classifying based on similarities with k-nearest
neighbors
Chapter 4. Classifying based on odds with logistic regression
Chapter 5. Classifying by maximizing separation with
discriminant analysis
Chapter 6. Classifying with naive Bayes and support vector
machines
Chapter 7. Classifying with decision trees
Chapter 8. Improving decision trees with random forests and
boosting

3. Regression
Chapter 9. Linear regression
Chapter 10. Nonlinear regression with generalized additive
models
Chapter 11. Preventing overfitting with ridge regression, LASSO,
and elastic net
Chapter 12. Regression with kNN, random forest, and XGBoost

4. Dimension reduction
Chapter 13. Maximizing variance with principal component
analysis
Chapter 14. Maximizing similarity with t-SNE and UMAP
Chapter 15. Self-organizing maps and locally linear embedding

5. Clustering
Chapter 16. Clustering by finding centers with k-means
Chapter 17. Hierarchical clustering
Chapter 18. Clustering based on density: DBSCAN and OPTICS
Chapter 19. Clustering based on distributions with mixture
modeling
Chapter 20. Final notes and further reading

Appendix. Refresher on statistical concepts

Index

List of Figures

List of Tables

List of Listings
Table of Contents
Copyright
Brief Table of Contents
Table of Contents
Preface
Acknowledgments
About this book
About the author
About the cover illustration

1. Introduction
Chapter 1. Introduction to machine learning
1.1. What is machine learning?
1.1.1. AI and machine learning
1.1.2. The difference between a model and an algorithm

1.2. Classes of machine learning algorithms


1.2.1. Differences between supervised, unsupervised, and semi-
supervised learning
1.2.2. Classification, regression, dimension reduction, and
clustering
1.2.3. A brief word on deep learning

1.3. Thinking about the ethical impact of machine learning


1.4. Why use R for machine learning?
1.5. Which datasets will we use?
1.6. What will you learn in this book?
Summary

Chapter 2. Tidying, manipulating, and plotting data with the


tidyverse
2.1. What is the tidyverse, and what is tidy data?
2.2. Loading the tidyverse
2.3. What the tibble package is and what it does
2.3.1. Creating tibbles
2.3.2. Converting existing data frames into tibbles
2.3.3. Differences between data frames and tibbles

2.4. What the dplyr package is and what it does


2.4.1. Manipulating the CO2 dataset with dplyr
2.4.2. Chaining dplyr functions together

2.5. What the ggplot2 package is and what it does


2.6. What the tidyr package is and what it does
2.7. What the purrr package is and what it does
2.7.1. Replacing for loops with map()
2.7.2. Returning an atomic vector instead of a list
2.7.3. Using anonymous functions inside the map() family
2.7.4. Using walk() to produce a function’s side effects
2.7.5. Iterating over multiple lists simultaneously

Summary
Solutions to exercises

2. Classification
Chapter 3. Classifying based on similarities with k-nearest
neighbors
3.1. What is the k-nearest neighbors algorithm?
3.1.1. How does the k-nearest neighbors algorithm learn?
3.1.2. What happens if the vote is tied?

3.2. Building your first kNN model


3.2.1. Loading and exploring the diabetes dataset
3.2.2. Using mlr to train your first kNN model
3.2.3. Telling mlr what we’re trying to achieve: Defining the task
3.2.4. Telling mlr which algorithm to use: Defining the learner
3.2.5. Putting it all together: Training the model

3.3. Balancing two sources of model error: The bias-variance


trade-off
3.4. Using cross-validation to tell if we’re overfitting or
underfitting
3.5. Cross-validating our kNN model
3.5.1. Holdout cross-validation
3.5.2. K-fold cross-validation
3.5.3. Leave-one-out cross-validation

3.6. What algorithms can learn, and what they must be told:
Parameters and hyperparameters
3.7. Tuning k to improve the model
3.7.1. Including hyperparameter tuning in cross-validation
3.7.2. Using our model to make predictions

3.8. Strengths and weaknesses of kNN


Summary
Solutions to exercises

Chapter 4. Classifying based on odds with logistic regression


4.1. What is logistic regression?
4.1.1. How does logistic regression learn?
4.1.2. What if we have more than two classes?

4.2. Building your first logistic regression model


4.2.1. Loading and exploring the Titanic dataset
4.2.2. Making the most of the data: Feature engineering and
feature selection
4.2.3. Plotting the data
4.2.4. Training the model
4.2.5. Dealing with missing data
4.2.6. Training the model (take two)

4.3. Cross-validating the logistic regression model


4.3.1. Including missing value imputation in cross-validation
4.3.2. Accuracy is the most important performance metric,
right?

4.4. Interpreting the model: The odds ratio


4.4.1. Converting model parameters into odds ratios
4.4.2. When a one-unit increase doesn’t make sense

4.5. Using our model to make predictions


4.6. Strengths and weaknesses of logistic regression
Summary
Solutions to exercises

Chapter 5. Classifying by maximizing separation with


discriminant analysis
5.1. What is discriminant analysis?
5.1.1. How does discriminant analysis learn?
5.1.2. What if we have more than two classes?
5.1.3. Learning curves instead of straight lines: QDA
5.1.4. How do LDA and QDA make predictions?

5.2. Building your first linear and quadratic discriminant models


5.2.1. Loading and exploring the wine dataset
5.2.2. Plotting the data
5.2.3. Training the models

5.3. Strengths and weaknesses of LDA and QDA


Summary
Solutions to exercises

Chapter 6. Classifying with naive Bayes and support vector


machines
6.1. What is the naive Bayes algorithm?
6.1.1. Using naive Bayes for classification
6.1.2. Calculating the likelihood for categorical and continuous
predictors

6.2. Building your first naive Bayes model


6.2.1. Loading and exploring the HouseVotes84 dataset
6.2.2. Plotting the data
6.2.3. Training the model

6.3. Strengths and weaknesses of naive Bayes


6.4. What is the support vector machine (SVM) algorithm?
6.4.1. SVMs for linearly separable data
6.4.2. What if the classes aren’t fully separable?
6.4.3. SVMs for non-linearly separable data
6.4.4. Hyperparameters of the SVM algorithm
6.4.5. What if we have more than two classes?

6.5. Building your first SVM model


6.5.1. Loading and exploring the spam dataset
6.5.2. Tuning our hyperparameters
6.5.3. Training the model with the tuned hyperparameters

6.6. Cross-validating our SVM model


6.7. Strengths and weaknesses of the SVM algorithm
Summary
Solutions to exercises
Chapter 7. Classifying with decision trees
7.1. What is the recursive partitioning algorithm?
7.1.1. Using Gini gain to split the tree
7.1.2. What about continuous and multilevel categorical
predictors?
7.1.3. Hyperparameters of the rpart algorithm

7.2. Building your first decision tree model


7.3. Loading and exploring the zoo dataset
7.4. Training the decision tree model
7.4.1. Training the model with the tuned hyperparameters

7.5. Cross-validating our decision tree model


7.6. Strengths and weaknesses of tree-based algorithms
Summary

Chapter 8. Improving decision trees with random forests and


boosting
8.1. Ensemble techniques: Bagging, boosting, and stacking
8.1.1. Training models on sampled data: Bootstrap aggregating
8.1.2. Learning from the previous models’ mistakes: Boosting
8.1.3. Learning from predictions made by other models:
Stacking

8.2. Building your first random forest model


8.3. Building your first XGBoost model
8.4. Strengths and weaknesses of tree-based algorithms
8.5. Benchmarking algorithms against each other
Summary

3. Regression
Chapter 9. Linear regression
9.1. What is linear regression?
9.1.1. What if we have multiple predictors?
9.1.2. What if our predictors are categorical?

9.2. Building your first linear regression model


9.2.1. Loading and exploring the Ozone dataset
9.2.2. Imputing missing values
9.2.3. Automating feature selection
9.2.4. Including imputation and feature selection in cross-
validation
9.2.5. Interpreting the model

9.3. Strengths and weaknesses of linear regression


Summary
Solutions to exercises

Chapter 10. Nonlinear regression with generalized additive


models
10.1. Making linear regression nonlinear with polynomial terms
10.2. More flexibility: Splines and generalized additive models
10.2.1. How GAMs learn their smoothing functions
10.2.2. How GAMs handle categorical variables

10.3. Building your first GAM


10.4. Strengths and weaknesses of GAMs
Summary
Solutions to exercises

Chapter 11. Preventing overfitting with ridge regression, LASSO,


and elastic net
11.1. What is regularization?
11.2. What is ridge regression?
11.3. What is the L2 norm, and how does ridge regression use
it?
11.4. What is the L1 norm, and how does LASSO use it?
11.5. What is elastic net?
11.6. Building your first ridge, LASSO, and elastic net models
11.6.1. Loading and exploring the Iowa dataset
11.6.2. Training the ridge regression model
11.6.3. Training the LASSO model
11.6.4. Training the elastic net model

11.7. Benchmarking ridge, LASSO, elastic net, and OLS against


each other
11.8. Strengths and weaknesses of ridge, LASSO, and elastic net
Summary
Solutions to exercises

Chapter 12. Regression with kNN, random forest, and XGBoost


12.1. Using k-nearest neighbors to predict a continuous variable
12.2. Using tree-based learners to predict a continuous variable
12.3. Building your first kNN regression model
12.3.1. Loading and exploring the fuel dataset
12.3.2. Tuning the k hyperparameter

12.4. Building your first random forest regression model


12.5. Building your first XGBoost regression model
12.6. Benchmarking the kNN, random forest, and XGBoost
model-building processes
12.7. Strengths and weaknesses of kNN, random forest, and
XGBoost
Summary
Solutions to exercises
4. Dimension reduction
Chapter 13. Maximizing variance with principal component
analysis
13.1. Why dimension reduction?
13.1.1. Visualizing high-dimensional data
13.1.2. Consequences of the curse of dimensionality
13.1.3. Consequences of collinearity
13.1.4. Mitigating the curse of dimensionality and collinearity by
using dimension reduction

13.2. What is principal component analysis?


13.3. Building your first PCA model
13.3.1. Loading and exploring the banknote dataset
13.3.2. Performing PCA
13.3.3. Plotting the result of our PCA
13.3.4. Computing the component scores of new data

13.4. Strengths and weaknesses of PCA


Summary
Solutions to exercises

Chapter 14. Maximizing similarity with t-SNE and UMAP


14.1. What is t-SNE?
14.2. Building your first t-SNE embedding
14.2.1. Performing t-SNE
14.2.2. Plotting the result of t-SNE

14.3. What is UMAP?


14.4. Building your first UMAP model
14.4.1. Performing UMAP
14.4.2. Plotting the result of UMAP
14.4.3. Computing the UMAP embeddings of new data
14.5. Strengths and weaknesses of t-SNE and UMAP
Summary
Solutions to exercises

Chapter 15. Self-organizing maps and locally linear embedding


15.1. Prerequisites: Grids of nodes and manifolds
15.2. What are self-organizing maps?
15.2.1. Creating the grid of nodes
15.2.2. Randomly assigning weights, and placing cases in nodes
15.2.3. Updating node weights to better match the cases inside
them

15.3. Building your first SOM


15.3.1. Loading and exploring the flea dataset
15.3.2. Training the SOM
15.3.3. Plotting the SOM result
15.3.4. Mapping new data onto the SOM

15.4. What is locally linear embedding?


15.5. Building your first LLE
15.5.1. Loading and exploring the S-curve dataset
15.5.2. Training the LLE
15.5.3. Plotting the LLE result

15.6. Building an LLE of our flea data


15.7. Strengths and weaknesses of SOMs and LLE
Summary
Solutions to exercises

5. Clustering
Chapter 16. Clustering by finding centers with k-means
16.1. What is k-means clustering?
16.1.1. Lloyd’s algorithm
16.1.2. MacQueen’s algorithm
16.1.3. Hartigan-Wong algorithm

16.2. Building your first k-means model


16.2.1. Loading and exploring the GvHD dataset
16.2.2. Defining our task and learner
16.2.3. Choosing the number of clusters
16.2.4. Tuning k and the algorithm choice for our k-means
model
16.2.5. Training the final, tuned k-means model
16.2.6. Using our model to predict clusters of new data

16.3. Strengths and weaknesses of k-means clustering


Summary
Solutions to exercises

Chapter 17. Hierarchical clustering


17.1. What is hierarchical clustering?
17.1.1. Agglomerative hierarchical clustering
17.1.2. Divisive hierarchical clustering

17.2. Building your first agglomerative hierarchical clustering


model
17.2.1. Choosing the number of clusters
17.2.2. Cutting the tree to select a flat set of clusters

17.3. How stable are our clusters?


17.4. Strengths and weaknesses of hierarchical clustering
Summary
Solutions to exercises

Chapter 18. Clustering based on density: DBSCAN and OPTICS


18.1. What is density-based clustering?
18.1.1. How does the DBSCAN algorithm learn?
18.1.2. How does the OPTICS algorithm learn?

18.2. Building your first DBSCAN model


18.2.1. Loading and exploring the banknote dataset
18.2.2. Tuning the epsilon and minPts hyperparameters

18.3. Building your first OPTICS model


18.4. Strengths and weaknesses of density-based clustering
Summary
Solutions to exercises

Chapter 19. Clustering based on distributions with mixture


modeling
19.1. What is mixture model clustering?
19.1.1. Calculating probabilities with the EM algorithm
19.1.2. EM algorithm expectation and maximization steps
19.1.3. What if we have more than one variable?

19.2. Building your first Gaussian mixture model for clustering


19.3. Strengths and weaknesses of mixture model clustering
Summary
Solutions to exercises

Chapter 20. Final notes and further reading


20.1. A brief recap of machine learning concepts
20.1.1. Supervised, unsupervised, and semi-supervised learning
20.1.2. Balancing the bias-variance trade-off for model
performance
20.1.3. Using model validation to identify over-/underfitting
20.1.4. Maximizing model performance with hyperparameter
tuning
20.1.5. Using missing value imputation to deal with missing data
20.1.6. Feature engineering and feature selection
20.1.7. Improving model performance with ensemble techniques
20.1.8. Preventing overfitting with regularization

20.2. Where can you go from here?


20.2.1. Deep learning
20.2.2. Reinforcement learning
20.2.3. General R data science and the tidyverse
20.2.4. mlr tutorial and creating new learners/metrics
20.2.5. Generalized additive models
20.2.6. Ensemble methods
20.2.7. Support vector machines
20.2.8. Anomaly detection
20.2.9. Time series
20.2.10. Clustering
20.2.11. Generalized linear models
20.2.12. Semi-supervised learning
20.2.13. Modeling spectral data

20.3. The last word

Appendix. Refresher on statistical concepts


A.1. Data vocabulary
A.1.1. Sample vs. population
A.1.2. Rows and columns
A.1.3. Variable types

A.2. Vectors
A.3. Distributions
A.4. Sigma notation
A.5. Central tendency
A.5.1. Arithmetic mean
A.5.2. Median
A.5.3. Mode

A.6. Measures of dispersion


A.6.1. Mean absolute deviation
A.6.2. Standard deviation
A.6.3. Variance
A.6.4. Interquartile range

A.7. Measures of the relationships between variables


A.7.1. Covariance
A.7.2. Pearson correlation coefficient

A.8. Logarithms

Index

List of Figures

List of Tables

List of Listings
Preface
While working on my PhD, I made heavy use of statistical modeling
to better understand the processes I was studying. R was my
language of choice, and that of my peers in life science academia.
Given R’s primary purpose as a language for statistical computing, it
is unparalleled when it comes to building linear models.

As my project progressed, the types of data problems I was working


on changed. The volume of data increased, and the goal of each
experiment became more complex and varied. I was now working
with many more variables, and problems such as how to visualize
the patterns in data became more difficult. I found myself more
frequently interested in making predictions on new data, rather than,
or in addition to, just understanding the underlying biology itself.
Sometimes, the complex relationships in the data were difficult to
represent manually with traditional modeling methods. At other
times, I simply wanted to know how many distinct groups existed in
the data.

I found myself more and more turning to machine learning


techniques to help me achieve my goals. For each new problem, I
searched my existing mental toolbox of statistical and machine
learning skills. If I came up short, I did some research: find out how
others had solved similar problems, try different methods, and see
which gave the best solution. Once my appetite was whetted for a
new set of techniques, I read a textbook on the topic. I usually
found myself frustrated that the books I was reading tended to be
aimed towards people with degrees in statistics.

As I built my skills and knowledge slowly (and painfully), an


additional source of frustration came from the way in which machine
learning techniques in R are spread disparately between a plethora
of different packages. These packages are written by different
authors who all use different syntax and arguments. This meant an
additional challenge when learning a new technique. At this point I
became very jealous of the scikit-learn package from the Python
language (which I had not learned), which provides a common
interface for a large number of machine learning techniques.

But then I discovered R packages like caret and mlr, which suddenly
made my learning experience much easier. Like scikit-learn, they
provide a common interface for a large number of machine learning
techniques. This took away the cognitive load of needing to learn
the R functions for another package each time I wanted to try
something new, and made my machine learning projects much
simpler and faster. As a result of using (mostly) the mlr package, I
found that the handling of data actually became the most time
consuming and complicated part of my work. After doing some more
research, I discovered the tidyverse set of packages in R, whose
purpose is to make the handling, transformation, and visualization of
data simple, streamlined, and reproducible. Since then, I’ve used
tools from the tidyverse in all of my projects.

I wanted to write this book because machine learning knowledge is


in high demand. There are lots of resources available to budding
data scientists or anyone looking to train computers to solve
problems. But I’ve struggled to find resources that simultaneously
are approachable to newcomers, teach rigor and good practice, and
use the mlr and tidyverse packages. My aim when writing this book
has been to have as little code as possible do as much as possible.
In this way, I hope to make your learning experience easier, and
using the mlr and tidyverse packages has, I think, helped me do
that.
Acknowledgments
When starting out on this process, I was extremely naive as to how
much work it would require. It took me longer to write than I
thought, and would have taken an awful lot longer were it not for
the support of several people. The quality of the content would also
not be anywhere near as high without their help.

Firstly, and most importantly, I would like to thank you, my husband,


Zand. From the outset of this project, you understood what this
book meant to me and did everything you could to give me time and
space to write it. For a whole year, you’ve put up with me working
late into the night, given up weekends, and allowed me to shirk my
domestic duties in favor of writing. I love you.

I thank you, Marina Michaels, my development editor at Manning—


without you, this book would read more like the ramblings of an idiot
than a coherent textbook. Early on in the writing process, you beat
out my bad habits and made me a better writer and a better teacher.
Thank you also for our long, late-night discussions about the
difference between American cookies and British biscuits. Thank you,
my technical development editor, Doug Warren—your insights as a
prototype reader made the content much more approachable. Thank
you, my technical proofreader, Kostas Passadis—you checked my
code and theory, and told me when I was being stupid. I owe the
technical accuracy of the book to you.

Thank you, Stephen Soenhlen, for giving me this amazing


opportunity. Without you, I would never had the confidence to think
I could write a book. Finally, a thank-you goes to all the other staff
at Manning who worked on the production and promotion, and my
reviewers who provided invaluable feedback: Aditya Kaushik, Andrew
Hamor, David Jacobs, Erik Sapper, Fernando Garcia, Izhar Haq,
Jaromir D.B. Nemec, Juan Rufes, Kay Engelhardt, Lawrence L.
Matias, Luis Moux-Dominguez, Mario Giesel, Miranda Whurr, Monika
Jakubczak, Prabhuti Prakash, Robert Samohyl, Ron Lease, and Tony
Holdroyd.
About this book
Who should read this book
I firmly believe that machine learning should not be the domain only
of computer scientists and people with degrees in mathematics.
Machine learning with R, the tidyverse, and mlr doesn’t assume you
come from either of these backgrounds. To get the most from the
book, though, you should be reasonably familiar with the R
language. It will help if you understand some basic statistical
concepts, but all that you’ll need is included as a statistics refresher
in the appendix, so head there first to fill in any gaps in your
knowledge. Anyone with a problem to solve, and data that contains
the answer to that problem, can benefit from the topics taught in
this book.

If you are a newcomer to R and want to learn or brush up on your


basic R skills, I suggest you take a look at R in Action, by Robert I.
Kabacoff (Manning, 2015).

How this book is organized: A roadmap


This book has 5 parts, covering 20 chapters. The first part of the
book is designed to get you up and running with some of the broad
machine learning and R skills you’ll use throughout the rest of the
book. The first chapter is designed to get your machine learning
vocabulary up to speed. The second chapter will teach you a large
number of tidyverse functions that will improve your general R data
science skills.

The second part of the book will introduce you to a range of


algorithms used for classification (predicting discrete categories).
From this part of the book onward, each chapter will start by
teaching how a particular algorithm works, followed by a worked
example of that algorithm. These explanations are graphical, with
mathematics provided optionally for those who are interested.
Throughout the chapters, you will find exercises to help you develop
your skills.

The third, fourth, and fifth parts of the book are dedicated to
algorithms for regression (predicting continuous variables),
dimension reduction (compressing information into fewer variables),
and clustering (identifying groups within data), respectively. Finally,
the last chapter of the book will recap the important, broad concepts
we covered, and give you a roadmap of where you can go to further
your learning.

In addition, there is an appendix containing a refresher on some


basic statistical concepts we’ll use throughout the book. I
recommend you at least flick through the appendix to make sure you
understand the material there, especially if you don’t come from a
statistical background.

About the code


As this book is written with the aim of getting you to code through
the examples along with me, you’ll find R code throughout most of
the chapters. You’ll find R code both in numbered listings and in line
with normal text. In both cases, source code is formatted in a fixed-
width font like this to separate it from ordinary text.

All of the source code is freely available at


https://www.manning.com/books/machine-learning-with-r-the-
tidyverse-and-mlr. The R code in this book was written with R 3.6.1,
with mlr version 2.14.0, and tidyverse version 1.2.1.

liveBook discussion forum


Purchase of Machine Learning with R, the tidyverse, and mlr includes
free access to a private web forum run by Manning Publications
where you can make comments about the book, ask technical
questions, and receive help from the author and from other users.
To access the forum, go to
https://livebook.manning.com/#!/book/machine-learning-with-r-the-
tidyverse-and-mlr. You can also learn more about Manning’s forums
and the rules of conduct at
https://livebook.manning.com/#!/discussion.

Manning’s commitment to our readers is to provide a venue where a


meaningful dialogue between individual readers and between
readers and the author can take place. It is not a commitment to
any specific amount of participation on the part of the author, whose
contribution to the forum remains voluntary (and unpaid). We
suggest you try asking some challenging questions lest their interest
stray! The forum and the archives of previous discussions will be
accessible from the publisher’s website as long as the book is in
print.
About the author
Hefin I. Rhys is a life scientist and cytometrist with eight years of
experience teaching R, statistics, and machine learning. He has
contributed his statistical/machine learning knowledge to multiple
academic studies. He has a passion for teaching statistics, machine
learning, and data visualization.
About the cover illustration
The figure on the cover of Machine Learning with R, the tidyverse,
and mlr is captioned “Femme de Jerusalem,” or “Woman of
Jerusalem.” The illustration is taken from a collection of dress
costumes from various countries by Jacques Grasset de Saint-
Sauveur (1757–1810), titled Costumes Civils Actuels de Tous les
Peuples Connus, published in France in 1788. Each illustration is
finely drawn and colored by hand. The rich variety of Grasset de
Saint-Sauveur’s collection reminds us vividly of how culturally apart
the world’s towns and regions were just 200 years ago. Isolated
from each other, people spoke different dialects and languages. In
the streets or in the countryside, it was easy to identify where they
lived and what their trade or station in life was just by their dress.

The way we dress has changed since then, and the diversity by
region, so rich at the time, has faded away. It is now hard to tell
apart the inhabitants of different continents, let alone different
towns, regions, or countries. Perhaps we have traded cultural
diversity for a more varied personal life—certainly, for a more varied
and fast-paced technological life.

At a time when it is hard to tell one computer book from another,


Manning celebrates the inventiveness and initiative of the computer
business with book covers based on the rich diversity of regional life
of two centuries ago, brought back to life by Grasset de Saint-
Sauveur’s pictures.
Random documents with unrelated
content Scribd suggests to you:
Preußens Geschichte
von R u d o l f H e r z o g . 384 S. mit 22 farb. und schwarzen Bildern von
Professor K a m p f . Buchschmuck und Einbandzeichnung von Professor G.
Belwe.
In Origb. M. 3.40. Vorzugsausgabe auf Bütten M. 10.—

Männer und Zeiten


Essays zur neueren Geschichte. Von Geheimrat Prof. Dr. E . M a r c k s . 2
Bände 640 S. 5. und 6. Tausend.
In Originalleinenband M. 12.—, in Halbfranzband M. 16.—

Große Denker
Eine Geschichte der Philosophie in Einzeldarstellungen. Herausgegeben von
Privatdozent Dr. E . v . A s t e r . 2 Bände zu je 320 S. mit 8 Porträts.
In Originallbd. M. 16.—, in Halbfrzbd. M. 20.—

Ausführliche Prospekte unentgeltlich und postfrei.


Fußnoten:
[1] Nordische Form des deutschen Namens Nibelunge.
[2] Volsungar ist der im Norden gebräuchliche Geschlechtsname
des Sigurd und seiner Angehörigen.
[3] Ragnar wird verheiratet gedacht mit Aslaug, einer
hinterlassenen Tochter des Sigurd und der Brynhild.
[4] Da sein Verfasser im Grunde nur den gedruckt vorliegenden
„Hürnen Seifrid“ umschreibt, widerspricht das Auftauchen des
Volksbuches im 18. Jahrhundert nicht der S. 1 aufgestellten
Behauptung, daß die direkte volkstümliche Überlieferung im
Dreißigjährigen Kriege erloschen ist.
[5] Die Beispiele sind entnommen aus „Die Edda“, übersetzt und
erläutert von Hugo Gering.
[6] Odin ist die nordische Form des Namens für denselben Gott,
der in Deutschland Wodan hieß.
[7] Wagner hat diesen Zug der Sage in der „Walküre“ benutzt, ihn
aber verschoben; bei ihm ist Siegfrieds Mutter an die Stelle der
Signy getreten.
[8] Wagner überträgt den Namen auf die Person seiner Dichtung,
die eigentlich die Figur des Siggeir fortsetzt.
[9] Man dachte sich die Gnitaheide auf dem halben Wege von
Paderborn nach Mainz gelegen, wo sie im 12. Jahrhundert ein
wandernder Norweger, Abt Nikolaus, wiedergefunden zu haben
glaubte.
[10] Daß Sigurds Schwert dasselbe ist, das sein Vater geführt hat,
behauptet erst die Volsungasaga; die Lieder-Edda weiß noch
nichts davon.
[11] Nach späterer nordischer Sage ist allerdings die Aslaug, die
Gattin des Ragnar Lodbrok, eine Frucht dieser frühern
Bekanntschaft Sigurds mit Brynhild. Übrigens nennt der
Liedersammler die Brynhild bei ihrer ersten Begegnung mit
Sigurd „Sigrdrifa“, indem er einen Beinamen (Spenderin des
Sieges) als Namen auffaßt; vielleicht hat er dadurch für die
beiden Verlobungsgeschichten (vgl. S. 22) zwei verschiedene
Heldinnen schaffen wollen.
[12] Die ursprüngliche Fassung der Sage, daß Sigurd in
untergeordneten Verhältnissen aufgewachsen ist, blickt deutlich
hindurch.
[13] Im Norden wird sein Volk nicht das hunnische genannt,
wenigstens nicht in den älteren Quellen; nach vereinzelten
Andeutungen herrscht er in Walland (Italien).
[14] Ihr Alter dürfen wir freilich nicht nachrechnen. Svanhild ist
beim Eintritt in die Erzählung ein junges Mädchen. Inzwischen
sind aber ihre Brüder aus der dritten Ehe ihrer Mutter bereits zu
waffenfähigen Männern herangewachsen. Gudruns zweite Ehe
mit Atli, sowie die Zeit ihrer Witwenschaft sind inzwischen
vergangen, auch die Zeit der Ehe mit Sigurd, die doch immerhin
einige Jahre gewährt hat, ist vorüber. Wir kommen also für
Svanhild, wenn wir nachrechnen, auf ein ziemlich hohes Alter,
das zur Erzählung nicht stimmt. Wir dürfen in dieser Beziehung
nicht zu streng sein. Denn gerade diese Dinge, wie überhaupt
jede Chronologie, sind die schwächsten Punkte aller
sagenmäßigen Tradition. Alles dies verschwimmt in der
Erinnerung der Menschen zu allererst; sie werfen alles auf eine
Fläche, sie sehen in der Erinnerung alles nebeneinander, kein
Vor- und kein Hintereinander mehr; Personen, die in Wirklichkeit
durch hundert Jahre getrennt waren, können leicht als
Zeitgenossen erscheinen. Es war für die einfachen Leute, welche
die Überlieferung gepflegt haben, eben nicht möglich, solche
Dinge zu kontrollieren.
[15] Er gehört übrigens ursprünglich nur dem Texte C an,
vergleiche später S. 107.
[16] Den Namen des Vaters (Gibich, der in andern deutschen
Dichtungen wohlbekannt ist) hat das Nibelungenlied vergessen;
erst der Text C nennt ihn im Anschluß an die „Klage“ mit einem
offenbar willkürlich herausgegriffenen Namen Dankrat.
[17] Woher sie mit ihr bekannt ist (die Geschichte spielt ja in der
Mädchenzeit der beiden), wird nicht erklärt.
[18] Etwa dem alten Herzogtum Nieder-Lothringen entsprechend.
Eine Residenz Santen (heute Xanten) hat erst der Text C aus der
einmaligen Erwähnung dieses Städtchens Str. 715 (Holtzmann)
herausgesponnen, vgl. Braune, Die Handschriftenverhältnisse
des Nibelungenliedes, S. 178.
[19] Die Burgunden sitzen nach der Sage in einer Gegend, die
zur Zeit der vollendeten Dichtung den Franken gehört; sie fallen
infolgedessen in der Auffassung des Dichters und seiner Zuhörer
mit diesen zusammen.
[20] Solche Feste werden in unserm Liede stets mit besonderer
Liebe behandelt. Unserm heutigen Geschmack sagen die
Schilderungen von Festen und dem dabei entwickelten Prunke,
besonders was Kleidung anbetrifft, wenig zu, und man hat
deshalb die betreffenden Abschnitte gar für unecht erklären
wollen; sie sind jedoch nur leer an Sagengehalt. Wir müssen uns
in die damalige Zeit hineinversetzen, um diese Schneiderszenen,
wie man sie genannt hat, zu würdigen. Man erwartete im
Mittelalter von der erzählenden Dichtung nicht nur Anregungen
innerlichen, sondern auch solche äußerlichen Charakters, als da
sind Berichte über neue oder absonderliche Moden oder
Gebräuche.
[21] Die Schilderung dieser Jagd im 16. Gesange unseres Liedes
ist in gewisser dichterischer Beziehung vielleicht sein Höhepunkt.
Der Verfasser weiß auf das genaueste Bescheid von allem, was
bei einer Jagd jener Zeit vorkommt, und versetzt sich und seine
Zuhörer so lebhaft in die richtige Wald- und Jagdstimmung, daß
man diesen Gesang nur mit großem Genusse lesen kann.
[22] Seltsamerweise wird vorausgesetzt, daß Siegfried für den
Scheinfeldzug vor einigen Tagen und für die Jagd ein und
denselben Rock trägt.
[23] Unter diesem Namen verstehen die Deutschen späterhin
immer Ofen (Budapest); ob das Nibelungenlied schon diese Stadt
meint, bleibt zweifelhaft: Ungarns alte Hauptstadt ist Gran (noch
heute Sitz des Primas); erst nach seiner Zerstörung durch die
Mongolen 1241 trat Ofen an seine Stelle.
[24] Diese einfachen Boten sind sicher eine aus einer ältern
Erzählungsschicht stehengebliebene Altertümlichkeit; der
ritterliche Dichter würde vornehmere Herren zu diesem Zwecke
bemüht haben.
[25] Dieser Held, der keiner andern Quelle unserer Sage bekannt
ist, spielt von jetzt an eine Schritt für Schritt wachsende Rolle,
und zwar tritt er immer an Stellen hervor, die eine Neuerung in
der Sage bedeuten.
[26] Die Dichter des Mittelalters vermögen ihren Werken kein
andres Kolorit als das ihrer eigenen Zeit zu geben.
[27] Die „Vorrede“ des Heldenbuches, vgl. später S. 118.
[28] Der Kampf im Saale beginnt also auch hier mit Ortliebs Tode,
doch ist der Umstand, daß Kriemhilt diesen mit Absicht
herbeiführt, um Etzel zur Rache zu entflammen, als zu
grauenerregend abgeschwächt.
[29] Irnfrid von Thüringen ist der historische letzte König der
Thüringe Ermanfrid, der um 530 von den Franken besiegt und
vertrieben (später auch getötet) wurde; die letzten seiner Familie
flohen zum oströmischen Kaiser, den unsere deutsche Sage in
älterer Zeit immer durch den ihr geläufigen Hunnenkönig Attila
ersetzt.
[30] Amelunge (Amaler) ist ursprünglich der Name des
Königshauses der Ostgoten; er wird (was auch anderwärts nicht
selten vorkommt, z. B. Kärlinge = Franken) so häufig für „Goten“,
den Namen des beherrschten Volkes, gebraucht, daß die
hochdeutsche Überlieferung diesen ganz vergessen hat.
[31] Im dritten Gudrunliede, das einen Einzelzug behandelt, der
nicht einmal sagenecht ist, wird er erwähnt.
[32] Das Volk der Bayern begegnet uns zuerst um die Mitte des 6.
Jahrhunderts unter einheimischen, von den fränkischen Königen
abhängigen Fürsten; das ihnen gehörige Land war kurz vorher
noch ein Teil des Gotenreiches. Als die Oströmer dies eroberten,
drangen sie nicht bis über die Alpen vor; es scheint daher, daß
sich die zwischen Donau und Alpen übrig gebliebenen Goten mit
Resten anderer Germanenstämme zu einem neuen Volke unter
dem Namen „Bayern“ (Baiuuarii) zusammengeschlossen haben.
Wenigstens betrachten die Bayern noch später sich als identisch
mit den Amelungen (Goten) und also den Dietrich als ihres
Stammes.
[33] Auch hier ist Etzel sagenhafter Vertreter des oströmischen
Kaisers (Zeno, der den Theodorich 489 gegen Odoaker schickte).
[34] Eine Namenverschiebung: da derjenige, der in der Lieder-
Edda Regin heißt, hier bereits (auf Grund deutscher Sage) Mimir
benannt ist, überträgt der Sagaschreiber jenen Namen auf den
Drachen (der in nordischer Sage Fafnir heißt und Regins Bruder
ist).
[35] Schwert und Roß führen hier die aus der Lieder-Edda
bekannten Namen Gram und Grani; jenes entspricht dem
deutschen Balmung, dies wird in Deutschland nicht mit Namen
genannt.
[36] Dieser gilt in der Saga als Bruder der Burgundenkönige; ein
Zugeständnis an die nordische Sagenform der Lieder-Edda.
[37] Der also hier als vierter die Stelle Dankwarts im
Nibelungenliede einnimmt; Dietrichs Mitgehen ist halbwegs
begründet, das Dankwarts aber nicht; liegt hier vielleicht eine
dunkle Beziehung zwischen den beiden Überlieferungen vor?
[38] Davon war bisher nichts erzählt; die Saga ist hier mit sich
selbst nicht einig. Ihre einzelnen Teile stammen aus
verschiedenen Quellen und sind nicht durchweg ineinander
gearbeitet und miteinander ausgeglichen.
[39] Als persönliches Opfer ihrer Rache fällt hier Giselher; einer
muß durch ihre Hand umkommen, damit begründet ist, daß
Dietrich (statt Hiltebrands im Liede) sie tötet.
[40] Ich will nicht unterlassen, darauf hinzuweisen, daß der
Personenname „Nibulung“ im Geschlechte der Arnulfinge einen
ganz besonderen Sinn gehabt haben kann: die Stifterin des
Klosters Nivelles (belgische Stadt südlich von Brüssel) ist die
Heilige Gertrud ( † 659), Tochter Pipins des Ältern; dies Nivelles
ist also ein jenem Geschlechte ganz besonders wertes Heiligtum;
ist es danach nicht denkbar, daß Söhne dieser Familie
gelegentlich „Mann von Nivelles“, in altfränkischer Sprachform
„Nibulung“, benannt worden sind? Ist diese Annahme richtig, so
müssen natürlich die Nibelunge der Sage unbedingt von diesen
historischen Nibelungen hergeleitet werden. Ich wage nun freilich
für die Richtigkeit nicht einzustehen, muß aber behaupten, daß
diese Herleitung plausibler ist als die alte, die in den Nibelungen
„Nebelsöhne“, „Mächte der Finsternis“ erkennen wollte; sie ist ja
schon dadurch widerlegt, daß es mythische Nibelunge in der
Sage ursprünglich gar nicht gegeben hat.
[41] Daß dieser als Schwestersohn dem Oheim den Grund für
sein Verhalten gibt, ist ein höchst altertümlicher Zug, der die
ältesten germanischen (mutterrechtlichen) Verhältnisse
widerspiegelt, vgl. Tac. Germ. c. 20: sororum filiis idem apud
avunculum qui apud patrem honor. quidam sanctiorem
artioremque hunc nexum sanguinis arbitrantur (Schwestersöhne
stehen beim Oheim in derselben Geltung wie beim Vater; einige
halten dies Blutsband sogar für heiliger und enger).
[42] Deshalb vermag ich, wenn ein elsässisches Kirchheim
urkundlich gelegentlich auch Tronia genannt wird, darin nichts
altes zu sehen, sondern höchstens den Versuch einer
Lokalisierung des sagenhaften Tronje.
[43] Wilhelm Jordan hat in seiner „Sigfridsage“ als Grund für
Siegfrieds Verhalten gegenüber Brünhilt angenommen, sie habe
an Siegfried das im Text angeführte Verlangen gestellt; damit hat
Jordan gewiß das sagenechte getroffen; eine Nachdichtung der
durch die Ungunst der Überlieferung zerpflückten alten Dichtung
(und um eine solche handelt es sich doch, unbeschadet aller
Grundlagen) führt am sichersten zu den alten Zusammenhängen.
[44] Wenigstens setzt der Skalde Bragi der Alte, der um das Jahr
900 gestorben ist, in seiner Ragnarsdrapa diese Verbindung
bereits voraus.
[45] Pro mariti fraudulento discessu; das hat man auch
übersetzen wollen: dafür, daß sie ihren Mann (nämlich
Ermanarich) trügerisch verlassen hatte; dann wäre die
Übereinstimmung mit den Eddaliedern nahezu vollkommen; allein
der Zusammenhang bei Jordanes unterstützt diese Übersetzung
nicht.
[46] Man hat mit Recht daran erinnert, daß die an der mittlern
Donau sitzenden Heruler (nach Procopius von Caesarea) noch im
Anfang des 6. Jahrhunderts mit ihren Stammesgenossen im
südlichen Schweden in lebhaftem Verkehr stehen.
[47] Pöchlarn (Bechelaren) wird in dieser Zeit tatsächlich der Sitz
des bayrischen Ostmarkgrafen gewesen sein.
[48] Da das Nibelungenlied gelegentlich den Tod Nudungs
erwähnt, der von Witig in der Ravennaschlacht getötet wurde, so
muß es letztere als vergangen annehmen; da nun ursprünglich
gewiß diese Schlacht zur Rückführung Dietrichs geführt hat, war
nicht recht begreiflich, warum er nach ihr noch an Etzels Hof lebt;
das hat zur Annahme zweier Feldzüge gegen Ermenrich (und
seinen Nachfolger) geführt, deren erster dann unglücklich
verlaufen sein muß. Die „Klage“ läßt übrigens am Schlusse
Dietrich mit seiner Gattin und Hiltebrand in friedlicher Reise nach
Bern zurückkehren, nimmt also an, daß er seit der
Ravennaschlacht im Besitze seines Reiches ist. Daß der Verräter
Sibich nach Ermenrich in Italien geherrscht habe, behauptet nur
die Thidrikssaga.
[49] D. h. als Buch erhaltenen; lückenhaft infolge Verlustes
einzelner Blätter kann eine solche vollständige Handschrift
immerhin sein.
[50] Seit dem ersten Erscheinen dieses Buches hat sich das
handschriftliche Material, außer um Blätter bereits bekannter
Handschriften, noch um Reste von drei bisher unbekannten
vermehrt: X, ein Blatt aus der Klage, gefunden in Sterzing; Y, ein
Wiener Blatt; Z, ein in Dülmen gefundenes Blatt. Ich will nicht
unerwähnt lassen, daß mir scheint, als gehöre W zur
Nibelungenhandschrift S, X zur Nibelungenhandschrift U. — Die
in der alphabetischen Folge fehlenden Buchstaben sind
verwendet wie folgt: P bezeichnete früher ein Fragment, das sich
als der gleichen Handschrift wie N entstammend erwiesen hat; T
ist die Signatur der fragmentarisch erhaltenen niederländischen
Übersetzung aus dem 14. Jahrhundert; V ist (wegen Ähnlichkeit
mit U) nicht verwendet; c gilt für die Zitate, die Lazius, ein
Gelehrter des 16. Jahrhunderts, in seiner Schrift De gentium
aliquot migrationibus aus einer alten Handschrift angebracht hat;
e und f hatte man anfangs irrtümlich die jetzt mit L bezeichneten
Fragmente benannt; m ist Inhaltsverzeichnis einer verlorenen
Handschrift.
[51] Vielleicht hat Wolfram von Eschenbach, der Parzival 420 f.
sich auf das Nibelungenlied bezieht, schon den Liet-Text gekannt;
doch ist sein Zitat auch verständlich, wenn er nur die beiden
Texten gemeinsame Strophe 1496 (Holtzmann) vor sich gehabt
hat; die folgende, dem Liet-Texte eigentümliche Strophe, in der,
wie bei Wolfram, „Schnitten“ als eine gute Speise erwähnt
werden, dürfte eher in Anlehnung an die etwas spöttisch
gehaltene Ausführung im Parzival verfaßt sein.
[52] In einer Besprechung der 1. Auflage dieses Buches
(Literarische Rundschau vom 1. Juni 1909) hat Fr. Panzer die hier
entwickelte Gedankenreihe beanstandet und darauf hingewiesen,
daß Zeizenmure in der ungarischen Sage als Ort einer Schlacht
eine große Rolle spielt und infolgedessen in die Grundhandschrift
des Not-Textes gelangt sei. Das könnte möglich sein, hilft uns
aber nicht weiter, denn 1) ist die Darstellung der ungarischen
Sage, wie sie bei Simon Kézai vorliegt, trotz Bleyers
Ausführungen (im 31. Bande der Beiträge) eine halbgelehrte
Kompilation aus der 2. Hälfte des 13. Jahrhunderts, 2) ist nicht
abzusehen, wie ein Nicht-Österreicher (denn ein Österreicher
konnte den Fehler nicht begehen) zur Kenntnis ungarischer Sage
gelangt sein sollte, und 3) bleibt die Sache beim alten, weil die
Grundhandschrift des Not-Textes den Fehler, mag seine Ursache
sein, welche sie will, eben begangen hat und daher
notwendigerweise nur eine nebengeordnete, nicht eine
übergeordnete Stelle neben den Liet-Handschriften einnehmen
kann. Auf Zarncke’s feinen Gedanken, Nithart zur Erklärung
heranzuziehen, könnte man schließlich verzichten; den in der
„Not“ vorliegenden Text aber weit über 1230 hinaufzuschieben, ist
trotzdem unmöglich wegen gewisser unbestreitbarer Zusätze,
wegen Spuren beginnenden Verfalles in der Verstechnik und
besonders wegen des Zustandes aller hierher gehörigen
Handschriften (s. S. 107).
[53] Das ist nicht ohne Beispiel; so wurde das um 1170
entstandene Gedicht vom Herzog Ernst bereits um 1200
(hauptsächlich reimtechnisch) überarbeitet; als aber in der
zweiten Hälfte des 13. Jahrhunderts ein neuer Bearbeiter den
Text vornahm, griff er auf das Original zurück und ignorierte die
um 1200 entstandene Überarbeitung.
[54] Nach Lachmann nur dreizehn; er behielt 1627 bei und
änderte sie durch Konjektur; wir haben dazu heute keine
Veranlassung mehr.
[55] Mit einer Ausnahme: Lachmanns 17. Lied schließt an das 15.
an; das 16. ist eine Parallelerzählung.
[56] Vgl. Schönbach, Das Christentum in der altdeutschen
Heldendichtung, S. 203.
[57] Heinrich von Ofterdingen, den manche beim
Wiedererwachen unserer Kenntnis der mittelalterlichen Literatur
als Dichter des Nibelungenliedes in Anspruch genommen haben,
ist keine historische Person, sondern vom Dichter des
Wartburgkrieges erfunden; dieser Mann brauchte eine Figur, die
als Gegenstück und Widerpart der historisch bekannten Sänger
am Hofe zu Eisenach hingestellt werden konnte.
[58] Es ist mir leider nicht gelungen, das Werkchen, das ich vor
mehr als dreißig Jahren selbst gelesen habe, irgendwo wieder
aufzutreiben.
[59] Wilkina- (richtiger Wilcina-) und Niflungasaga sind Teile und
Untertitel der Thidrikssaga.
*** END OF THE PROJECT GUTENBERG EBOOK DER
SAGENKREIS DER NIBELUNGEN ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright
in these works, so the Foundation (and you!) can copy and
distribute it in the United States without permission and without
paying copyright royalties. Special rules, set forth in the General
Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree to
abide by all the terms of this agreement, you must cease using
and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project
Gutenberg™ works in compliance with the terms of this
agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms
of this agreement by keeping this work in the same format with
its attached full Project Gutenberg™ License when you share it
without charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it
away or re-use it under the terms of the Project Gutenberg
License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country where
you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of the
copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute
this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite
these efforts, Project Gutenberg™ electronic works, and the
medium on which they may be stored, may contain “Defects,”
such as, but not limited to, incomplete, inaccurate or corrupt
data, transcription errors, a copyright or other intellectual
property infringement, a defective or damaged disk or other
medium, a computer virus, or computer codes that damage or
cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES -


Except for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU
AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
STRICT LIABILITY, BREACH OF WARRANTY OR BREACH
OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE
TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER
THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE
OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF
THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If


you discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person or
entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR
ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you do
or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission of


Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status by
the Internal Revenue Service. The Foundation’s EIN or federal
tax identification number is 64-6221541. Contributions to the
Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or
determine the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About Project


Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like