Professional Documents
Culture Documents
import numpy as np
import pandas as pd
1 1 85 66 29 0 26.6
2 8 183 64 0 0 23.3
3 1 89 66 23 94 28.1
OneR Classifier
oneR considers each of the attributes. It make rules for each attribute, and selectes the rule
which generates highest accuracy. The algorithm is
column_age = []
data.head()
1 1 85 66 29 0 26.6
2 8 183 64 0 0 23.3
3 1 89 66 23 94 28.1
for i in range(0,5):
print("If Age Category: ", i, " , number of outcomes(0): ",
len( data[ (data['Age_Categorical'] == str(i)) & (data['Outcome'] ==
0) ]) )
print("If Age Category: ", i, " , number of outcomes(1): ",
len( data[ (data['Age_Categorical'] == str(i)) & (data['Outcome'] ==
1) ] ) ,"\n")
67.44791666666666