본문 바로가기

728x90
반응형

# Time Series

(5)
[Prophet] TypeError: ufunc 'isfinite' not supported for the input types 에러 Prophet을 실행하다가 갑자기 아래와 같은 에러가 등장했다. TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''해결 numpy와 matplotlib의 버전이 호환이 잘 안되는 경우 발생하는 문제로 확인된다. 따라서 두 패키지를 업데이트 하면 잘 실행이 된다. pip install numpy --upgrade pip install matplotlib --upgrade
[Prophet] Found NaN in column 'name' 에러 문제 add_regressor('name')함수를 사용하고 forecast = m.predict(future)를 했더니 위와 같은 에러가 나왔다. 해결 이는 회귀변수의 미래 값이 없기 때문이다. future.fillna(method='ffill',inplace=True) 없는 값을 fillna( )함수를 통해서 채워주었다.
[Prophet] Regressor 'name' missing from dataframe 에러 - add_regressor 함수 문제 Prophet에서 회귀변수를 추가하기 위해 add_regressor('name') 함수를 사용했더니 'Regressor 'name' missing from dataframe'에러가 나왔다. 해결 이를 해결하기 위해서는 future_dataframe에도 동일한 이름의 column이 존재해야 한다. future = m.make_future_dataframe(periods=365) future['name'] = df['name'] 위의 코드와 같이 df와 future 모두 name(회귀하고싶은 변수 명)이 동일하게 있어야 해당 문제를 해결할 수 있다. 혹시 Found NaN in column 'name' 오류를 발견하게 된다면 다음 글을 확인해보자! 2023.01.18 - [분류 전체보기] - [Prop..
[Time Series] Neural Prophet 정리 https://neuralprophet.com/contents.html NeuralProphet documentation Next Quick Start Guide neuralprophet.com 공식 문서를 정리한 글입니다. Prophet + 신경망(Neural Network) Prophet은 시계열 예측 성능보다는 손쉬운 사용, 예측 결과 해석에 초점을 맞춤 비즈니스적인 시사점이 필요할 때 Prophet은 유용하게 사용된다. 기존의 Prophet보다 52~92% 성능 개선 $$ \hat{y}_t = T(t) + S(t) + E(t) + F(t) + A(t) + L(t) $$ $T(t)$ : 선형함수를 통하여 비선형 트렌트를 예측 $S(t)$ : 다중 계절성 포착 $E(t)$ : 이벤트를 모델에 적용 $..
[Time Series] Prophet 정리 Prophet fbprophet에서 package 명이 prophet으로 바뀜 python 3.11에서 작동하지 않아, 3.7로 버전다운시키고 사용 pip install prophet후 plotly를 재설치 해야함 ds와 y의 column을 가져야 한다. ds의 경우 yyyy-mm-dd (hh:mm:ss)형식을 맞추는 것이 좋음 m = Prophet() m.add_country_holidays(country_name='KR') m.fit(df) Prophet Parameter seasonality_mode='multiplicative' : 곱셈 계절성 holidays_prior_scale=0.05 : 휴일 계절성(default = 10) growth='flat' : 일정한 추세 성장률 너무 극단적인 값 ..

728x90
반응형