-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to adjust the period_len parameter for my data #6
Comments
Is your data formatted as follows?
This appears to be univariate data. You can convert it into the regular format:
You can use the following code to convert your dataset. This way, your data can fit into this framework's models without significant adjustments. You can try import pandas as pd
# Sample dataframe
data = pd.read_csv('your_data.csv', header=None)
# Assuming first column is date and rest are points
date_col = data.iloc[:, 0]
points_cols = data.iloc[:, 1:]
# Generating timestamps for each day assuming 15-minute intervals
timestamps = pd.date_range(start='00:00', periods=96, freq='15T').strftime('%H:%M:%S')
# Create new DataFrame to store the converted data
converted_data = pd.DataFrame()
# Iterate through each row (day) in the original data
for index, row in data.iterrows():
date = row[0]
for i in range(1, 97):
time = timestamps[i-1]
converted_data = converted_data.append({
'datetime': f"{date} {time}",
'value': row[i]
}, ignore_index=True)
# Save the converted data to a new CSV file
converted_data.to_csv('converted_data.csv', index=False) You can try the above method and see if it works. If it doesn't, feel free to reach out for further assistance. |
For 96 points of data a day, why not set the period_len to 96 instead of 4? Would this have any effect on the results of the experiment |
As discussed in Appendix C.2. and shown in Table 9, in scenarios with very long periods, an appropriate sparse strategy can be more effective. For instance, in the case of the ETTm1 dataset with a same period of 96, resampling with too large a period results in very short subsequences with sparse connections, leading to underutilization of information. In such cases, setting the period length to [2-6], i.e., adopting a denser sparse strategy, can be beneficial. Therefore, we recommend setting period_len=4 here. |
thank you very much |
Thank you for your patient answers. While reading your paper, I also found that you mentioned in your paper that sparse can be used in conjunction with GRU or Transformer. Where do you place GRU or Transformer on the network? |
Yes, the sparse technique can be combined with GRU or Transformer. Please refer to our response to Issue #8 , where we provide the implementation code on how to integrate the sparse technique with Transformer. The implementation for GRU is similar. If you need the code for that, we are happy to share it. |
Yeah, I think I need GRU related codes. Can you provide them? Thanks a lot ! |
Of course. You can try the following implementation code. Use
|
I read your source code and found that the input data you have here is indexed "y-MM-dd HH:mm:ss" and n columns of data. If my input data, the index is just "y-MM-dd", that is, one line represents a day, and a day has 96 points in time. How can I find the right "period_len" and whether the network should make any adjustments to the way I enter data
The text was updated successfully, but these errors were encountered: