Tracy Teal
07/01/2024, 7:36 PMEdward Samokhvalov <edward.samokhvalov@gmail.com>
Can you pls check if this API key has any 'hanging' calls in process? I can see no error returned, but neither anything is returning too, so looks like it's frozen or smth, I have just increased the number fo curves from 200 to 600ish and that's it.
nixtla-tok-yg6aUGKQnHfzAJJjPpeprRWN92ObI577gGYbNAYD7h8ojuhQgCw1bY8T06Ul3q1YT4zb3iHL8AD05UWs
cause it's been running for many hours now and still hanging, like some calls are waiting for return from your side.
sorry for bothering you, but this could really help. thanks in advance!
kevin
07/01/2024, 8:46 PMEdu
07/01/2024, 9:27 PMkevin
07/01/2024, 10:30 PMkevin
07/02/2024, 10:57 PMTracy Teal
07/02/2024, 11:16 PMEverything's good, it works, technically.
Let me share this bit where I have timegpt projections of various stocks clustered. http://eduardsamokhvalov.tech/stuff/timegpt_index.html (you can click on one picture to get to html version with zoom).
But what makes me a little suspicious (that I'm doing something wrong) is the shape of the projections, it's smooth, it's kinda choppy.
May you have a look?
periods=90 days
def calculate_TimeGPT(df, periods, seasonality_mode):
from nixtla import NixtlaClient
random_delay()
# Prepare data for Nixtla TimeGPT
df = df.rename(columns={'ds': 'timestamp', 'y': 'value'})
df['timestamp'] = pd.to_datetime(df['timestamp'])
df = df[['timestamp', 'value']]
df.ffill(inplace=True) # so we don't have NaNs, unless there will be no prev bar to fill NaN with
# Instantiate NixtlaClient with the provided API key
nixtla_client = NixtlaClient(api_key=get_config()['nixtla_api_key'])
# Validate API key (optional, if needed for your use case)
nixtla_client.validate_api_key()
# Forecast the next 'periods' steps using Nixtla's TimeGPT model
while(True):
try:
timegpt_fcst_df = nixtla_client.forecast(df=df, h=periods, freq='D', time_col='timestamp', target_col='value')
break
except Exception as ex:
print(ex)
print('nixtla API error, making a random delay and trying again soon')
random_delay()
timegpt_fcst_df = nixtla_client.forecast(df=df, h=periods, freq='D', time_col='timestamp', target_col='value')
return timegpt_fcst_df
QUESTION 2
Also I get these messages on every call
WARNINGnixtla.nixtla clientThe specified horizon "h" exceeds the model horizon. This may lead to less accurate forecasts. Please consider using a smaller horizon.
INFOnixtla.nixtla clientRestricting input...
INFOnixtla.nixtla clientCalling Forecast Endpoint...
so how can I be aware what's max adequate forecast horizon for a model?
QUESTION 3
It says 'restricting input', could you clarify what does it mean exactly?
kevin
07/03/2024, 7:12 AM