Python Pandas: Simple example of calculating RMSE from data frame

后端 未结 2 1773
臣服心动
臣服心动 2021-01-11 16:48

Need a simple example of calculating RMSE with Pandas DataFrame. Providing there is function that returns in cycle true and predicted value:

def fun (data):
         


        
2条回答
  •  借酒劲吻你
    2021-01-11 17:07

    Question 1
    This depends on the format that data is in. And I'd expect you already have your true values, so this function is just a pass through.

    Question 2

    With pandas
    ((df.p - df.x) ** 2).mean() ** .5

    With numpy
    (np.diff(df.values) ** 2).mean() ** .5

提交回复
热议问题