NeuralProphet
raw JSON → 0.9.0 verified Mon Apr 27 auth: no python
NeuralProphet is a Python framework for interpretable time series forecasting built on PyTorch, combining Prophet's simplicity with neural networks. Current stable beta version is 0.9.0 (Python 3.9-3.12), with a 1.0.0 release candidate series in progress. Active development, monthly releases.
pip install neuralprophet Common errors
error RuntimeError: Cannot fit the model twice. Please create a new instance. ↓
cause Trying to refit an already fitted model. This is by design in PyTorch Lightning 2.0+.
fix
Create a new NeuralProphet instance before calling fit again.
error ModuleNotFoundError: No module named 'neural_prophet' ↓
cause Wrong import path: using underscore instead of the correct module name.
fix
Use 'from neuralprophet import NeuralProphet' (no underscore).
error TypeError: __init__() got an unexpected keyword argument 'seasonality_mode' ↓
cause Parameter was renamed or removed in newer versions.
fix
Check the documentation for the correct parameter name (e.g., 'seasonality_mode' was deprecated).
Warnings
breaking NeuralProphet uses PyTorch Lightning 2.0+. Fitting a model a second time without reinitialization raises a RuntimeError. ↓
fix Create a new model instance for each fit, or use m = NeuralProphet() again.
breaking Default batch size and epochs changed in 1.0.0rc5 (increased batch size, reduced epochs). Models may need retuning. ↓
fix Manually set batch_size and epochs if you rely on previous defaults.
breaking Python 3.8 support dropped in 0.8.0/1.0.0rc9. Minimum required Python is 3.9. ↓
fix Upgrade Python to 3.9+.
deprecated The 'epochs' parameter in fit() is deprecated in favor of controlling via trainer config. ↓
fix Use m.set_epochs(n) or pass parameters in NeuralProphet(epochs=n).
gotcha Input DataFrame must have columns 'ds' (timestamp) and 'y' (value). Column name mismatches cause silent errors. ↓
fix Rename columns: df = df.rename(columns={'date': 'ds', 'value': 'y'})
gotcha Frequency (freq) must be provided in fit() for proper seasonality and future dates. ↓
fix Pass freq='D', 'MS', etc. Inferred freq may be incorrect.
gotcha Loading a saved model on a different accelerator (e.g., GPU vs CPU) may fail. ↓
fix Upgrade to >=1.0.0rc6. If not possible, force map_location in your load code.
Imports
- NeuralProphet wrong
from neural_prophet import NeuralProphetcorrectfrom neuralprophet import NeuralProphet
Quickstart
import pandas as pd
from neuralprophet import NeuralProphet
df = pd.read_csv('https://raw.githubusercontent.com/ourownstory/neural_prophet/main/example_data/air_passengers.csv')
m = NeuralProphet()
m.fit(df, freq='MS')
future = m.make_future_dataframe(df, periods=12)
forecast = m.predict(future)
print(forecast)