Sheldon123z commited on
Commit
9fd1fad
·
verified ·
1 Parent(s): 0b9cc79

Initial upload: Power System Datasets Collection

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. DOWNLOAD_GUIDE.md +132 -0
  3. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/PowerQualityDistributionDataset1.csv +3 -0
  4. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/prepare_dataset.py +127 -0
  5. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/prepare_dataset_v2.py +255 -0
  6. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/test.csv +0 -0
  7. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/test_label.csv +1059 -0
  8. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/test_label_detailed.csv +1059 -0
  9. Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/train.csv +0 -0
  10. README.md +95 -0
  11. University_Lab_PQ/0_Monitor_variables_Proure.xlsx +0 -0
  12. University_Lab_PQ/Monitor_Fri_Aug_09_2024.xlsx +0 -0
  13. University_Lab_PQ/Monitor_Fri_Aug_30_2024.xlsx +0 -0
  14. University_Lab_PQ/Monitor_Fri_Jul_12_2024.xlsx +0 -0
  15. University_Lab_PQ/Monitor_Fri_Jun_21_2024.xlsx +0 -0
  16. University_Lab_PQ/Monitor_Fri_May_10_2024.xlsx +0 -0
  17. University_Lab_PQ/Monitor_Fri_May_31_2024.xlsx +0 -0
  18. University_Lab_PQ/Monitor_Fri_Nov_08_2024.xlsx +0 -0
  19. University_Lab_PQ/Monitor_Fri_Nov_29_2024.xlsx +0 -0
  20. University_Lab_PQ/Monitor_Fri_Oct_18_2024.xlsx +0 -0
  21. University_Lab_PQ/Monitor_Fri_Sep_20_2024.xlsx +0 -0
  22. University_Lab_PQ/Monitor_Fri_Sep_27_2024.xlsx +0 -0
  23. University_Lab_PQ/Monitor_Mon_Apr_22_2024.xlsx +0 -0
  24. University_Lab_PQ/Monitor_Mon_Aug_12_2024.xlsx +0 -0
  25. University_Lab_PQ/Monitor_Mon_Dec_02_2024.xlsx +0 -0
  26. University_Lab_PQ/Monitor_Mon_Jul_15_2024.xlsx +0 -0
  27. University_Lab_PQ/Monitor_Mon_Jun_03_2024.xlsx +0 -0
  28. University_Lab_PQ/Monitor_Mon_Jun_24_2024.xlsx +0 -0
  29. University_Lab_PQ/Monitor_Mon_May_13_2024.xlsx +0 -0
  30. University_Lab_PQ/Monitor_Mon_Nov_11_2024.xlsx +0 -0
  31. University_Lab_PQ/Monitor_Mon_Oct_21_2024.xlsx +0 -0
  32. University_Lab_PQ/Monitor_Mon_Sep_02_2024.xlsx +0 -0
  33. University_Lab_PQ/Monitor_Mon_Sep_30_2024.xlsx +0 -0
  34. University_Lab_PQ/Monitor_Sat_Aug_03_2024.xlsx +0 -0
  35. University_Lab_PQ/Monitor_Sat_Aug_24_2024.xlsx +0 -0
  36. University_Lab_PQ/Monitor_Sat_Jul_06_2024.xlsx +0 -0
  37. University_Lab_PQ/Monitor_Sat_Jun_15_2024.xlsx +0 -0
  38. University_Lab_PQ/Monitor_Sat_May_04_2024.xlsx +0 -0
  39. University_Lab_PQ/Monitor_Sat_May_25_2024.xlsx +0 -0
  40. University_Lab_PQ/Monitor_Sat_Nov_02_2024.xlsx +0 -0
  41. University_Lab_PQ/Monitor_Sat_Nov_23_2024.xlsx +0 -0
  42. University_Lab_PQ/Monitor_Sat_Oct_12_2024.xlsx +0 -0
  43. University_Lab_PQ/Monitor_Sat_Sep_14_2024.xlsx +0 -0
  44. University_Lab_PQ/Monitor_Sun_Apr_28_2024.xlsx +0 -0
  45. University_Lab_PQ/Monitor_Sun_Aug_18_2024.xlsx +0 -0
  46. University_Lab_PQ/Monitor_Sun_Dec_08_2024.xlsx +0 -0
  47. University_Lab_PQ/Monitor_Sun_Jul_21_2024.xlsx +0 -0
  48. University_Lab_PQ/Monitor_Sun_Jul_28_2024.xlsx +0 -0
  49. University_Lab_PQ/Monitor_Sun_Jun_09_2024.xlsx +0 -0
  50. University_Lab_PQ/Monitor_Sun_Jun_30_2024.xlsx +0 -0
