MSE stands for mean-squared error. It's a measurement of an empirical loss in certain mathematical models, especially regression models.
Questions tagged [mse]
233 questions
1
vote
1 answer
MSELoss from Pytorch
I am trying to train a neural network using Pytorch. I would like the loss function to be the MSE. I tried to use torch.nn.MSELoss, however I get an error that I do not understand.
For example the following code gives me RuntimeError: Boolean value…

Onil90
- 171
- 1
- 8
1
vote
1 answer
Calculating MSE, RMSE with a certain range of data frame rows until the end of the data frame
I have a data frame df which has two column True and Prediction while the data frame has 1000 rows. I want to calculate MSE and RMSE using function from sklearn mean_squared_error(y_test, y_pred) . But I want to keep calculating them in a pattern…

Jewel_R
- 126
- 2
- 17
1
vote
1 answer
Computing MSE per row in pandas dataframe
I have the below dataframe with many columns- 2016_x, 2016_y, 2017_x, etc,
where x represents my actual values and y represents the forecast values.
How would I compute the mean squared error (MSE) row-wise to see it for different fruits.
Here is…

John
- 279
- 1
- 3
- 16
1
vote
0 answers
Calculate RMSE for ARIMAX, using pyflux iu Python
I am using pyflux and try to build an arimax model, using their tutorial.
I do not see any references in their documentation on how to calculate metrics (for example, RMSE). They only give AIC/BIC.
Any suggestions?

Anakin Skywalker
- 2,400
- 5
- 35
- 63
1
vote
0 answers
Splitting a data into 70:30 but all the outliers only in the training samples using R
I am simulating data in R to check which models perform better when outliers and multicollinearity present simultaneously. For this, I split the data into 70:30 random split, but I need to introduce outliers and multicollinearity only in the 70…

jeza
- 299
- 1
- 4
- 21
1
vote
1 answer
getting error when calculating loss - unsupported operand type(s) for -: 'tuple' and 'tuple'
I am trying to calculating loss using the below code
class MSE_gradient(nn.Module):
def __init__(self):
super(MSE_gradient, self).__init__()
def forward(self,inputs, targets):
diff = torch.gradient(inputs) - torch.gradient(targets)
…
user15957418
1
vote
0 answers
Calculating MSE between two images by two loops
I was trying to derive a function calculating the MSE by the equation:
MSE_value1 = 0
for y in range(iH):
for x in range(iW):
MSE_value1 += ((image_1[y][x] - image_2[y][x]) ** 2) / (iH * iW)
However, after searching I saw the most…

chenghuayang
- 1,424
- 1
- 17
- 35
1
vote
1 answer
Plotting contour plot of minimum square estimate function in matplotlib
To visualize the gradient descent of my linear regression model, I'm trying to do a contour plot for the following mse function:
import jax.numpy as jnp
import numpy as np
def make_mse(x, t):
def mse(w,b):
return np.sum(jnp.power(x.dot(w)…

ValientProcess
- 1,699
- 5
- 27
- 43
1
vote
1 answer
MSE: Sum of series that iterates through indices of 2 cell arrays
Here's the function that I want to write out in MATLAB:
For my ŷ and y, I am using the indices of rm and m, respectively. Here's what I have so far:
mse = 1/n *(symsum(((rm{i}-m{i})^2),i,1,n));
I am getting this error:
Error in pcmencdec_hw2…

anime girl
- 11
- 1
1
vote
1 answer
average mse optimization criterion for time series forecasting ("amse" in fable package for R)
The ETS function in the fable package for R provides an argument called opt_crit that specifies the quantity that is minimized during parameter estimation (there is also similar functionality in the forecast package). One of the options for this is…

Evan
- 13
- 2
1
vote
0 answers
Comparing convergence of hill and pickands estimators in R
i am working on extreme value theory, i used commands hillplot and pickandsplot of the package evmix to plot the hill and pickands estimators and get the threshold u and the number of excess…

wej
- 21
- 1
1
vote
2 answers
Using lapply() for data structured in lists of lists from simulation study
I have run up against the wall regarding the application of lapply() in a simulation study. The data are designed to help us understand how a standardization formula impacts the outcomes of a proposal ratings exercise.
There are three conditions…

blue and grey
- 393
- 7
- 21
1
vote
1 answer
PyTorch calculate MSE and MAE
I would like to calculate the MSE and MAE of the model below. The model is calculating the MSE after each Epoch. What do I need to do to get the overall MSE value, please? Can I use the same code to calculate the MAE? Many Thanks in…

Browed1983
- 179
- 2
- 7
- 16
1
vote
1 answer
Model.evaluate in keras with multi inputs and multi outputs
I m working on a deep multimodal autoencoder in the case of unsupervised learning which takes two inputs with shape of (1000, 50) and (1000,60) respectively to reconstruct the intial two inputs. The model has 3 hidden layers and aim to concatenate…

Andrea
- 113
- 1
- 7
1
vote
2 answers
(pytorch / mse) How can I change the shape of tensor?
Problem definition:
I have to use MSELoss function to define the loss to classification problem. Therefore it keeps saying the error message regarding the shape of tensor.
Entire error message:
torch.Size([32, 10]) torch.Size([32])
…

boralim
- 45
- 10