Comments (3)
Hi,
So I wanted to forecast some figures based on last years data...I have installed Prophet and using Notebook Jupyter
I can run these commands where I see the first 4 lines of the imported CSV sheet.
import pandas as pd
df = pd.read_csv(r'C:\Users\Public\Meds.csv',header=None)
df.head()
When trying to run anything with Prophet i.e m = Prophet() I get
NameError Traceback (most recent call last)
Cell In[109], line 1
----> 1 m = prophet()
NameError: name 'prophet' is not defined
Any help would be appreciated or sign posted towards a forum that may be able to offer some assistance. Thanks,
Are you sure you have done 'pip install prophet'? And if so have your made sure to import prophet at the top of your code?
Make sure to check the quick start:
quick start
from prophet.
Hi Vaslo,
I found this blog and started again https://blog.quantinsti.com/installing-prophet-library-windows/ and all seems okay at least nothing failed when installing!
I can run the command m = Prophet() in Notebook and doesn't complain now but my datasheet doesn't pass the fit test. I take this as a success but now need to work out why it doesn't like my datasheet as both coloums have ds (for dates) and y (for the figures) in the first cell of the spreadsheet as shown below when running the commands
import pandas as pd
df = pd.read_csv(r'C:\Users\Public\Meds.csv',header=None)
df.head()
0 1
0 ds y
1 01/01/2023 102
2 02/01/2023 114
3 03/01/2023 123
4 04/01/2023 116
m.fit(df) output
ValueError Traceback (most recent call last)
Cell In[133], line 1
----> 1 m.fit(df)
File ~\AppData\Local\anaconda3\Lib\site-packages\prophet\forecaster.py:1117, in Prophet.fit(self, df, **kwargs)
1114 raise Exception('Prophet object can only be fit once. '
1115 'Instantiate a new object.')
1116 if ('ds' not in df) or ('y' not in df):
-> 1117 raise ValueError(
1118 'Dataframe must have columns "ds" and "y" with the dates and '
1119 'values respectively.'
1120 )
1121 history = df[df['y'].notnull()].copy()
1122 if history.shape[0] < 2:
ValueError: Dataframe must have columns "ds" and "y" with the dates and values respectively.
from prophet.
Hi NickR001,
Without seeing your actual data, I think you might want your read_csv to be have a header for row 1 so that your dataframe should have ds and y as the first line when you read the head of the dataframe, and then your data will follow from there. This is more of a pandas issue rather than prophet, so once that is right you can at least get a simple model.
from prophet.
Related Issues (20)
- Prophet add.regressor not picking up regressor significance
- Cannot install package sentence_trasnformers
- Not getting what I expect from a Cross Validation using monthly data and cutoffs
- prophet.serialize FutureWarning: The behavior of Timestamp.utcfromtimestamp is deprecated...
- Seeking clarification on setting custom holiday prior scale HOT 2
- Schedule retrain an existing prophet model HOT 6
- New Forecasts on existing data different than original forecast.
- Problem with turtle andy pygame
- python: can't open file '/home/chris/cupp.py': [Errno 2] No such file or directory
- cant install fbprophet using pip install fbprophet HOT 2
- change cost function to Sum of square error
- Numpy dependency version needs to be bumped to 1.20.x for numpy.typing
- Weekend predictions and holidays on high frequency daily data
- I have a issue in installation of prophet library HOT 2
- error in pip install pystan, cython was installed, does anyone know how to solve it?
- Fit params for kwargs
- fbprophet installing error HOT 1
- RuntimeError: Error during optimization: console log output: dyld[10867]: Symbol not found
- pip install guardrails getting this error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prophet.