7,568 views
0 0 votes

Given the following sample dataset with 5 samples and 2 features:

Sample Feature 1 Feature 2 Actual Value Predicted Value
1 2 3 4 6
2 3 4 5 6
3 4 5 6 7
4 5 6 7 8
5 6 7 8 9


Calculate the residual errors, mean squared error (MSE), mean absolute error (MAE), and root mean squared error (RMSE) using a sample model.

50% Accept Rate Accepted 31 answers out of 62 questions

1 Answer

0 0 votes

     1. First, we need to calculate the residual errors. Residual errors are the difference between the actual values and predicted values.

Sample Feature 1 Feature 2 Actual Value Predicted Value Residual Error (Actual - Predicted)
1 2 3 4 6 -2
2 3 4 5 6 -1
3 4 5 6 7 -1
4 5 6 7 8 -1
5 6 7 8 9 -1
  1. Next, we can calculate the MSE by taking the average of the squared residual errors.

$MSE = ((-2)^2 + (-1)^2 + (-1)^2 + (-1)^2 + (-1)^2) / 5 = 10 / 5 = 2$

  1. To calculate the MAE, we take the average of the absolute residual errors.

$MAE = (|-2| + |-1| + |-1| + |-1| + |-1|) / 5 = 6 / 5 = 1.2$

  1. Finally, to calculate the RMSE, we take the square root of the MSE.

$RMSE = sqrt(2) = 1.41$

Therefore, the residual errors are [-2, -1, -1, -1, -1], the MSE is 2, the MAE is 1.2, and the RMSE is 1.41.

Related questions

1 1 vote
1 answers 1 answer
4.9k
4.9k views
tofighi asked Feb 18, 2020
4,917 views
Assuming we have a linear regression equation and some data points (sample), how can we calculate residual error for each data point, and total cost based on the metrics ...
3 3 votes
1 answers 1 answer
7.8k
7.8k views
tofighi asked Feb 3, 2020
7,788 views
How to solve this problem?https://i.imgur.com/8urywpf.jpgQ1) Complete the ? sectionsQ2) Accuracy of system if threshold = 0.5?Q3) Accuracy of system if threshold = 0.95?
0 0 votes
1 answers 1 answer
2.5k
2.5k views
tofighi asked Oct 2, 2024
2,466 views
For the following neural network, calculate accuracy of classification, given these settings
2 2 votes
1 answers 1 answer
20.9k
20.9k views
tofighi asked Jun 26, 2019
20,913 views
Use the k-means algorithm and Euclidean distance to cluster the following 8 examples into 3 clusters:$A1=(2,10), A2=(2,5), A3=(8,4), A4=(5,8), A5=(7,5), A6=(6,4), A7=(1,2...
3 3 votes
2 answers 2 answers
8.4k
8.4k views
tofighi asked Apr 4, 2019
8,400 views
The scatter plot of Iris Dataset is shown in the figure below. Assume Softmax Regression is used to classify Iris to Setosa, Versicolor, or Viriginica using just petal le...