Splitting Dataset into Training and Testing
X and Y splitting (i.e. Y is the SalePrice column and the rest of the other columns are X)
Python3
from sklearn.metrics import mean_absolute_error from sklearn.model_selection import train_test_split X = df_final.drop([ 'SalePrice' ], axis = 1 ) Y = df_final[ 'SalePrice' ] # Split the training set into # training and validation set X_train, X_valid, Y_train, Y_valid = train_test_split( X, Y, train_size = 0.8 , test_size = 0.2 , random_state = 0 ) |
House Price Prediction using Machine Learning in Python
We all have experienced a time when we have to look up for a new house to buy. But then the journey begins with a lot of frauds, negotiating deals, researching the local areas and so on.