首页 > 其他 > 详细

chickenpox数据集

时间:2021-05-26 22:02:21      阅读:94      评论:0      收藏:0      [点我收藏+]
数据集的官方描述:

class ChickenpoxDatasetLoader(object):
"""A dataset of county level chicken pox cases in Hungary between 2004
and 2014. We made it public during the development of PyTorch Geometric
Temporal. The underlying graph is static - vertices are counties and
edges are neighbourhoods. Vertex features are lagged weekly counts of the
chickenpox cases (we included 4 lags). The target is the weekly number of
cases for the upcoming week (signed integers). Our dataset consist of more
than 500 snapshots (weeks).
"""

翻译:
2004年到2014年期间匈牙利县级水痘病例数据集。
图是静态的——顶点是县;边是邻居;
顶点的特征是滞后的每周计数水痘病例(包含4个滞后);
目标:下一周的水痘的数量;
数据集包含了超过500个时间快照;


官方数据集的加载:
1     def _read_web_data(self):
2         #url = "https://raw.githubusercontent.com/bene?dekrozemberczki/pytorch_geometric_temporal/master/dataset/chickenpox.json"
3         #self._dataset = json.loads(urllib.request.urlopen(url).read())

 1     def _get_edges(self):  #加载边
 2         self._edges = np.array(self._dataset["edges"]).T
 3 
 4 
 5     def _get_edge_weights(self):  #一共有多少条边
 6         self._edge_weights = np.ones(self._edges.shape[1])
 7 
 8 
 9     def _get_targets_and_features(self):  #节点的属性;构建时间序列
10         stacked_target = np.array(self._dataset["FX"])   #m*n维,其中m是时间,n是节点的数量
        #时间切片
11 self.features = [stacked_target[i:i+self.lags,:].T for i in range(stacked_target.shape[0]-self.lags)] 12 self.targets = [stacked_target[i+self.lags,:].T for i in range(stacked_target.shape[0]-self.lags)] 13 14 15 def get_dataset(self, lags: int=4) -> StaticGraphTemporalSignal: 16 """Returning the Chickenpox Hungary data iterator. 17 18 Args types: 19 * **lags** *(int)* - The number of time lags. 20 Return types: 21 * **dataset** *(StaticGraphTemporalSignal)* - The Chickenpox Hungary dataset. 22 """ 23 self.lags = lags 24 self._get_edges() 25 self._get_edge_weights() 26 self._get_targets_and_features() 27 dataset = StaticGraphTemporalSignal(self._edges, self._edge_weights, self.features, self.targets) 28 return dataset

 


数据集解析:
dataset:


chickenpox数据集

原文:https://www.cnblogs.com/xmd-home/p/14814675.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!