I have two pandas.Series
objects with equal number of elements (they are predictions and target values) and I need to compute the (R)MSE of these two series.
I can use
targets.sub(predictions).pow(2).mean()
for the MSE but I feel that there is a lot of copying1 involved (first for the subtraction result, then for the exponentiation result). Is there an elegant way that does not involve the two copies?
1 Maybe memory allocation is a better term.