1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| feature_list : [{'age': 'youth', 'income': 'high', 'student': 'no', 'credit_rating': 'fair'}, {'age': 'youth', 'income': 'high', 'student': 'no', 'credit_rating': 'excellent'}, {'age': 'middle_aged', 'income': 'high', 'student': 'no', 'credit_rating': 'fair'}, {'age': 'senior', 'income': 'medium', 'student': 'no', 'credit_rating': 'fair'}, {'age': 'senior', 'income': 'low', 'student': 'yes', 'credit_rating': 'fair'}, {'age': 'senior', 'income': 'low', 'student': 'yes', 'credit_rating': 'excellent'}, {'age': 'middle_aged', 'income': 'low', 'student': 'yes', 'credit_rating': 'excellent'}, {'age': 'youth', 'income': 'medium', 'student': 'no', 'credit_rating': 'fair'}, {'age': 'youth', 'income': 'low', 'student': 'yes', 'credit_rating': 'fair'}, {'age': 'senior', 'income': 'medium', 'student': 'yes', 'credit_rating': 'fair'}, {'age': 'youth', 'income': 'medium', 'student': 'yes', 'credit_rating': 'excellent'}, {'age': 'middle_aged', 'income': 'medium', 'student': 'no', 'credit_rating': 'excellent'}, {'age': 'middle_aged', 'income': 'high', 'student': 'yes', 'credit_rating': 'fair'}, {'age': 'senior', 'income': 'medium', 'student': 'no', 'credit_rating': 'excellent'}] x_data : [[0. 0. 1. 0. 1. 1. 0. 0. 1. 0.] [0. 0. 1. 1. 0. 1. 0. 0. 1. 0.] [1. 0. 0. 0. 1. 1. 0. 0. 1. 0.] [0. 1. 0. 0. 1. 0. 0. 1. 1. 0.] [0. 1. 0. 0. 1. 0. 1. 0. 0. 1.] [0. 1. 0. 1. 0. 0. 1. 0. 0. 1.] [1. 0. 0. 1. 0. 0. 1. 0. 0. 1.] [0. 0. 1. 0. 1. 0. 0. 1. 1. 0.] [0. 0. 1. 0. 1. 0. 1. 0. 0. 1.] [0. 1. 0. 0. 1. 0. 0. 1. 0. 1.] [0. 0. 1. 1. 0. 0. 0. 1. 0. 1.] [1. 0. 0. 1. 0. 0. 0. 1. 1. 0.] [1. 0. 0. 0. 1. 1. 0. 0. 0. 1.] [0. 1. 0. 1. 0. 0. 0. 1. 1. 0.]] ['age=middle_aged', 'age=senior', 'age=youth', 'credit_rating=excellent', 'credit_rating=fair', 'income=high', 'income=low', 'income=medium', 'student=no', 'student=yes'] ['no', 'no', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'no'] y_data : [[0] [0] [1] [1] [1] [0] [1] [0] [1] [1] [1] [1] [1] [0]] x_test: [0. 0. 1. 0. 1. 1. 0. 0. 1. 0.] 预测结果是: [0]
|