直接看视频演示:
GCN+LSTM图卷积神经网络预警预测时间序列预测_哔哩哔哩_bilibili
模型图原理:
完整代码:
import torch
import torch.nn as nn
import torch.optim as optim
from torch_geometric.nn import GCNConv
from torch.utils.data import DataLoader, TensorDataset
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score, precision_score, recall_score
from sklearn.preprocessing import StandardScaler