MLP with partial_fit() performing worse than with fit() in a supervised classification

后端 未结 2 831
有刺的猬
有刺的猬 2021-01-29 15:11

The learning dataset I\'m using is a grayscale image that was flatten to have each pixel representing an individual sample. The second image will be classified pixe

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 15:57

    Rather than manually providing a rate, you can use adaptive learning rate functionality provided by sklearn.

    model = SGDClassifier(loss="hinge", penalty="l2", alpha=0.0001, max_iter=3000, tol=None, shuffle=True, verbose=0, learning_rate='adaptive', eta0=0.01, early_stopping=False)
    

    This is described in the [scikit docs] as:

    ‘adaptive’: eta = eta0, as long as the training keeps decreasing. Each time n_iter_no_change consecutive epochs fail to decrease the training loss by tol or fail to increase validation score by tol if early_stopping is True, the current learning rate is divided by 5.

提交回复
热议问题