Ultimate Step by Step Guide to Machine Learning Using Python: Predictive modelling concepts explained in simple terms for beginners by Anis Daneyal

Ultimate Step by Step Guide to Machine Learning Using Python: Predictive modelling concepts explained in simple terms for beginners by Anis Daneyal

Author:Anis, Daneyal [Anis, Daneyal]
Language: eng
Format: epub
Published: 2020-02-15T16:00:00+00:00


In the above code sample, we used the train_test_split function in the Scikit-learn library. As you can see, we defined ‘y’ as the target / dependent variable ‘SalePrice’ and ‘X’ as all the independent variables that will be used to predict the price.

We will take a moment here to describe the purpose of the additional parameters in the train_test_split function:

1) test_size – defines what percentage of your data will be treated as test dataset. For this example, we used 50%

2) random_state – is used as an input into random number generation during the split. For our example, we used 80

3) shuffle – is used to determine whether data should be shuffled before splitting. For our purpose, we set that to true

Now we are ready to build, train and test the predictive models!



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.