.gitattributes CHANGED
@@ -57,3 +57,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
60
+ Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/PowerQualityDistributionDataset1.csv filter=lfs diff=lfs merge=lfs -text
DOWNLOAD_GUIDE.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 数据集下载指南
2
+
3
+ ## 一、Kaggle 数据集 (需登录)
4
+
5
+ ### 1. Pecan Street Electricity Data ⭐推荐
6
+
7
+ **下载链接**: https://www.kaggle.com/datasets/zhitingzheng/pecan-street-electricity-data
8
+
9
+ **内容说明**:
10
+ - 10户 Austin 家庭的电路级用电数据
11
+ - 1分钟分辨率
12
+ - 包含 4CP 高峰期数据
13
+ - 适合负荷分析和异常检测
14
+
15
+ **下载步骤**:
16
+ 1. 登录 Kaggle 账号
17
+ 2. 点击 "Download" 按钮
18
+ 3. 解压到 `Pecan_Street/` 目录
19
+
20
+ **预期文件**:
21
+ ```
22
+ Pecan_Street/
23
+ ├── *.csv (用电数据文件)
24
+ └── ...
25
+ ```
26
+
27
+ ---
28
+
29
+ ### 2. SGCC Electricity Theft Detection
30
+
31
+ **下载链接**: https://www.kaggle.com/datasets/bensalem14/sgcc-dataset
32
+
33
+ **内容说明**:
34
+ - 42,372 用户的用电量数据
35
+ - 1,035 天时间跨度
36
+ - 用于窃电检测研究
37
+ - ⚠️ 不含电压数据
38
+
39
+ **下载步骤**:
40
+ 1. 登录 Kaggle 账号
41
+ 2. 点击 "Download" 按钮
42
+ 3. 解压到 `SGCC_Theft_Detection/` 目录
43
+
44
+ ---
45
+
46
+ ## 二、学术数据集
47
+
48
+ ### 3. University Laboratory Power Quality (MDPI 2024)
49
+
50
+ **论文链接**: https://www.mdpi.com/2306-5729/10/11/170
51
+
52
+ **内容说明**:
53
+ - 三相电压 (Va, Vb, Vc)
54
+ - 三相电流 (Ia, Ib, Ic)
55
+ - 有功/无功功率
56
+ - 功率因数、频率
57
+ - 10分钟间隔,34,128条记录
58
+
59
+ **下载步骤**:
60
+ 1. 访问论文页面
61
+ 2. 找到 "Supplementary Materials" 部分
62
+ 3. 下载数据文件
63
+ 4. 放入 `University_Lab_PQ/` 目录
64
+
65
+ ---
66
+
67
+ ## 三、需申请的数据集
68
+
69
+ ### 4. Pecan Street Dataport (完整版)
70
+
71
+ **申请链接**: https://dataport.pecanstreet.org/
72
+
73
+ **内容说明**:
74
+ - 1000+ 家庭的完整数据
75
+ - 1秒/1分钟/15分钟分辨率
76
+ - 包含电压、THD、功率因数等
77
+
78
+ **申请条件**:
79
+ - 必须是大学研究人员
80
+ - 非商业用途
81
+ - 需机构邮箱注册
82
+
83
+ ### 5. UK-DALE
84
+
85
+ **申请链接**: https://jack-kelly.com/data/
86
+
87
+ **内容说明**:
88
+ - 英国住宅高频用电数据
89
+ - 1秒/6秒分辨率
90
+ - 包含电压数据
91
+
92
+ ---
93
+
94
+ ## 四、数据集优先级
95
+
96
+ 对于**电压异常检测**研究:
97
+
98
+ | 优先级 | 数据集 | 原因 |
99
+ |:-----:|--------|------|
100
+ | 1 | Pecan Street (Kaggle) | 免费,含电压,住宅级 |
101
+ | 2 | University Lab (MDPI) | 免费,三相电压,电能质量 |
102
+ | 3 | Pecan Street (Dataport) | 需申请,最完整 |
103
+ | 4 | UK-DALE | 需申请,高分辨率 |
104
+ | 5 | SGCC | 免费但无电压数据 |
105
+
106
+ ---
107
+
108
+ ## 五、配置 Kaggle CLI (可选)
109
+
110
+ 如果想使用命令行下载:
111
+
112
+ ```bash
113
+ # 1. 安装 kaggle
114
+ pip install kaggle
115
+
116
+ # 2. 获取 API Token
117
+ # - 登录 kaggle.com
118
+ # - 点击头像 → Settings → API → Create New Token
119
+ # - 下载 kaggle.json
120
+
121
+ # 3. 配置
122
+ mkdir -p ~/.kaggle
123
+ mv ~/Downloads/kaggle.json ~/.kaggle/
124
+ chmod 600 ~/.kaggle/kaggle.json
125
+
126
+ # 4. 下载数据集
127
+ kaggle datasets download -d zhitingzheng/pecan-street-electricity-data -p Pecan_Street --unzip
128
+ ```
129
+
130
+ ---
131
+
132
+ *创建时间: 2026-02-02*
Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/PowerQualityDistributionDataset1.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d536bc9c4e670b8d7f9ca7998a30ce95bf9f49a46611d59f80c660bf11fbee77
3
+ size 19111658
Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/prepare_dataset.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Kaggle Power Quality Dataset Preparation Script
3
+
4
+ Converts PowerQualityDistributionDataset1.csv to anomaly detection format.
5
+
6
+ Dataset info:
7
+ - 11,998 records with 128 waveform samples each
8
+ - 5 classes: 1, 2, 3, 4, 5 (balanced)
9
+ - Class 3 is selected as "normal" (largest group)
10
+ - Other classes (1, 2, 4, 5) are "anomaly"
11
+
12
+ Output files:
13
+ - train.csv: Training data (normal samples only, 80% of Class 3)
14
+ - test.csv: Test data (20% Class 3 + all anomaly samples)
15
+ - test_label.csv: Binary labels (0=normal, 1=anomaly)
16
+ """
17
+
18
+ import os
19
+ import pandas as pd
20
+ import numpy as np
21
+ from sklearn.model_selection import train_test_split
22
+
23
+ # Configuration
24
+ NORMAL_CLASS = 3 # Class to use as "normal"
25
+ TRAIN_RATIO = 0.8 # 80% normal for training
26
+ RANDOM_SEED = 42
27
+
28
+ def prepare_dataset():
29
+ """Convert Kaggle dataset to anomaly detection format."""
30
+
31
+ # Get script directory
32
+ script_dir = os.path.dirname(os.path.abspath(__file__))
33
+
34
+ # Load original dataset
35
+ input_file = os.path.join(script_dir, "PowerQualityDistributionDataset1.csv")
36
+ print(f"Loading: {input_file}")
37
+
38
+ df = pd.read_csv(input_file, index_col=0)
39
+ print(f"Original shape: {df.shape}")
40
+ print(f"Columns: {df.columns.tolist()[:5]} ... {df.columns.tolist()[-5:]}")
41
+
42
+ # Separate features and labels
43
+ feature_cols = [col for col in df.columns if col != 'output']
44
+ X = df[feature_cols].values # (11998, 128)
45
+ y = df['output'].values # (11998,)
46
+
47
+ print(f"\nClass distribution:")
48
+ for cls in sorted(np.unique(y)):
49
+ count = np.sum(y == cls)
50
+ print(f" Class {cls}: {count} ({100*count/len(y):.1f}%)")
51
+
52
+ # Split by class
53
+ normal_mask = (y == NORMAL_CLASS)
54
+ anomaly_mask = ~normal_mask
55
+
56
+ X_normal = X[normal_mask]
57
+ X_anomaly = X[anomaly_mask]
58
+
59
+ print(f"\nNormal (Class {NORMAL_CLASS}): {len(X_normal)}")
60
+ print(f"Anomaly (Other classes): {len(X_anomaly)}")
61
+
62
+ # Split normal data into train/test
63
+ X_normal_train, X_normal_test = train_test_split(
64
+ X_normal,
65
+ train_size=TRAIN_RATIO,
66
+ random_state=RANDOM_SEED
67
+ )
68
+
69
+ print(f"\nTrain (normal only): {len(X_normal_train)}")
70
+ print(f"Test normal: {len(X_normal_test)}")
71
+ print(f"Test anomaly: {len(X_anomaly)}")
72
+
73
+ # Create test set: normal_test + all anomaly
74
+ X_test = np.vstack([X_normal_test, X_anomaly])
75
+ y_test = np.concatenate([
76
+ np.zeros(len(X_normal_test)), # 0 = normal
77
+ np.ones(len(X_anomaly)) # 1 = anomaly
78
+ ])
79
+
80
+ # Shuffle test set
81
+ np.random.seed(RANDOM_SEED)
82
+ shuffle_idx = np.random.permutation(len(X_test))
83
+ X_test = X_test[shuffle_idx]
84
+ y_test = y_test[shuffle_idx]
85
+
86
+ print(f"\nFinal test set: {len(X_test)}")
87
+ print(f" Normal: {np.sum(y_test == 0)} ({100*np.sum(y_test == 0)/len(y_test):.1f}%)")
88
+ print(f" Anomaly: {np.sum(y_test == 1)} ({100*np.sum(y_test == 1)/len(y_test):.1f}%)")
89
+
90
+ # Convert to DataFrame format for saving
91
+ # Feature column names: Col1, Col2, ..., Col128
92
+ col_names = [f'Col{i+1}' for i in range(X_normal_train.shape[1])]
93
+
94
+ # Save train.csv (features only, no labels)
95
+ train_df = pd.DataFrame(X_normal_train, columns=col_names)
96
+ train_file = os.path.join(script_dir, "train.csv")
97
+ train_df.to_csv(train_file, index=False)
98
+ print(f"\nSaved: {train_file} ({train_df.shape})")
99
+
100
+ # Save test.csv (features only)
101
+ test_df = pd.DataFrame(X_test, columns=col_names)
102
+ test_file = os.path.join(script_dir, "test.csv")
103
+ test_df.to_csv(test_file, index=False)
104
+ print(f"Saved: {test_file} ({test_df.shape})")
105
+
106
+ # Save test_label.csv (binary labels)
107
+ label_df = pd.DataFrame(y_test.astype(int), columns=['label'])
108
+ label_file = os.path.join(script_dir, "test_label.csv")
109
+ label_df.to_csv(label_file, index=False)
110
+ print(f"Saved: {label_file} ({label_df.shape})")
111
+
112
+ # Summary
113
+ print("\n" + "="*50)
114
+ print("Dataset preparation complete!")
115
+ print("="*50)
116
+ print(f"Training samples: {len(train_df)} (100% normal)")
117
+ print(f"Test samples: {len(test_df)}")
118
+ print(f" - Normal: {np.sum(y_test == 0)}")
119
+ print(f" - Anomaly: {np.sum(y_test == 1)}")
120
+ print(f"Anomaly ratio in test: {100*np.sum(y_test == 1)/len(y_test):.2f}%")
121
+ print(f"Feature dimensions: {X_normal_train.shape[1]}")
122
+
123
+ return train_df, test_df, label_df
124
+
125
+
126
+ if __name__ == "__main__":
127
+ prepare_dataset()
Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/prepare_dataset_v2.py ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Kaggle Power Quality Dataset Preparation Script V2
3
+
4
+ 改进版数据准备脚本,支持可配置的异常比例。
5
+
6
+ 设计原则:
7
+ 1. 训练集:只包含正常数据(单类学习)
8
+ 2. 测试集:正常数据 + 部分异常数据,控制异常比例
9
+ 3. 各类异常均衡采样,保持异常类型多样性
10
+
11
+ 数据集信息:
12
+ - 原始数据: 11,998 条记录,128 维波形特征
13
+ - 5 类: 1=Transient, 2=Sag, 3=Normal, 4=Swell, 5=Harmonics
14
+ - 每类约 2,400 样本(均衡分布)
15
+
16
+ 输出文件:
17
+ - train.csv: 训练数据(仅正常样本)
18
+ - test.csv: 测试数据(正常 + 部分异常)
19
+ - test_label.csv: 二值标签(0=正常, 1=异常)
20
+
21
+ Usage:
22
+ python prepare_dataset_v2.py --anomaly_ratio 0.15
23
+ python prepare_dataset_v2.py --anomaly_ratio 0.20
24
+ """
25
+
26
+ import os
27
+ import argparse
28
+ import pandas as pd
29
+ import numpy as np
30
+ from sklearn.model_selection import train_test_split
31
+
32
+
33
+ def prepare_dataset_v2(
34
+ anomaly_ratio: float = 0.15,
35
+ train_ratio: float = 0.70,
36
+ normal_class: int = 3,
37
+ random_seed: int = 42,
38
+ output_dir: str = None
39
+ ):
40
+ """
41
+ 准备适合异常检测的数据集。
42
+
43
+ Args:
44
+ anomaly_ratio: 测试集中的异常比例 (0.0-1.0),默认 15%
45
+ train_ratio: 正常数据用于训练的比例,默认 70%
46
+ normal_class: 定义为正常的类别,默认 Class 3
47
+ random_seed: 随机种子
48
+ output_dir: 输出目录,默认为脚本所在目录
49
+
50
+ Returns:
51
+ train_df, test_df, label_df
52
+ """
53
+ np.random.seed(random_seed)
54
+
55
+ # 确定输出目录
56
+ script_dir = os.path.dirname(os.path.abspath(__file__))
57
+ if output_dir is None:
58
+ output_dir = script_dir
59
+
60
+ # 加载原始数据
61
+ input_file = os.path.join(script_dir, "PowerQualityDistributionDataset1.csv")
62
+ print(f"Loading: {input_file}")
63
+
64
+ df = pd.read_csv(input_file, index_col=0)
65
+ print(f"Original shape: {df.shape}")
66
+
67
+ # 分离特征和标签
68
+ feature_cols = [col for col in df.columns if col != 'output']
69
+ X = df[feature_cols].values # (11998, 128)
70
+ y = df['output'].values # (11998,)
71
+
72
+ # 显示原始类别分布
73
+ print(f"\n原始类别分布:")
74
+ class_names = {1: 'Transient', 2: 'Sag', 3: 'Normal', 4: 'Swell', 5: 'Harmonics'}
75
+ for cls in sorted(np.unique(y)):
76
+ count = np.sum(y == cls)
77
+ name = class_names.get(cls, f'Class{cls}')
78
+ print(f" Class {cls} ({name}): {count} ({100*count/len(y):.1f}%)")
79
+
80
+ # 按类别分离数据
81
+ normal_mask = (y == normal_class)
82
+ X_normal = X[normal_mask]
83
+ y_original = y[~normal_mask] # 保留原始异常类别信息
84
+ X_anomaly = X[~normal_mask]
85
+
86
+ # 按异常类别分组
87
+ anomaly_classes = [c for c in np.unique(y) if c != normal_class]
88
+ X_by_class = {}
89
+ for cls in anomaly_classes:
90
+ mask = (y == cls)
91
+ X_by_class[cls] = X[mask]
92
+ print(f" 异常类 {cls}: {len(X_by_class[cls])} 样本")
93
+
94
+ print(f"\n正常数据 (Class {normal_class}): {len(X_normal)} 样本")
95
+ print(f"异常数据 (其他类): {len(X_anomaly)} 样本")
96
+
97
+ # === 划分训练集和测试集 ===
98
+
99
+ # 1. 正常数据划分
100
+ X_normal_train, X_normal_test = train_test_split(
101
+ X_normal,
102
+ train_size=train_ratio,
103
+ random_state=random_seed
104
+ )
105
+
106
+ n_normal_test = len(X_normal_test)
107
+ print(f"\n训练集 (仅正常): {len(X_normal_train)} 样本")
108
+ print(f"测试集正常部分: {n_normal_test} 样本")
109
+
110
+ # 2. 计算需要的异常样本数量
111
+ # anomaly_ratio = n_anomaly / (n_normal + n_anomaly)
112
+ # n_anomaly = anomaly_ratio * n_normal / (1 - anomaly_ratio)
113
+ n_anomaly_needed = int(anomaly_ratio * n_normal_test / (1 - anomaly_ratio))
114
+
115
+ # 每类异常均衡采样
116
+ n_per_class = n_anomaly_needed // len(anomaly_classes)
117
+ remainder = n_anomaly_needed % len(anomaly_classes)
118
+
119
+ print(f"\n目标异常比例: {anomaly_ratio*100:.1f}%")
120
+ print(f"需要异常样本: {n_anomaly_needed} 个")
121
+ print(f"每类采样: {n_per_class} 个 (共 {len(anomaly_classes)} 类)")
122
+
123
+ # 3. 从每类异常中采样
124
+ X_anomaly_test = []
125
+ y_anomaly_class = [] # 记录原始类别(用于分析)
126
+
127
+ for i, cls in enumerate(anomaly_classes):
128
+ X_cls = X_by_class[cls]
129
+ n_sample = n_per_class + (1 if i < remainder else 0)
130
+ n_sample = min(n_sample, len(X_cls)) # 不超过可用样本数
131
+
132
+ indices = np.random.choice(len(X_cls), size=n_sample, replace=False)
133
+ X_anomaly_test.append(X_cls[indices])
134
+ y_anomaly_class.extend([cls] * n_sample)
135
+
136
+ print(f" Class {cls} ({class_names[cls]}): 采样 {n_sample} 个")
137
+
138
+ X_anomaly_test = np.vstack(X_anomaly_test)
139
+ y_anomaly_class = np.array(y_anomaly_class)
140
+
141
+ # 4. 组合测试集
142
+ X_test = np.vstack([X_normal_test, X_anomaly_test])
143
+ y_test = np.concatenate([
144
+ np.zeros(len(X_normal_test)), # 0 = 正常
145
+ np.ones(len(X_anomaly_test)) # 1 = 异常
146
+ ])
147
+
148
+ # 保���原始类别信息(用于详细分析)
149
+ y_test_original_class = np.concatenate([
150
+ np.full(len(X_normal_test), normal_class),
151
+ y_anomaly_class
152
+ ])
153
+
154
+ # 5. 打乱测试集
155
+ shuffle_idx = np.random.permutation(len(X_test))
156
+ X_test = X_test[shuffle_idx]
157
+ y_test = y_test[shuffle_idx]
158
+ y_test_original_class = y_test_original_class[shuffle_idx]
159
+
160
+ # === 保存数据 ===
161
+
162
+ col_names = [f'Col{i+1}' for i in range(X_normal_train.shape[1])]
163
+
164
+ # 训练集
165
+ train_df = pd.DataFrame(X_normal_train, columns=col_names)
166
+ train_file = os.path.join(output_dir, "train.csv")
167
+ train_df.to_csv(train_file, index=False)
168
+ print(f"\n保存: {train_file} ({train_df.shape})")
169
+
170
+ # 测试集
171
+ test_df = pd.DataFrame(X_test, columns=col_names)
172
+ test_file = os.path.join(output_dir, "test.csv")
173
+ test_df.to_csv(test_file, index=False)
174
+ print(f"保存: {test_file} ({test_df.shape})")
175
+
176
+ # 二值标签
177
+ label_df = pd.DataFrame(y_test.astype(int), columns=['label'])
178
+ label_file = os.path.join(output_dir, "test_label.csv")
179
+ label_df.to_csv(label_file, index=False)
180
+ print(f"保存: {label_file} ({label_df.shape})")
181
+
182
+ # 详细类别标签(可选,用于分析)
183
+ detail_label_df = pd.DataFrame({
184
+ 'label': y_test.astype(int),
185
+ 'original_class': y_test_original_class.astype(int)
186
+ })
187
+ detail_file = os.path.join(output_dir, "test_label_detailed.csv")
188
+ detail_label_df.to_csv(detail_file, index=False)
189
+ print(f"保存: {detail_file} (包含原始类别信息)")
190
+
191
+ # === 统计摘要 ===
192
+
193
+ actual_anomaly_ratio = np.sum(y_test == 1) / len(y_test)
194
+
195
+ print("\n" + "=" * 60)
196
+ print("数据集准备完成!")
197
+ print("=" * 60)
198
+ print(f"训练集: {len(train_df)} 样本 (100% 正常)")
199
+ print(f"测试集: {len(test_df)} 样本")
200
+ print(f" - 正常: {int(np.sum(y_test == 0))} ({100*(1-actual_anomaly_ratio):.1f}%)")
201
+ print(f" - 异常: {int(np.sum(y_test == 1))} ({100*actual_anomaly_ratio:.1f}%)")
202
+ print(f"实际异常比例: {100*actual_anomaly_ratio:.2f}%")
203
+ print(f"特征维度: {X_normal_train.shape[1]}")
204
+
205
+ # 测试集异常类别分布
206
+ print(f"\n测试集异常类别分布:")
207
+ for cls in anomaly_classes:
208
+ count = np.sum(y_test_original_class == cls)
209
+ print(f" Class {cls} ({class_names[cls]}): {count}")
210
+
211
+ return train_df, test_df, label_df
212
+
213
+
214
+ def main():
215
+ parser = argparse.ArgumentParser(
216
+ description='准备 Kaggle Power Quality 异常检测数据集 (V2)',
217
+ formatter_class=argparse.RawDescriptionHelpFormatter,
218
+ epilog="""
219
+ 示例:
220
+ python prepare_dataset_v2.py # 默认 15% 异常比例
221
+ python prepare_dataset_v2.py --anomaly_ratio 0.10 # 10% 异常比例
222
+ python prepare_dataset_v2.py --anomaly_ratio 0.20 # 20% 异常比例
223
+ """
224
+ )
225
+
226
+ parser.add_argument(
227
+ '--anomaly_ratio', type=float, default=0.15,
228
+ help='测试集中的异常比例 (0.0-1.0),默认 0.15 (15%%)'
229
+ )
230
+ parser.add_argument(
231
+ '--train_ratio', type=float, default=0.70,
232
+ help='正常数据用于训练的比例,默认 0.70 (70%%)'
233
+ )
234
+ parser.add_argument(
235
+ '--seed', type=int, default=42,
236
+ help='随机种子,默认 42'
237
+ )
238
+
239
+ args = parser.parse_args()
240
+
241
+ if not 0.0 < args.anomaly_ratio < 1.0:
242
+ parser.error("anomaly_ratio 必须在 0.0 到 1.0 之间")
243
+
244
+ if not 0.0 < args.train_ratio < 1.0:
245
+ parser.error("train_ratio 必须在 0.0 到 1.0 之间")
246
+
247
+ prepare_dataset_v2(
248
+ anomaly_ratio=args.anomaly_ratio,
249
+ train_ratio=args.train_ratio,
250
+ random_seed=args.seed
251
+ )
252
+
253
+
254
+ if __name__ == "__main__":
255
+ main()
Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/test.csv ADDED
The diff for this file is too large to render. See raw diff
 
Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/test_label.csv ADDED
@@ -0,0 +1,1059 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 0
179
+ 0
180
+ 0
181
+ 0
182
+ 0
183
+ 0
184
+ 0
185
+ 0
186
+ 0
187
+ 0
188
+ 0
189
+ 0
190
+ 0
191
+ 0
192
+ 1
193
+ 1
194
+ 0
195
+ 0
196
+ 0
197
+ 0
198
+ 0
199
+ 0
200
+ 0
201
+ 0
202
+ 0
203
+ 0
204
+ 0
205
+ 0
206
+ 0
207
+ 0
208
+ 0
209
+ 0
210
+ 0
211
+ 1
212
+ 0
213
+ 0
214
+ 0
215
+ 1
216
+ 0
217
+ 0
218
+ 0
219
+ 1
220
+ 0
221
+ 0
222
+ 0
223
+ 0
224
+ 1
225
+ 0
226
+ 0
227
+ 0
228
+ 0
229
+ 0
230
+ 1
231
+ 0
232
+ 1
233
+ 0
234
+ 0
235
+ 0
236
+ 1
237
+ 0
238
+ 0
239
+ 0
240
+ 1
241
+ 0
242
+ 0
243
+ 0
244
+ 0
245
+ 0
246
+ 0
247
+ 0
248
+ 0
249
+ 0
250
+ 0
251
+ 1
252
+ 0
253
+ 0
254
+ 0
255
+ 0
256
+ 0
257
+ 0
258
+ 1
259
+ 0
260
+ 0
261
+ 0
262
+ 0
263
+ 1
264
+ 1
265
+ 0
266
+ 0
267
+ 0
268
+ 1
269
+ 1
270
+ 0
271
+ 0
272
+ 0
273
+ 1
274
+ 0
275
+ 0
276
+ 0
277
+ 0
278
+ 0
279
+ 1
280
+ 0
281
+ 0
282
+ 0
283
+ 1
284
+ 1
285
+ 0
286
+ 0
287
+ 0
288
+ 0
289
+ 0
290
+ 0
291
+ 0
292
+ 0
293
+ 0
294
+ 1
295
+ 1
296
+ 0
297
+ 0
298
+ 0
299
+ 0
300
+ 0
301
+ 0
302
+ 0
303
+ 0
304
+ 0
305
+ 0
306
+ 0
307
+ 0
308
+ 0
309
+ 0
310
+ 0
311
+ 0
312
+ 0
313
+ 0
314
+ 0
315
+ 0
316
+ 0
317
+ 0
318
+ 1
319
+ 1
320
+ 1
321
+ 0
322
+ 0
323
+ 1
324
+ 0
325
+ 0
326
+ 1
327
+ 0
328
+ 0
329
+ 0
330
+ 0
331
+ 0
332
+ 0
333
+ 0
334
+ 0
335
+ 1
336
+ 0
337
+ 0
338
+ 0
339
+ 0
340
+ 1
341
+ 0
342
+ 0
343
+ 0
344
+ 0
345
+ 0
346
+ 0
347
+ 0
348
+ 0
349
+ 0
350
+ 0
351
+ 1
352
+ 0
353
+ 0
354
+ 0
355
+ 0
356
+ 0
357
+ 0
358
+ 0
359
+ 0
360
+ 0
361
+ 1
362
+ 0
363
+ 0
364
+ 0
365
+ 0
366
+ 0
367
+ 0
368
+ 0
369
+ 0
370
+ 0
371
+ 1
372
+ 0
373
+ 0
374
+ 0
375
+ 0
376
+ 0
377
+ 0
378
+ 0
379
+ 0
380
+ 1
381
+ 1
382
+ 1
383
+ 1
384
+ 0
385
+ 1
386
+ 0
387
+ 0
388
+ 0
389
+ 0
390
+ 0
391
+ 0
392
+ 0
393
+ 0
394
+ 0
395
+ 1
396
+ 0
397
+ 0
398
+ 0
399
+ 1
400
+ 0
401
+ 0
402
+ 0
403
+ 0
404
+ 0
405
+ 0
406
+ 0
407
+ 0
408
+ 0
409
+ 0
410
+ 0
411
+ 0
412
+ 0
413
+ 0
414
+ 0
415
+ 0
416
+ 1
417
+ 1
418
+ 0
419
+ 0
420
+ 0
421
+ 0
422
+ 0
423
+ 0
424
+ 0
425
+ 0
426
+ 0
427
+ 0
428
+ 0
429
+ 0
430
+ 0
431
+ 1
432
+ 0
433
+ 0
434
+ 0
435
+ 0
436
+ 0
437
+ 0
438
+ 1
439
+ 0
440
+ 0
441
+ 0
442
+ 0
443
+ 0
444
+ 1
445
+ 1
446
+ 0
447
+ 0
448
+ 0
449
+ 0
450
+ 1
451
+ 0
452
+ 0
453
+ 0
454
+ 0
455
+ 0
456
+ 0
457
+ 1
458
+ 0
459
+ 0
460
+ 0
461
+ 0
462
+ 0
463
+ 1
464
+ 0
465
+ 0
466
+ 0
467
+ 0
468
+ 0
469
+ 0
470
+ 0
471
+ 1
472
+ 0
473
+ 0
474
+ 0
475
+ 0
476
+ 0
477
+ 0
478
+ 0
479
+ 0
480
+ 1
481
+ 0
482
+ 0
483
+ 0
484
+ 0
485
+ 0
486
+ 0
487
+ 0
488
+ 0
489
+ 1
490
+ 0
491
+ 0
492
+ 0
493
+ 0
494
+ 0
495
+ 0
496
+ 1
497
+ 0
498
+ 0
499
+ 0
500
+ 0
501
+ 0
502
+ 0
503
+ 0
504
+ 0
505
+ 1
506
+ 1
507
+ 0
508
+ 0
509
+ 1
510
+ 0
511
+ 0
512
+ 0
513
+ 1
514
+ 0
515
+ 0
516
+ 0
517
+ 0
518
+ 0
519
+ 1
520
+ 0
521
+ 0
522
+ 0
523
+ 0
524
+ 0
525
+ 0
526
+ 0
527
+ 0
528
+ 0
529
+ 0
530
+ 0
531
+ 0
532
+ 1
533
+ 1
534
+ 0
535
+ 0
536
+ 0
537
+ 1
538
+ 0
539
+ 1
540
+ 0
541
+ 0
542
+ 1
543
+ 0
544
+ 0
545
+ 0
546
+ 0
547
+ 1
548
+ 0
549
+ 0
550
+ 0
551
+ 0
552
+ 0
553
+ 0
554
+ 1
555
+ 0
556
+ 0
557
+ 0
558
+ 0
559
+ 0
560
+ 1
561
+ 0
562
+ 0
563
+ 0
564
+ 0
565
+ 0
566
+ 1
567
+ 1
568
+ 1
569
+ 0
570
+ 0
571
+ 0
572
+ 0
573
+ 0
574
+ 0
575
+ 0
576
+ 0
577
+ 0
578
+ 0
579
+ 0
580
+ 0
581
+ 0
582
+ 0
583
+ 0
584
+ 0
585
+ 0
586
+ 0
587
+ 0
588
+ 0
589
+ 0
590
+ 1
591
+ 0
592
+ 0
593
+ 0
594
+ 0
595
+ 0
596
+ 0
597
+ 0
598
+ 0
599
+ 0
600
+ 0
601
+ 0
602
+ 0
603
+ 0
604
+ 0
605
+ 0
606
+ 0
607
+ 0
608
+ 0
609
+ 0
610
+ 0
611
+ 0
612
+ 0
613
+ 0
614
+ 0
615
+ 1
616
+ 0
617
+ 0
618
+ 0
619
+ 0
620
+ 0
621
+ 0
622
+ 0
623
+ 0
624
+ 0
625
+ 0
626
+ 1
627
+ 0
628
+ 0
629
+ 0
630
+ 0
631
+ 0
632
+ 0
633
+ 1
634
+ 0
635
+ 0
636
+ 0
637
+ 0
638
+ 0
639
+ 0
640
+ 0
641
+ 0
642
+ 0
643
+ 0
644
+ 0
645
+ 1
646
+ 0
647
+ 1
648
+ 0
649
+ 0
650
+ 0
651
+ 1
652
+ 0
653
+ 0
654
+ 0
655
+ 0
656
+ 0
657
+ 1
658
+ 0
659
+ 1
660
+ 0
661
+ 0
662
+ 0
663
+ 0
664
+ 0
665
+ 0
666
+ 0
667
+ 0
668
+ 0
669
+ 0
670
+ 1
671
+ 0
672
+ 1
673
+ 0
674
+ 1
675
+ 0
676
+ 0
677
+ 0
678
+ 1
679
+ 0
680
+ 0
681
+ 1
682
+ 0
683
+ 0
684
+ 0
685
+ 0
686
+ 0
687
+ 0
688
+ 0
689
+ 0
690
+ 0
691
+ 0
692
+ 0
693
+ 0
694
+ 0
695
+ 1
696
+ 0
697
+ 0
698
+ 0
699
+ 0
700
+ 0
701
+ 0
702
+ 0
703
+ 0
704
+ 0
705
+ 0
706
+ 0
707
+ 0
708
+ 0
709
+ 0
710
+ 1
711
+ 0
712
+ 0
713
+ 1
714
+ 0
715
+ 0
716
+ 0
717
+ 0
718
+ 1
719
+ 0
720
+ 0
721
+ 1
722
+ 0
723
+ 0
724
+ 0
725
+ 0
726
+ 0
727
+ 1
728
+ 0
729
+ 0
730
+ 0
731
+ 0
732
+ 0
733
+ 0
734
+ 1
735
+ 0
736
+ 0
737
+ 0
738
+ 0
739
+ 0
740
+ 0
741
+ 0
742
+ 0
743
+ 0
744
+ 1
745
+ 0
746
+ 0
747
+ 0
748
+ 0
749
+ 1
750
+ 1
751
+ 0
752
+ 0
753
+ 0
754
+ 1
755
+ 1
756
+ 0
757
+ 0
758
+ 0
759
+ 0
760
+ 0
761
+ 0
762
+ 1
763
+ 0
764
+ 0
765
+ 0
766
+ 0
767
+ 0
768
+ 0
769
+ 1
770
+ 0
771
+ 1
772
+ 0
773
+ 0
774
+ 1
775
+ 0
776
+ 0
777
+ 0
778
+ 0
779
+ 0
780
+ 1
781
+ 0
782
+ 0
783
+ 0
784
+ 0
785
+ 1
786
+ 0
787
+ 1
788
+ 0
789
+ 0
790
+ 0
791
+ 1
792
+ 1
793
+ 0
794
+ 0
795
+ 0
796
+ 0
797
+ 0
798
+ 0
799
+ 0
800
+ 0
801
+ 0
802
+ 0
803
+ 0
804
+ 0
805
+ 0
806
+ 0
807
+ 0
808
+ 0
809
+ 0
810
+ 0
811
+ 0
812
+ 0
813
+ 0
814
+ 0
815
+ 1
816
+ 0
817
+ 1
818
+ 0
819
+ 0
820
+ 0
821
+ 0
822
+ 0
823
+ 0
824
+ 1
825
+ 0
826
+ 0
827
+ 0
828
+ 0
829
+ 0
830
+ 0
831
+ 0
832
+ 0
833
+ 0
834
+ 0
835
+ 0
836
+ 0
837
+ 1
838
+ 0
839
+ 0
840
+ 0
841
+ 0
842
+ 0
843
+ 0
844
+ 0
845
+ 0
846
+ 0
847
+ 0
848
+ 0
849
+ 0
850
+ 0
851
+ 0
852
+ 0
853
+ 0
854
+ 0
855
+ 0
856
+ 0
857
+ 0
858
+ 1
859
+ 1
860
+ 0
861
+ 0
862
+ 0
863
+ 1
864
+ 1
865
+ 0
866
+ 0
867
+ 0
868
+ 0
869
+ 0
870
+ 0
871
+ 0
872
+ 0
873
+ 0
874
+ 0
875
+ 0
876
+ 0
877
+ 0
878
+ 0
879
+ 0
880
+ 0
881
+ 0
882
+ 0
883
+ 0
884
+ 0
885
+ 0
886
+ 0
887
+ 0
888
+ 0
889
+ 0
890
+ 0
891
+ 0
892
+ 0
893
+ 1
894
+ 0
895
+ 0
896
+ 0
897
+ 0
898
+ 0
899
+ 0
900
+ 0
901
+ 0
902
+ 0
903
+ 1
904
+ 1
905
+ 0
906
+ 1
907
+ 0
908
+ 0
909
+ 0
910
+ 0
911
+ 0
912
+ 0
913
+ 0
914
+ 0
915
+ 0
916
+ 0
917
+ 0
918
+ 0
919
+ 0
920
+ 0
921
+ 0
922
+ 0
923
+ 0
924
+ 0
925
+ 0
926
+ 0
927
+ 0
928
+ 0
929
+ 0
930
+ 0
931
+ 0
932
+ 0
933
+ 1
934
+ 0
935
+ 0
936
+ 0
937
+ 1
938
+ 0
939
+ 0
940
+ 0
941
+ 0
942
+ 0
943
+ 0
944
+ 0
945
+ 0
946
+ 0
947
+ 0
948
+ 1
949
+ 0
950
+ 0
951
+ 0
952
+ 1
953
+ 0
954
+ 0
955
+ 0
956
+ 0
957
+ 0
958
+ 0
959
+ 1
960
+ 0
961
+ 0
962
+ 1
963
+ 0
964
+ 0
965
+ 0
966
+ 0
967
+ 0
968
+ 0
969
+ 0
970
+ 1
971
+ 0
972
+ 0
973
+ 1
974
+ 0
975
+ 0
976
+ 1
977
+ 0
978
+ 1
979
+ 0
980
+ 0
981
+ 0
982
+ 0
983
+ 0
984
+ 0
985
+ 0
986
+ 0
987
+ 0
988
+ 0
989
+ 0
990
+ 0
991
+ 0
992
+ 0
993
+ 0
994
+ 0
995
+ 0
996
+ 0
997
+ 1
998
+ 0
999
+ 0
1000
+ 0
1001
+ 0
1002
+ 0
1003
+ 0
1004
+ 1
1005
+ 0
1006
+ 0
1007
+ 0
1008
+ 0
1009
+ 0
1010
+ 0
1011
+ 0
1012
+ 1
1013
+ 0
1014
+ 0
1015
+ 0
1016
+ 0
1017
+ 0
1018
+ 0
1019
+ 0
1020
+ 1
1021
+ 0
1022
+ 0
1023
+ 1
1024
+ 0
1025
+ 0
1026
+ 0
1027
+ 0
1028
+ 0
1029
+ 0
1030
+ 0
1031
+ 0
1032
+ 0
1033
+ 0
1034
+ 1
1035
+ 0
1036
+ 0
1037
+ 0
1038
+ 0
1039
+ 0
1040
+ 1
1041
+ 0
1042
+ 0
1043
+ 0
1044
+ 0
1045
+ 0
1046
+ 0
1047
+ 0
1048
+ 0
1049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
90
+ 0,3
91
+ 0,3
92
+ 0,3
93
+ 0,3
94
+ 1,4
95
+ 0,3
96
+ 0,3
97
+ 0,3
98
+ 0,3
99
+ 0,3
100
+ 1,5
101
+ 0,3
102
+ 0,3
103
+ 0,3
104
+ 0,3
105
+ 0,3
106
+ 0,3
107
+ 0,3
108
+ 0,3
109
+ 0,3
110
+ 1,4
111
+ 0,3
112
+ 0,3
113
+ 0,3
114
+ 1,2
115
+ 0,3
116
+ 0,3
117
+ 0,3
118
+ 0,3
119
+ 0,3
120
+ 1,5
121
+ 0,3
122
+ 0,3
123
+ 0,3
124
+ 0,3
125
+ 0,3
126
+ 0,3
127
+ 0,3
128
+ 0,3
129
+ 0,3
130
+ 0,3
131
+ 0,3
132
+ 1,2
133
+ 0,3
134
+ 0,3
135
+ 0,3
136
+ 0,3
137
+ 0,3
138
+ 1,1
139
+ 1,2
140
+ 0,3
141
+ 0,3
142
+ 1,1
143
+ 0,3
144
+ 1,2
145
+ 0,3
146
+ 0,3
147
+ 0,3
148
+ 1,4
149
+ 0,3
150
+ 0,3
151
+ 0,3
152
+ 0,3
153
+ 0,3
154
+ 0,3
155
+ 0,3
156
+ 0,3
157
+ 0,3
158
+ 0,3
159
+ 0,3
160
+ 0,3
161
+ 0,3
162
+ 0,3
163
+ 1,2
164
+ 0,3
165
+ 0,3
166
+ 1,5
167
+ 0,3
168
+ 0,3
169
+ 0,3
170
+ 1,5
171
+ 0,3
172
+ 0,3
173
+ 0,3
174
+ 0,3
175
+ 0,3
176
+ 1,2
177
+ 0,3
178
+ 0,3
179
+ 0,3
180
+ 0,3
181
+ 0,3
182
+ 0,3
183
+ 0,3
184
+ 0,3
185
+ 0,3
186
+ 0,3
187
+ 0,3
188
+ 0,3
189
+ 0,3
190
+ 0,3
191
+ 0,3
192
+ 1,5
193
+ 1,1
194
+ 0,3
195
+ 0,3
196
+ 0,3
197
+ 0,3
198
+ 0,3
199
+ 0,3
200
+ 0,3
201
+ 0,3
202
+ 0,3
203
+ 0,3
204
+ 0,3
205
+ 0,3
206
+ 0,3
207
+ 0,3
208
+ 0,3
209
+ 0,3
210
+ 0,3
211
+ 1,2
212
+ 0,3
213
+ 0,3
214
+ 0,3
215
+ 1,2
216
+ 0,3
217
+ 0,3
218
+ 0,3
219
+ 1,4
220
+ 0,3
221
+ 0,3
222
+ 0,3
223
+ 0,3
224
+ 1,4
225
+ 0,3
226
+ 0,3
227
+ 0,3
228
+ 0,3
229
+ 0,3
230
+ 1,1
231
+ 0,3
232
+ 1,2
233
+ 0,3
234
+ 0,3
235
+ 0,3
236
+ 1,1
237
+ 0,3
238
+ 0,3
239
+ 0,3
240
+ 1,4
241
+ 0,3
242
+ 0,3
243
+ 0,3
244
+ 0,3
245
+ 0,3
246
+ 0,3
247
+ 0,3
248
+ 0,3
249
+ 0,3
250
+ 0,3
251
+ 1,1
252
+ 0,3
253
+ 0,3
254
+ 0,3
255
+ 0,3
256
+ 0,3
257
+ 0,3
258
+ 1,5
259
+ 0,3
260
+ 0,3
261
+ 0,3
262
+ 0,3
263
+ 1,1
264
+ 1,2
265
+ 0,3
266
+ 0,3
267
+ 0,3
268
+ 1,2
269
+ 1,4
270
+ 0,3
271
+ 0,3
272
+ 0,3
273
+ 1,2
274
+ 0,3
275
+ 0,3
276
+ 0,3
277
+ 0,3
278
+ 0,3
279
+ 1,5
280
+ 0,3
281
+ 0,3
282
+ 0,3
283
+ 1,4
284
+ 1,4
285
+ 0,3
286
+ 0,3
287
+ 0,3
288
+ 0,3
289
+ 0,3
290
+ 0,3
291
+ 0,3
292
+ 0,3
293
+ 0,3
294
+ 1,1
295
+ 1,1
296
+ 0,3
297
+ 0,3
298
+ 0,3
299
+ 0,3
300
+ 0,3
301
+ 0,3
302
+ 0,3
303
+ 0,3
304
+ 0,3
305
+ 0,3
306
+ 0,3
307
+ 0,3
308
+ 0,3
309
+ 0,3
310
+ 0,3
311
+ 0,3
312
+ 0,3
313
+ 0,3
314
+ 0,3
315
+ 0,3
316
+ 0,3
317
+ 0,3
318
+ 1,1
319
+ 1,1
320
+ 1,4
321
+ 0,3
322
+ 0,3
323
+ 1,5
324
+ 0,3
325
+ 0,3
326
+ 1,1
327
+ 0,3
328
+ 0,3
329
+ 0,3
330
+ 0,3
331
+ 0,3
332
+ 0,3
333
+ 0,3
334
+ 0,3
335
+ 1,5
336
+ 0,3
337
+ 0,3
338
+ 0,3
339
+ 0,3
340
+ 1,2
341
+ 0,3
342
+ 0,3
343
+ 0,3
344
+ 0,3
345
+ 0,3
346
+ 0,3
347
+ 0,3
348
+ 0,3
349
+ 0,3
350
+ 0,3
351
+ 1,4
352
+ 0,3
353
+ 0,3
354
+ 0,3
355
+ 0,3
356
+ 0,3
357
+ 0,3
358
+ 0,3
359
+ 0,3
360
+ 0,3
361
+ 1,1
362
+ 0,3
363
+ 0,3
364
+ 0,3
365
+ 0,3
366
+ 0,3
367
+ 0,3
368
+ 0,3
369
+ 0,3
370
+ 0,3
371
+ 1,5
372
+ 0,3
373
+ 0,3
374
+ 0,3
375
+ 0,3
376
+ 0,3
377
+ 0,3
378
+ 0,3
379
+ 0,3
380
+ 1,2
381
+ 1,5
382
+ 1,4
383
+ 1,4
384
+ 0,3
385
+ 1,4
386
+ 0,3
387
+ 0,3
388
+ 0,3
389
+ 0,3
390
+ 0,3
391
+ 0,3
392
+ 0,3
393
+ 0,3
394
+ 0,3
395
+ 1,4
396
+ 0,3
397
+ 0,3
398
+ 0,3
399
+ 1,5
400
+ 0,3
401
+ 0,3
402
+ 0,3
403
+ 0,3
404
+ 0,3
405
+ 0,3
406
+ 0,3
407
+ 0,3
408
+ 0,3
409
+ 0,3
410
+ 0,3
411
+ 0,3
412
+ 0,3
413
+ 0,3
414
+ 0,3
415
+ 0,3
416
+ 1,1
417
+ 1,5
418
+ 0,3
419
+ 0,3
420
+ 0,3
421
+ 0,3
422
+ 0,3
423
+ 0,3
424
+ 0,3
425
+ 0,3
426
+ 0,3
427
+ 0,3
428
+ 0,3
429
+ 0,3
430
+ 0,3
431
+ 1,1
432
+ 0,3
433
+ 0,3
434
+ 0,3
435
+ 0,3
436
+ 0,3
437
+ 0,3
438
+ 1,2
439
+ 0,3
440
+ 0,3
441
+ 0,3
442
+ 0,3
443
+ 0,3
444
+ 1,5
445
+ 1,4
446
+ 0,3
447
+ 0,3
448
+ 0,3
449
+ 0,3
450
+ 1,4
451
+ 0,3
452
+ 0,3
453
+ 0,3
454
+ 0,3
455
+ 0,3
456
+ 0,3
457
+ 1,5
458
+ 0,3
459
+ 0,3
460
+ 0,3
461
+ 0,3
462
+ 0,3
463
+ 1,2
464
+ 0,3
465
+ 0,3
466
+ 0,3
467
+ 0,3
468
+ 0,3
469
+ 0,3
470
+ 0,3
471
+ 1,5
472
+ 0,3
473
+ 0,3
474
+ 0,3
475
+ 0,3
476
+ 0,3
477
+ 0,3
478
+ 0,3
479
+ 0,3
480
+ 1,4
481
+ 0,3
482
+ 0,3
483
+ 0,3
484
+ 0,3
485
+ 0,3
486
+ 0,3
487
+ 0,3
488
+ 0,3
489
+ 1,1
490
+ 0,3
491
+ 0,3
492
+ 0,3
493
+ 0,3
494
+ 0,3
495
+ 0,3
496
+ 1,5
497
+ 0,3
498
+ 0,3
499
+ 0,3
500
+ 0,3
501
+ 0,3
502
+ 0,3
503
+ 0,3
504
+ 0,3
505
+ 1,2
506
+ 1,4
507
+ 0,3
508
+ 0,3
509
+ 1,5
510
+ 0,3
511
+ 0,3
512
+ 0,3
513
+ 1,1
514
+ 0,3
515
+ 0,3
516
+ 0,3
517
+ 0,3
518
+ 0,3
519
+ 1,2
520
+ 0,3
521
+ 0,3
522
+ 0,3
523
+ 0,3
524
+ 0,3
525
+ 0,3
526
+ 0,3
527
+ 0,3
528
+ 0,3
529
+ 0,3
530
+ 0,3
531
+ 0,3
532
+ 1,1
533
+ 1,1
534
+ 0,3
535
+ 0,3
536
+ 0,3
537
+ 1,4
538
+ 0,3
539
+ 1,5
540
+ 0,3
541
+ 0,3
542
+ 1,1
543
+ 0,3
544
+ 0,3
545
+ 0,3
546
+ 0,3
547
+ 1,2
548
+ 0,3
549
+ 0,3
550
+ 0,3
551
+ 0,3
552
+ 0,3
553
+ 0,3
554
+ 1,5
555
+ 0,3
556
+ 0,3
557
+ 0,3
558
+ 0,3
559
+ 0,3
560
+ 1,5
561
+ 0,3
562
+ 0,3
563
+ 0,3
564
+ 0,3
565
+ 0,3
566
+ 1,4
567
+ 1,5
568
+ 1,2
569
+ 0,3
570
+ 0,3
571
+ 0,3
572
+ 0,3
573
+ 0,3
574
+ 0,3
575
+ 0,3
576
+ 0,3
577
+ 0,3
578
+ 0,3
579
+ 0,3
580
+ 0,3
581
+ 0,3
582
+ 0,3
583
+ 0,3
584
+ 0,3
585
+ 0,3
586
+ 0,3
587
+ 0,3
588
+ 0,3
589
+ 0,3
590
+ 1,5
591
+ 0,3
592
+ 0,3
593
+ 0,3
594
+ 0,3
595
+ 0,3
596
+ 0,3
597
+ 0,3
598
+ 0,3
599
+ 0,3
600
+ 0,3
601
+ 0,3
602
+ 0,3
603
+ 0,3
604
+ 0,3
605
+ 0,3
606
+ 0,3
607
+ 0,3
608
+ 0,3
609
+ 0,3
610
+ 0,3
611
+ 0,3
612
+ 0,3
613
+ 0,3
614
+ 0,3
615
+ 1,1
616
+ 0,3
617
+ 0,3
618
+ 0,3
619
+ 0,3
620
+ 0,3
621
+ 0,3
622
+ 0,3
623
+ 0,3
624
+ 0,3
625
+ 0,3
626
+ 1,4
627
+ 0,3
628
+ 0,3
629
+ 0,3
630
+ 0,3
631
+ 0,3
632
+ 0,3
633
+ 1,2
634
+ 0,3
635
+ 0,3
636
+ 0,3
637
+ 0,3
638
+ 0,3
639
+ 0,3
640
+ 0,3
641
+ 0,3
642
+ 0,3
643
+ 0,3
644
+ 0,3
645
+ 1,1
646
+ 0,3
647
+ 1,5
648
+ 0,3
649
+ 0,3
650
+ 0,3
651
+ 1,4
652
+ 0,3
653
+ 0,3
654
+ 0,3
655
+ 0,3
656
+ 0,3
657
+ 1,5
658
+ 0,3
659
+ 1,1
660
+ 0,3
661
+ 0,3
662
+ 0,3
663
+ 0,3
664
+ 0,3
665
+ 0,3
666
+ 0,3
667
+ 0,3
668
+ 0,3
669
+ 0,3
670
+ 1,1
671
+ 0,3
672
+ 1,4
673
+ 0,3
674
+ 1,5
675
+ 0,3
676
+ 0,3
677
+ 0,3
678
+ 1,4
679
+ 0,3
680
+ 0,3
681
+ 1,4
682
+ 0,3
683
+ 0,3
684
+ 0,3
685
+ 0,3
686
+ 0,3
687
+ 0,3
688
+ 0,3
689
+ 0,3
690
+ 0,3
691
+ 0,3
692
+ 0,3
693
+ 0,3
694
+ 0,3
695
+ 1,5
696
+ 0,3
697
+ 0,3
698
+ 0,3
699
+ 0,3
700
+ 0,3
701
+ 0,3
702
+ 0,3
703
+ 0,3
704
+ 0,3
705
+ 0,3
706
+ 0,3
707
+ 0,3
708
+ 0,3
709
+ 0,3
710
+ 1,5
711
+ 0,3
712
+ 0,3
713
+ 1,2
714
+ 0,3
715
+ 0,3
716
+ 0,3
717
+ 0,3
718
+ 1,2
719
+ 0,3
720
+ 0,3
721
+ 1,4
722
+ 0,3
723
+ 0,3
724
+ 0,3
725
+ 0,3
726
+ 0,3
727
+ 1,5
728
+ 0,3
729
+ 0,3
730
+ 0,3
731
+ 0,3
732
+ 0,3
733
+ 0,3
734
+ 1,1
735
+ 0,3
736
+ 0,3
737
+ 0,3
738
+ 0,3
739
+ 0,3
740
+ 0,3
741
+ 0,3
742
+ 0,3
743
+ 0,3
744
+ 1,4
745
+ 0,3
746
+ 0,3
747
+ 0,3
748
+ 0,3
749
+ 1,2
750
+ 1,2
751
+ 0,3
752
+ 0,3
753
+ 0,3
754
+ 1,4
755
+ 1,5
756
+ 0,3
757
+ 0,3
758
+ 0,3
759
+ 0,3
760
+ 0,3
761
+ 0,3
762
+ 1,4
763
+ 0,3
764
+ 0,3
765
+ 0,3
766
+ 0,3
767
+ 0,3
768
+ 0,3
769
+ 1,4
770
+ 0,3
771
+ 1,1
772
+ 0,3
773
+ 0,3
774
+ 1,2
775
+ 0,3
776
+ 0,3
777
+ 0,3
778
+ 0,3
779
+ 0,3
780
+ 1,2
781
+ 0,3
782
+ 0,3
783
+ 0,3
784
+ 0,3
785
+ 1,4
786
+ 0,3
787
+ 1,5
788
+ 0,3
789
+ 0,3
790
+ 0,3
791
+ 1,5
792
+ 1,1
793
+ 0,3
794
+ 0,3
795
+ 0,3
796
+ 0,3
797
+ 0,3
798
+ 0,3
799
+ 0,3
800
+ 0,3
801
+ 0,3
802
+ 0,3
803
+ 0,3
804
+ 0,3
805
+ 0,3
806
+ 0,3
807
+ 0,3
808
+ 0,3
809
+ 0,3
810
+ 0,3
811
+ 0,3
812
+ 0,3
813
+ 0,3
814
+ 0,3
815
+ 1,5
816
+ 0,3
817
+ 1,4
818
+ 0,3
819
+ 0,3
820
+ 0,3
821
+ 0,3
822
+ 0,3
823
+ 0,3
824
+ 1,1
825
+ 0,3
826
+ 0,3
827
+ 0,3
828
+ 0,3
829
+ 0,3
830
+ 0,3
831
+ 0,3
832
+ 0,3
833
+ 0,3
834
+ 0,3
835
+ 0,3
836
+ 0,3
837
+ 1,2
838
+ 0,3
839
+ 0,3
840
+ 0,3
841
+ 0,3
842
+ 0,3
843
+ 0,3
844
+ 0,3
845
+ 0,3
846
+ 0,3
847
+ 0,3
848
+ 0,3
849
+ 0,3
850
+ 0,3
851
+ 0,3
852
+ 0,3
853
+ 0,3
854
+ 0,3
855
+ 0,3
856
+ 0,3
857
+ 0,3
858
+ 1,1
859
+ 1,2
860
+ 0,3
861
+ 0,3
862
+ 0,3
863
+ 1,1
864
+ 1,1
865
+ 0,3
866
+ 0,3
867
+ 0,3
868
+ 0,3
869
+ 0,3
870
+ 0,3
871
+ 0,3
872
+ 0,3
873
+ 0,3
874
+ 0,3
875
+ 0,3
876
+ 0,3
877
+ 0,3
878
+ 0,3
879
+ 0,3
880
+ 0,3
881
+ 0,3
882
+ 0,3
883
+ 0,3
884
+ 0,3
885
+ 0,3
886
+ 0,3
887
+ 0,3
888
+ 0,3
889
+ 0,3
890
+ 0,3
891
+ 0,3
892
+ 0,3
893
+ 1,4
894
+ 0,3
895
+ 0,3
896
+ 0,3
897
+ 0,3
898
+ 0,3
899
+ 0,3
900
+ 0,3
901
+ 0,3
902
+ 0,3
903
+ 1,5
904
+ 1,5
905
+ 0,3
906
+ 1,2
907
+ 0,3
908
+ 0,3
909
+ 0,3
910
+ 0,3
911
+ 0,3
912
+ 0,3
913
+ 0,3
914
+ 0,3
915
+ 0,3
916
+ 0,3
917
+ 0,3
918
+ 0,3
919
+ 0,3
920
+ 0,3
921
+ 0,3
922
+ 0,3
923
+ 0,3
924
+ 0,3
925
+ 0,3
926
+ 0,3
927
+ 0,3
928
+ 0,3
929
+ 0,3
930
+ 0,3
931
+ 0,3
932
+ 0,3
933
+ 1,4
934
+ 0,3
935
+ 0,3
936
+ 0,3
937
+ 1,1
938
+ 0,3
939
+ 0,3
940
+ 0,3
941
+ 0,3
942
+ 0,3
943
+ 0,3
944
+ 0,3
945
+ 0,3
946
+ 0,3
947
+ 0,3
948
+ 1,1
949
+ 0,3
950
+ 0,3
951
+ 0,3
952
+ 1,5
953
+ 0,3
954
+ 0,3
955
+ 0,3
956
+ 0,3
957
+ 0,3
958
+ 0,3
959
+ 1,2
960
+ 0,3
961
+ 0,3
962
+ 1,1
963
+ 0,3
964
+ 0,3
965
+ 0,3
966
+ 0,3
967
+ 0,3
968
+ 0,3
969
+ 0,3
970
+ 1,5
971
+ 0,3
972
+ 0,3
973
+ 1,2
974
+ 0,3
975
+ 0,3
976
+ 1,1
977
+ 0,3
978
+ 1,5
979
+ 0,3
980
+ 0,3
981
+ 0,3
982
+ 0,3
983
+ 0,3
984
+ 0,3
985
+ 0,3
986
+ 0,3
987
+ 0,3
988
+ 0,3
989
+ 0,3
990
+ 0,3
991
+ 0,3
992
+ 0,3
993
+ 0,3
994
+ 0,3
995
+ 0,3
996
+ 0,3
997
+ 1,2
998
+ 0,3
999
+ 0,3
1000
+ 0,3
1001
+ 0,3
1002
+ 0,3
1003
+ 0,3
1004
+ 1,1
1005
+ 0,3
1006
+ 0,3
1007
+ 0,3
1008
+ 0,3
1009
+ 0,3
1010
+ 0,3
1011
+ 0,3
1012
+ 1,4
1013
+ 0,3
1014
+ 0,3
1015
+ 0,3
1016
+ 0,3
1017
+ 0,3
1018
+ 0,3
1019
+ 0,3
1020
+ 1,5
1021
+ 0,3
1022
+ 0,3
1023
+ 1,2
1024
+ 0,3
1025
+ 0,3
1026
+ 0,3
1027
+ 0,3
1028
+ 0,3
1029
+ 0,3
1030
+ 0,3
1031
+ 0,3
1032
+ 0,3
1033
+ 0,3
1034
+ 1,2
1035
+ 0,3
1036
+ 0,3
1037
+ 0,3
1038
+ 0,3
1039
+ 0,3
1040
+ 1,1
1041
+ 0,3
1042
+ 0,3
1043
+ 0,3
1044
+ 0,3
1045
+ 0,3
1046
+ 0,3
1047
+ 0,3
1048
+ 0,3
1049
+ 0,3
1050
+ 0,3
1051
+ 0,3
1052
+ 0,3
1053
+ 0,3
1054
+ 0,3
1055
+ 0,3
1056
+ 1,2
1057
+ 0,3
1058
+ 0,3
1059
+ 1,4
Kaggle_PowerQuality_Dataset/Kaggle_PowerQuality_2/train.csv ADDED
The diff for this file is too large to render. See raw diff
 
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Power System Datasets Collection
2
+
3
+ 电力系统相关数据集收集,用于异常检测、负荷预测等研究。
4
+
5
+ ## 目录结构
6
+
7
+ ```
8
+ Power_Datasets/
9
+ ├── Kaggle_PowerQuality_Dataset/ # ✅ 已下载 - Kaggle 电力质量波形
10
+ ├── Pecan_Street/ # ⏳ 待下载 - Pecan Street 住宅用电
11
+ ├── SGCC_Theft_Detection/ # ⏳ 待下载 - 国家电网窃电检测
12
+ ├── University_Lab_PQ/ # ✅ 已下载 - 大学实验室电能质量
13
+ ├── download_datasets.sh # 一键下载脚本
14
+ ├── DOWNLOAD_GUIDE.md # 下载指南
15
+ └── README.md # 本文件
16
+ ```
17
+
18
+ ## 数据集详情
19
+
20
+ ### 1. Kaggle Power Quality Dataset ✅ 已下载
21
+
22
+ - **来源**: Kaggle PowerQualityDistributionDataset1
23
+ - **内容**: 128维电力质量波形,5类分类
24
+ - **用途**: 电力质量多分类 (⚠️ 不适合异常检测)
25
+ - **位置**: `Kaggle_PowerQuality_Dataset/`
26
+ - **备注**: 保留用于其他实验,不用于农网电压异常检测
27
+
28
+ ### 2. University Laboratory Power Quality ✅ 已下载 ⭐推荐
29
+
30
+ - **来源**: [Zenodo/MDPI Data](https://zenodo.org/records/17107426)
31
+ - **内容**: 三相电压/电流、有功/无功功率、功率因数、频率
32
+ - **变量**: volt_A/B/C, I_A/B/C, P_A/B/C/T, Q_A/B/C/T, FP_A/B/C/T, Frec
33
+ - **时间范围**: 2024年4月-12月(78个日期文件)
34
+ - **分辨率**: 10分钟间隔
35
+ - **电压范围**: ~122-130V (美标 120V)
36
+ - **频率**: ~60Hz
37
+ - **特点**: 包含完整电能质量指标,非常适合异常检测
38
+ - **位置**: `University_Lab_PQ/`
39
+
40
+ ### 3. Pecan Street Electricity Data ⏳ 待下载 ⭐推荐
41
+
42
+ - **来源**: [Kaggle - Pecan Street](https://www.kaggle.com/datasets/zhitingzheng/pecan-street-electricity-data)
43
+ - **内容**: 10户 Austin 家庭的1分钟级别电路用电数据
44
+ - **特点**: 包含电压数据、分电路测量、4CP高峰期数据
45
+ - **下载**: 需 Kaggle 账号登录
46
+ - **命令**: `kaggle datasets download -d zhitingzheng/pecan-street-electricity-data`
47
+
48
+ ### 4. SGCC Electricity Theft Detection ⏳ 待下载
49
+
50
+ - **来源**: [Kaggle - SGCC](https://www.kaggle.com/datasets/bensalem14/sgcc-dataset)
51
+ - **内容**: 42,372用户的1,035天用电量数据
52
+ - **用途**: 窃电检测 (⚠️ 不含电压数据)
53
+ - **下载**: 需 Kaggle 账号登录
54
+ - **命令**: `kaggle datasets download -d bensalem14/sgcc-dataset`
55
+
56
+ ### 5. UK-DALE (需申请)
57
+
58
+ - **来源**: [UK-DALE](https://jack-kelly.com/data/)
59
+ - **内容**: 英国住宅高频用电数据
60
+ - **特点**: 1秒/6秒分辨率,含电压
61
+ - **下载**: 需申请,非公开
62
+
63
+ ## 数据集适用性对比
64
+
65
+ | 数据集 | 状态 | 电压数据 | 三相 | 分辨率 | 推荐用途 |
66
+ |--------|:----:|:-------:|:----:|:------:|---------|
67
+ | University Lab | ✅ | ✅ | ✅ | 10分钟 | **电压异常检测** |
68
+ | Pecan Street | ⏳ | ✅ | ❌ | 1分钟 | **电压异常检测** |
69
+ | SGCC | ⏳ | ❌ | ❌ | 日级 | 窃电检测 |
70
+ | Kaggle PQ | ✅ | ❌ | ❌ | 波形 | 多分类任务 |
71
+ | UK-DALE | 🔒 | ✅ | ❌ | 1秒 | 负荷分解 |
72
+
73
+ ## 农网电压异常检测推荐
74
+
75
+ **优先级排序**:
76
+ 1. **University Lab** ⭐⭐⭐ - 已下载,三相电压+电流+功率,最适合
77
+ 2. **Pecan Street** ⭐⭐ - 需下载,住宅级电压,分电路
78
+ 3. **自建 RuralVoltage** - 项目核心数据集
79
+
80
+ ## 下载方式
81
+
82
+ ### 方式一:使用脚本
83
+ ```bash
84
+ bash download_datasets.sh
85
+ ```
86
+
87
+ ### 方式二:手动下载
88
+ 详见 [DOWNLOAD_GUIDE.md](./DOWNLOAD_GUIDE.md)
89
+
90
+ ## 许可证
91
+
92
+ 各数据集遵循其原始许可证,仅用于学术研究。
93
+
94
+ ---
95
+ *更新时间: 2026-02-02*
University_Lab_PQ/0_Monitor_variables_Proure.xlsx ADDED
Binary file (48.5 kB). View file
 
University_Lab_PQ/Monitor_Fri_Aug_09_2024.xlsx ADDED
Binary file (68.7 kB). View file
 
University_Lab_PQ/Monitor_Fri_Aug_30_2024.xlsx ADDED
Binary file (70.6 kB). View file
 
University_Lab_PQ/Monitor_Fri_Jul_12_2024.xlsx ADDED
Binary file (64.5 kB). View file
 
University_Lab_PQ/Monitor_Fri_Jun_21_2024.xlsx ADDED
Binary file (64.8 kB). View file
 
University_Lab_PQ/Monitor_Fri_May_10_2024.xlsx ADDED
Binary file (71.5 kB). View file
 
University_Lab_PQ/Monitor_Fri_May_31_2024.xlsx ADDED
Binary file (69.2 kB). View file
 
University_Lab_PQ/Monitor_Fri_Nov_08_2024.xlsx ADDED
Binary file (70.6 kB). View file
 
University_Lab_PQ/Monitor_Fri_Nov_29_2024.xlsx ADDED
Binary file (69 kB). View file
 
University_Lab_PQ/Monitor_Fri_Oct_18_2024.xlsx ADDED
Binary file (69.7 kB). View file
 
University_Lab_PQ/Monitor_Fri_Sep_20_2024.xlsx ADDED
Binary file (70.2 kB). View file
 
University_Lab_PQ/Monitor_Fri_Sep_27_2024.xlsx ADDED
Binary file (70.5 kB). View file
 
University_Lab_PQ/Monitor_Mon_Apr_22_2024.xlsx ADDED
Binary file (45.5 kB). View file
 
University_Lab_PQ/Monitor_Mon_Aug_12_2024.xlsx ADDED
Binary file (70.1 kB). View file
 
University_Lab_PQ/Monitor_Mon_Dec_02_2024.xlsx ADDED
Binary file (68.5 kB). View file
 
University_Lab_PQ/Monitor_Mon_Jul_15_2024.xlsx ADDED
Binary file (63.9 kB). View file
 
University_Lab_PQ/Monitor_Mon_Jun_03_2024.xlsx ADDED
Binary file (67 kB). View file
 
University_Lab_PQ/Monitor_Mon_Jun_24_2024.xlsx ADDED
Binary file (63.8 kB). View file
 
University_Lab_PQ/Monitor_Mon_May_13_2024.xlsx ADDED
Binary file (67.1 kB). View file
 
University_Lab_PQ/Monitor_Mon_Nov_11_2024.xlsx ADDED
Binary file (68.9 kB). View file
 
University_Lab_PQ/Monitor_Mon_Oct_21_2024.xlsx ADDED
Binary file (67.9 kB). View file
 
University_Lab_PQ/Monitor_Mon_Sep_02_2024.xlsx ADDED
Binary file (69.8 kB). View file
 
University_Lab_PQ/Monitor_Mon_Sep_30_2024.xlsx ADDED
Binary file (68.3 kB). View file
 
University_Lab_PQ/Monitor_Sat_Aug_03_2024.xlsx ADDED
Binary file (67.9 kB). View file
 
University_Lab_PQ/Monitor_Sat_Aug_24_2024.xlsx ADDED
Binary file (70.4 kB). View file
 
University_Lab_PQ/Monitor_Sat_Jul_06_2024.xlsx ADDED
Binary file (64.5 kB). View file
 
University_Lab_PQ/Monitor_Sat_Jun_15_2024.xlsx ADDED
Binary file (65 kB). View file
 
University_Lab_PQ/Monitor_Sat_May_04_2024.xlsx ADDED
Binary file (69.9 kB). View file
 
University_Lab_PQ/Monitor_Sat_May_25_2024.xlsx ADDED
Binary file (69.4 kB). View file
 
University_Lab_PQ/Monitor_Sat_Nov_02_2024.xlsx ADDED
Binary file (70.7 kB). View file
 
University_Lab_PQ/Monitor_Sat_Nov_23_2024.xlsx ADDED
Binary file (70.6 kB). View file
 
University_Lab_PQ/Monitor_Sat_Oct_12_2024.xlsx ADDED
Binary file (71 kB). View file
 
University_Lab_PQ/Monitor_Sat_Sep_14_2024.xlsx ADDED
Binary file (69.5 kB). View file
 
University_Lab_PQ/Monitor_Sun_Apr_28_2024.xlsx ADDED
Binary file (70.3 kB). View file
 
University_Lab_PQ/Monitor_Sun_Aug_18_2024.xlsx ADDED
Binary file (69.7 kB). View file
 
University_Lab_PQ/Monitor_Sun_Dec_08_2024.xlsx ADDED
Binary file (66.9 kB). View file
 
University_Lab_PQ/Monitor_Sun_Jul_21_2024.xlsx ADDED
Binary file (63.5 kB). View file
 
University_Lab_PQ/Monitor_Sun_Jul_28_2024.xlsx ADDED
Binary file (67.6 kB). View file
 
University_Lab_PQ/Monitor_Sun_Jun_09_2024.xlsx ADDED
Binary file (64 kB). View file
 
University_Lab_PQ/Monitor_Sun_Jun_30_2024.xlsx ADDED
Binary file (63.9 kB). View file