《Python数据挖掘入门与实践》Robert Layton 人民邮电出版社
The OneR algorithm is:
- For each variable
- For each value of the variable
- The prediction based on this variable goes the most frequent class
- Compute the error of this prediction
- Sum the prediction errors for all values of the variable
- For each value of the variable
- Use the variable with the lowest error
import numpy as np #numpy提供矩阵运算功能
# Load our dataset
f