NumPy를 사용하여 IPython에서 평균 제곱근 오차를 계산하는 데 문제가 있습니다. 나는 기능이 권리입니다 확신 해요,하지만 난 입력 값을 시도 할 때, 그것은 나에게 다음과 같은 형식 오류 메시지 제공 : 여기 IPython/NumPy를 사용하여 RMSE를 계산하는 방법은 무엇입니까?
TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'
내 코드입니다 :
import numpy as np
def rmse(predictions, targets):
return np.sqrt(((predictions - targets) ** 2).mean())
print rmse((2,2,3),(0,2,6))
분명히 뭔가 잘못입니다 내 입력. 배열을 rmse():
행에 넣기 전에 배열을 만들어야합니까?
더 solutionss입니다 :의 http://stackoverflow.com/questions/17197492/root-mean-square-error-in-python – mrgloom
가능한 중복 [ python의 루트 평균 제곱 오류] (https://stackoverflow.com/questions/17197492/root-mean-square-error-in-python) – phunehehe