Comments (5)
I have the same question and look forward to the author's reply.
from cast.
need help too.
from cast.
Thank you for your interest in our work. To generate the 'peacor_adj.npy' file, you can use the code provided below.
def get_peacor_adj(data_path, threshold, save=False):
# Load the dataset
data = np.load(data_path + 'train.npz')['data']
print("Data shape:", data.shape)
# Compute the Pearson correlation coefficient matrix
peacor = torch.corrcoef(torch.Tensor(data[...,0]).permute(1, 0))
# Apply threshold
peacor[peacor < threshold] = 0
peacor[torch.eye(peacor.shape[0], dtype=bool)] = 0
# Normalize the coefficients
nonzero_peacor = peacor[peacor != 0]
p_min, p_max = nonzero_peacor.min(), nonzero_peacor.max()
peacor[peacor != 0] = (nonzero_peacor - p_min) / (p_max - p_min)
# Visualization
plt.figure(dpi=100)
sns.heatmap(peacor)
plt.show()
# Save the result
if save:
np.save(data_path + 'peacor_adj.npy', peacor)
For customization, you can also consider implementing your own method for creating the edge attribute, which can be an alternative to the Pearson correlation or the Time-delayed Dynamic Time Warping (DTW) method used in our paper.
from cast.
Thank you for your interest in our work. To generate the 'peacor_adj.npy' file, you can use the code provided below.
def get_peacor_adj(data_path, threshold, save=False): # Load the dataset data = np.load(data_path + 'train.npz')['data'] print("Data shape:", data.shape) # Compute the Pearson correlation coefficient matrix peacor = torch.corrcoef(torch.Tensor(data[...,0]).permute(1, 0)) # Apply threshold peacor[peacor < threshold] = 0 peacor[torch.eye(peacor.shape[0], dtype=bool)] = 0 # Normalize the coefficients nonzero_peacor = peacor[peacor != 0] p_min, p_max = nonzero_peacor.min(), nonzero_peacor.max() peacor[peacor != 0] = (nonzero_peacor - p_min) / (p_max - p_min) # Visualization plt.figure(dpi=100) sns.heatmap(peacor) plt.show() # Save the result if save: np.save(data_path + 'peacor_adj.npy', peacor)
For customization, you can also consider implementing your own method for creating the edge attribute, which can be an alternative to the Pearson correlation or the Time-delayed Dynamic Time Warping (DTW) method used in our paper.
Thank you very much for your work, but I have the same problem with this issue, that is, there are some other files, how do I get these files, or is there a python script that can generate these files?
Issue Address: #2
Need files: such as "adj_mx_pems08.pkl", "time_dalay_attr.pkl", "sparse_adj.npy", "peacor_adj.npy" and "dist_adj.npy".
from cast.
如何获取数据集(/pems8/dataset.npy,peacor_adj.npy ....)?
Excuse me for the interruption.
Have you successfully run this model? I want to run it, but I'm missing some necessary data files . Could you please share how you handled this issue?
I would greatly appreciate it.
from cast.
Related Issues (5)
- How to get dataset? HOT 2
- Number of edges HOT 4
- All dependent versions of the program HOT 1
- how to get dataset? 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 cast.