Registry / ai-ml / neuralprophet

neuralprophet

JSON →
library0.9.0pypypi✓ verified 86d ago

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
INSTALL
IMPORT
SIG · NEURALPROPHET
N
neuralprophet
ai-mlpythonv0.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NeuralProphet
from neuralprophet import NeuralProphet
from neural_prophet import NeuralProphet
Hyphen in PyPI name, underscore in module

Basic forecast with NeuralProphet

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)
Debug
Known issues
breakingNeuralProphet 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.
affects: >=0.9.0
breakingDefault 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.
affects: >=1.0.0rc5
breakingPython 3.8 support dropped in 0.8.0/1.0.0rc9. Minimum required Python is 3.9.
fix
Upgrade Python to 3.9+.
affects: >=0.8.0
deprecatedThe '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).
affects: >=0.9.0
gotchaInput 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'})
affects: all
gotchaFrequency (freq) must be provided in fit() for proper seasonality and future dates.
fix
Pass freq='D', 'MS', etc. Inferred freq may be incorrect.
affects: all
gotchaLoading 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.
affects: <1.0.0rc6
Errors
Common errors & fixes
RuntimeError: Cannot fit the model twice. Please create a new instance.
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.
ModuleNotFoundError: No module named 'neural_prophet'
Wrong import path: using underscore instead of the correct module name.
fix
Use 'from neuralprophet import NeuralProphet' (no underscore).
TypeError: __init__() got an unexpected keyword argument 'seasonality_mode'
Parameter was renamed or removed in newer versions.
fix
Check the documentation for the correct parameter name (e.g., 'seasonality_mode' was deprecated).
Upgrade
Version history
0.9.0latest on PyPI · released Jun 21, 2024
Audit
Dependencies
torchrequiredCore deep learning engine
pytorch-lightningrequiredTraining loop abstraction (>=2.0)
lunarcalendaroptionalLunar calendar holiday support
Agent activity
2 hits · last 30 days
node
2
Resources
neuralprophet — pip install neuralprophet · libregistry