Пророк о возвращении Google Colab - Ошибка: KeyError: 'metric_file' - PullRequest
0 голосов
/ 30 октября 2019

сегодня у меня начинаются проблемы с моим сценарием colab, использующим пророка в фейсбуке. Я пытаюсь воспроизвести ошибку на базовом скрипте.
Проблема в строке:

m.fit(df)

и здесь вы можете найти ошибку:

KeyError                                  Traceback (most recent call last)<br>
KeyError: 'metric_file'<br>
and the session crashed.<br>
<br>

Здесь вы можете найтиполный код:

Python

import pandas as pd

from fbprophet import Prophet

df=pd.read_csv('https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv')
df.head()

m = Prophet()

m.fit(df)

forecast = m.predict(future)

forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()

fig1 = m.plot(forecast)

Спасибо, Ф.

1 Ответ

0 голосов
/ 31 октября 2019

Теперь исправлено купить Google.

В моем скрипте есть ошибка, я забыл вставить две строки. Здесь вы можете найти рабочий код:

"" "Вступление Prophet от: https://facebook.github.io/prophet/docs/quick_start.html#python-api" ""

Python

импорт панд в виде pd из fbprophet import Prophet

Python

df = pd.read_csv ('https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv')

df.head ()

m = Prophet ()

m.fit (df)

** future = m.make_future_dataframe (периоды = 365)

future.tail () **

прогноз = m.predict (будущее)

прогноз [['ds', 'yhat', 'yhat_lower', 'yhat_upper']]. tail ()

fig1 = m.plot (прогноз)

...