A feature is a measurable characteristic used to describe an object for machine-learning prediction or analysis. In authorship identification, features turn books into numerical descriptions of how their authors write. section 11.1
Useful writing features include:
- Average words per sentence, calculated by dividing total words by total sentences. section 11.3.1
- Sentence complexity, estimated with a simple rule that treats commas, semicolons, and colons as phrase separators. section 11.3.1
- Word-based characteristics such as average word length and patterns of repetition. section 11.3.1 section 11.8
- A signature, which is a list of features describing one object such as a book. section 11.8
Calculating a sentence-length feature
A passage containing 32 words across two sentences has an average-words-per-sentence feature of 32 ÷ 2 = 16. That number becomes one part of the book’s signature. section 11.3.1 section 11.8
Table 11.1 Calculating the difference between two signatures
|
Feature Number
|
Value of Feature in Signature 1
|
Value of Feature in Signature 2
|
Weight of Feature
|
Contribution of Feature
|
|---|---|---|---|---|
|
1
|
4.6
|
4.3
|
11
|
abs(4.6 – 4.3) × 11 = 3.3
|
|
2
|
0.1
|
0.1
|
33
|
abs(0.1 – 0.1) × 33 = 0
|
|
3
|
0.05
|
0.04
|
50
|
abs(0.05 – 0.04) × 50 = .5
|
|
4
|
10
|
16
|
0.4
|
abs(10 – 16) × 0.4 = 2.4
|
|
5
|
2
|
4
|
4
|
abs(2 – 4) × 4 = 8
|
|
Sum
|
14.2
|
Compare feature values between two signatures and see how each weighted difference contributes to their total difference. section 11.3.1













