1234567891011121314151617181920 |
- from sklearn.neural_network import MLPClassifier
- def main():
- x = [[0., 0, ], [1., 1.]]
- y = [0, 1]
-
-
-
-
-
- mlp = MLPClassifier(solver='lbfgs', alpha=1e-5, hidden_layer_sizes=(5, 2), random_state=1)
- mlp.fit(x, y)
- print(mlp.predict([[2., 2.], [-1., -2.]]))
- if __name__ == "__main__":
- main()
|