423426939 by Unknown

423426939 by Unknown

Author:Unknown
Language: eng
Format: epub


4- Data Preprocessing

To divide the data into features and labels, execute the following script:

features= car_data.iloc[:,0:1].values

labels= car_data.iloc[:,1].values

Finally let’s divide the data into 80 % training and 20% test sets:

from sklearn.model_selection import train_test_split

train_features, test_features, train_labels, test_labels = train_test_split(features, labels, test_size = 0.2, random_state = 0)

If you look at the dataset we can see that there is not a very huge difference between values of years and prices. Both of them have in thousands. Therefore, there is no need to scale the data and we can use this data as it is for training the algorithm.

5- Training the Algorithm and making Predictions



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.