""" ........................................ Regresszió a Boston housing adathalmazon ........................................ """ print(__doc__) from sklearn.datasets import load_boston import numpy as np from sklearn.model_selection import train_test_split boston = load_boston() #print(boston.DESCR) print(boston.data.shape) print(boston.target.shape) X=boston.data y=boston.target X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1) #print(X_train.shape) #print(X_test.shape) #print(y_train.shape) #print(y_test.shape) mlp = MLPRegressor(solver='lbfgs', hidden_layer_sizes=50,max_iter=150,activation='relu') mlp.fit(X_train, y_train) print(mlp.predict([[0.00632,18,2.31,1,0.538,6.575,65.2,4.09,1,296,15.3,396.9,4.98]])) print('Pontosság a tanítóhalmazon: {0}'.format(mlp.score(X_train, y_train))) print('Pontosság a teszthalmazon: {0}'.format(mlp.score(X_test, y_test)))