Abstract
This chapter introduces machine classification in the context of an authorship attribution problem. Various methods of text pre-processing are combined here to generate a corpus of 430 text samples. These samples are then used for training and testing a support vector machines supervised learning model.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
We know what you are thinking: there are 26 letters so what if you want an odd number of groups, like five? The cut function described here will optimize the size of the segments to be as close to equal as possible based on the length of the input vector.
- 2.
Or some other number that is less than or equal to the length of the vector you are iterating over.
- 3.
In regex the period character is used as a special wild card. So in this expression the first period must be escaped using the double backslashes. This tells the regex engine to find the literal period. The second period in the expression is the period being used as a wild card metacharacter. The asterisk is another special character that is used as a multiplier. So here the asterisk repeats the wild card character indefinitely, until the end of the search string is reached.
- 4.
We say “or so” because the time it takes to complete this operation is dependent on your computer’s processor and the configuration of your system. On our MacBook Pro it took 14.19 s.
- 5.
There are many good classification algorithms that can be used for authorship attribution testing, see, for example, Jockers and Witten (2010). In this paper, Jockers and Witten conclude that the Nearest Shrunken Centroids is especially good for authorship attribution problems, but frankly, the others methods tested also performed quite well. Interested readers might also look at the work of Jan Rybicki and Maciej Eder found at the Computational Stylistics Group website: https://sites.google.com/site/computationalstylistics/.
References
Jockers ML, Witten DM (2010) A comparative study of machine learning methods for authorship attribution. Digital Scholarship in the Humanities 25(2):215–223, https://doi.org/10.1093/llc/fqq001
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this chapter
Cite this chapter
L. Jockers, M., Thalken, R. (2020). Classification. In: Text Analysis with R. Quantitative Methods in the Humanities and Social Sciences. Springer, Cham. https://doi.org/10.1007/978-3-030-39643-5_16
Download citation
DOI: https://doi.org/10.1007/978-3-030-39643-5_16
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-39642-8
Online ISBN: 978-3-030-39643-5
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)