1 2 3 4 5 6 7 8 9 10 11
| 準確率: 0.9473684210526315 在交叉驗證中驗證的最好結果: 0.9910714285714286 最好的參數模型: KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski', metric_params=None, n_jobs=1, n_neighbors=10, p=2, weights='uniform') 每次交叉驗證後的驗證集準確率結果和訓練集準確率結果: {'mean_fit_time': array([0.00023023, 0.0001897 , 0.00018748, 0.00018843]), 'std_fit_time': array([5.71920846e-05, 8.99132768e-07, 1.38109105e-06, 4.49566384e-07]), 'mean_score_time': array([0.00042526, 0.00037464, 0.00037185, 0.00038997]), 'std_score_time': array([7.77299011e-05, 4.85630548e-06, 8.77806426e-07, 7.62525420e-06]), 'param_n_neighbors': masked_array(data=[3, 5, 7, 10], mask=[False, False, False, False], fill_value='?', dtype=object), 'params': [{'n_neighbors': 3}, {'n_neighbors': 5}, {'n_neighbors': 7}, {'n_neighbors': 10}], 'split0_test_score': array([0.97368421, 0.97368421, 0.97368421, 0.97368421]), 'split1_test_score': array([1. , 0.97297297, 0.97297297, 1. ]), 'split2_test_score': array([0.97297297, 0.97297297, 0.97297297, 1. ]), 'mean_test_score': array([0.98214286, 0.97321429, 0.97321429, 0.99107143]), 'std_test_score': array([0.01254582, 0.00033675, 0.00033675, 0.01245966]), 'rank_test_score': array([2, 3, 3, 1], dtype=int32), 'split0_train_score': array([1. , 1. , 1. , 0.98648649]), 'split1_train_score': array([0.98666667, 0.98666667, 0.98666667, 0.98666667]), 'split2_train_score': array([0.98666667, 0.98666667, 0.98666667, 0.98666667]), 'mean_train_score': array([0.99111111, 0.99111111, 0.99111111, 0.98660661]), 'std_train_score': array([6.28539361e-03, 6.28539361e-03, 6.28539361e-03, 8.49377515e-05])}
|