matrics_calculator.MSE ====================== .. py:module:: matrics_calculator.MSE Functions --------- .. autoapisummary:: matrics_calculator.MSE.mean_squared_error Module Contents --------------- .. py:function:: mean_squared_error(y_true, y_pred) Calculate the Mean Squared Error (MSE) between actual and predicted values. This function computes the average squared difference between the predicted values (`y_pred`) and the actual values (`y_true`). It is commonly used as a metric to evaluate regression models. :param y_true: The actual observed values. :type y_true: list or array-like :param y_pred: The predicted values from the model. :type y_pred: list or array-like :returns: The Mean Squared Error (MSE) value, which is non-negative. A smaller value indicates that the predictions are closer to the actual values. :rtype: float .. rubric:: Notes This function assumes that the input `y_true` and `y_pred` have the same length. .. rubric:: Examples >>> y_true = [3, -0.5, 2, 7] >>> y_pred = [2.5, 0.0, 2, 8] >>> mean_squared_error(y_true, y_pred) 0.375