Download Free Audio of Import mean_absolute_error from the metrics as m ... - Woord

Read Aloud the Text Content

This audio was created by Woord's Text to Speech service by content creators from all around the world.


Text Content or SSML code:

<speak> Import mean_absolute_error from the metrics as m a e. <break strength="x-strong"/> We are creating an instance of LR class. <break strength="x-strong"/> The lr is our model now. <break strength="x-strong"/> You need to train this model. <break strength="x-strong"/> It is in the raw state.<break strength="strong"/> You need to train this model. <break strength="strong"/>You have created a multiple linear regression model lr, <break strength="weak"/>and now you need to train the model.<break strength="strong"/> For training, <break strength="weak"/>you need a method called fit. <break strength="strong"/>Lr_fit train_x, train_y trains the linear regression model using train_x as the input <break strength="weak"/>and train_y as the output. <break strength="x-strong"/><break strength="x-strong"/> Then the algorithm finds parameters <break strength="weak"/>by fitting the relation between train_x and train_y.<break strength="x-strong"/> Finds the best fit or equation between train_x <break strength="weak"/>and train_y with optimization techniques. <break strength="x-strong"/> The best fit line obtained from the fit method is not a hundred percent accurate. <break strength="strong"/>It does not satisfy all the points.<break strength="x-strong"/> There is some error. <break strength="strong"/>The algorithm finds the average curve between input and output.<break strength="x-strong"/> After the fit method, <break strength="weak"/>we got a trained model. <break strength="strong"/>We got parameters also.<break strength="x-strong"/> The next step is to predict using the trained model.  <break strength="x-strong"/> We use the predict method for testing the model.<break strength="x-strong"/> Give same training set train_x to lr.predict method. <break strength="strong"/>This method predicts the output of the model for given train_x. <break strength="x-strong"/> We are giving train_x as the input to the trained model <break strength="weak"/>to see whether it is correctly giving the output values or not. <break strength="strong"/>For the input train_x, the model predicts the values. <break strength="strong"/>Store the predicted values in the train_predict variable.<break strength="strong"/> Now we have actual and predicted values.<break strength="strong"/> Train_y is the actual value we got from the train_ test_split command. <break strength="x-strong"/> The train_predict is the predicted value, <break strength="weak"/>the values predicted by the model.<break strength="strong"/> MAE is the mean absolute error. <break strength="x-strong"/> <break strength="x-strong"/> </speak>