├── .DS_Store ├── PPT ├── .DS_Store ├── week2-course introduction.pptx ├── week2-data.pptx ├── week3-clustering-1.pptx ├── week4-clustering-2 .pptx ├── week5-1-cluster validity.pptx ├── week5-2-Clustering Ensemble.ppt └── week6-1-bayes-classifier-KNN.pptx ├── README.md ├── hw2-Data-Pre-processing ├── .DS_Store ├── 2024_DAM_hw2.pdf ├── Assignment 2_ Data Pre-processing.pdf └── data-preprocessing.ipynb ├── hw3-Cluster ├── .DS_Store ├── 2024_DAM_hw3.pdf ├── Code │ ├── README.md │ ├── hierarchical_clustering.py │ └── test_on_dataset.ipynb └── Report.pdf ├── hw4-DBSCAN ├── .DS_Store ├── 2024_DAM_hw4.pdf ├── DBSCAN实现.pdf ├── README.md └── code │ ├── DBSCAN.ipynb │ └── DBSCAN.py ├── workshop ├── .DS_Store ├── 2024_DAM_workshop.pdf ├── 2051498-储岱泽小组-workshop │ ├── .DS_Store │ ├── member.txt │ ├── report.pdf │ └── 主要参考文献Struct-GPT.pdf ├── StructGPT:一种基于LLM的处理结构化数据的通用框架.docx └── StructGPT:一种基于LLM的处理结构化数据的通用框架.pdf └── 期末项目 ├── .DS_Store ├── 2024_Final-Project.pdf ├── 2205.13504v3.pdf ├── diabetes_datasets ├── .DS_Store ├── Shanghai_T1DM │ ├── .DS_Store │ ├── 1001_0_20210730.xlsx │ ├── 1002_0_20210504.xls │ ├── 1002_1_20210521.xls │ ├── 1002_2_20210909.xls │ ├── 1003_0_20210831.xls │ ├── 1004_0_20210425.xls │ ├── 1005_0_20210522.xls │ ├── 1006_0_20210114.xlsx │ ├── 1006_1_20210209.xlsx │ ├── 1006_2_20210303.xlsx │ ├── 1007_0_20210726.xls │ ├── 1008_0_20210713.xls │ ├── 1009_0_20210803.xls │ ├── 1010_0_20210915.xls │ ├── 1011_0_20210622.xls │ └── 1012_0_20210923.xls ├── Shanghai_T1DM_Summary.xlsx ├── Shanghai_T2DM │ ├── 2000_0_20201230.xlsx │ ├── 2001_0_20201102.xlsx │ ├── 2001_1_20201117.xlsx │ ├── 2002_0_20210513.xlsx │ ├── 2003_0_20210615.xlsx │ ├── 2004_0_20211028.xlsx │ ├── 2005_0_20211201.xlsx │ ├── 2006_0_20211112.xlsx │ ├── 2007_0_20220108.xlsx │ ├── 2008_0_20220118.xlsx │ ├── 2009_0_20211103.xlsx │ ├── 2010_0_20220111.xlsx │ ├── 2011_0_20220123.xlsx │ ├── 2012_0_20220126.xlsx │ ├── 2013_0_20220123.xlsx │ ├── 2014_0_20201224.xlsx │ ├── 2014_1_20210317.xlsx │ ├── 2015_0_20210203.xlsx │ ├── 2015_1_20210219.xlsx │ ├── 2016_0_20201224.xls │ ├── 2017_0_20210102.xlsx │ ├── 2017_1_20201118.xls │ ├── 2018_0_20210420.xls │ ├── 2019_0_20210513.xls │ ├── 2020_0_20210423.xls │ ├── 2021_0_20211013.xls │ ├── 2022_0_20210419.xls │ ├── 2023_0_20210812.xls │ ├── 2024_0_20210429.xls │ ├── 2025_0_20210506.xls │ ├── 2026_0_20210916.xls │ ├── 2027_0_20210521.xls │ ├── 2028_0_20210426.xls │ ├── 2029_0_20210526.xls │ ├── 2030_0_20210531.xls │ ├── 2031_0_20210601.xls │ ├── 2032_0_20210727.xls │ ├── 2033_0_20210615.xls │ ├── 2034_0_20210624.xls │ ├── 2035_0_20210629.xls │ ├── 2036_0_20210803.xls │ ├── 2037_0_20201221.xls │ ├── 2038_0_20210608.xls │ ├── 2039_0_20210615.xls │ ├── 2040_0_20210729.xls │ ├── 2041_0_20210813.xls │ ├── 2042_0_20211019.xls │ ├── 2043_0_20210513.xls │ ├── 2044_0_20211101.xls │ ├── 2045_0_20201216.xls │ ├── 2046_0_20201216.xls │ ├── 2047_0_20210420.xls │ ├── 2048_0_20210426.xls │ ├── 2049_0_20210426.xls │ ├── 2050_0_20210510.xls │ ├── 2051_0_20210512.xls │ ├── 2052_0_20210511.xls │ ├── 2053_0_20210518.xls │ ├── 2054_0_20210524.xls │ ├── 2055_0_20210524.xls │ ├── 2055_1_20201207.xls │ ├── 2056_0_20210524.xls │ ├── 2057_0_20210525.xls │ ├── 2058_0_20210524.xls │ ├── 2059_0_20210525.xls │ ├── 2060_0_20201214.xls │ ├── 2061_0_20210601.xls │ ├── 2062_0_20210601.xls │ ├── 2063_0_20210608.xls │ ├── 2064_0_20210608.xls │ ├── 2065_0_20210615.xls │ ├── 2066_0_20210615.xls │ ├── 2067_0_20210615.xls │ ├── 2068_0_20210616.xls │ ├── 2069_0_20210621.xls │ ├── 2069_1_20210705.xls │ ├── 2069_2_20210825.xls │ ├── 2070_0_20210629.xls │ ├── 2071_0_20210705.xls │ ├── 2072_0_20210706.xls │ ├── 2073_0_20210703.xls │ ├── 2074_0_20210707.xls │ ├── 2074_1_20210720.xls │ ├── 2075_0_20210720.xls │ ├── 2076_0_20210720.xls │ ├── 2077_0_20210803.xls │ ├── 2078_0_20210803.xls │ ├── 2078_1_20210817.xls │ ├── 2079_0_20210809.xls │ ├── 2080_0_20210816.xls │ ├── 2081_0_20210817.xls │ ├── 2082_0_20210907.xls │ ├── 2083_0_20201214.xls │ ├── 2084_0_20211013.xls │ ├── 2085_0_20200907.xls │ ├── 2086_0_20200914.xls │ ├── 2087_0_20201012.xls │ ├── 2088_0_20201123.xls │ ├── 2089_0_20201019.xls │ ├── 2090_0_20201130.xls │ ├── 2091_0_20201029.xls │ ├── 2092_0_20201109.xls │ ├── 2093_0_20201109.xls │ ├── 2094_0_20211109.xls │ ├── 2095_0_20201116.xls │ ├── 2096_0_20201116.xls │ ├── 2097_0_20201116.xls │ ├── 2098_0_20201106.xls │ └── 2099_0_20201116.xls ├── Shanghai_T2DM_Summary.xlsx ├── data_analysis.ipynb └── note.txt ├── 数据集说明.pdf ├── 血糖时间序列预测 ├── .DS_Store ├── 2_slides.pptx ├── code │ ├── .DS_Store │ ├── LSTM │ │ ├── LSTM.py │ │ ├── README.md │ │ ├── datasets_new │ │ │ ├── Shanghai_T1DM │ │ │ │ ├── 1001_0_20210730.csv │ │ │ │ ├── 1002_0_20210504.csv │ │ │ │ ├── 1002_1_20210521.csv │ │ │ │ ├── 1002_2_20210909.csv │ │ │ │ ├── 1003_0_20210831.csv │ │ │ │ ├── 1004_0_20210425.csv │ │ │ │ ├── 1005_0_20210522.csv │ │ │ │ ├── 1006_0_20210114.csv │ │ │ │ ├── 1006_1_20210209.csv │ │ │ │ ├── 1006_2_20210303.csv │ │ │ │ ├── 1007_0_20210726.csv │ │ │ │ ├── 1008_0_20210713.csv │ │ │ │ ├── 1009_0_20210803.csv │ │ │ │ ├── 1010_0_20210915.csv │ │ │ │ ├── 1011_0_20210622.csv │ │ │ │ └── 1012_0_20210923.csv │ │ │ ├── Shanghai_T1DM_old │ │ │ │ ├── 1001_0_20210730.xlsx │ │ │ │ ├── 1002_0_20210504.xlsx │ │ │ │ ├── 1002_1_20210521.xlsx │ │ │ │ ├── 1002_2_20210909.xlsx │ │ │ │ ├── 1003_0_20210831.xlsx │ │ │ │ ├── 1004_0_20210425.xlsx │ │ │ │ ├── 1005_0_20210522.xlsx │ │ │ │ ├── 1006_0_20210114.xlsx │ │ │ │ ├── 1006_1_20210209.xlsx │ │ │ │ ├── 1006_2_20210303.xlsx │ │ │ │ ├── 1007_0_20210726.xlsx │ │ │ │ ├── 1008_0_20210713.xlsx │ │ │ │ ├── 1009_0_20210803.xlsx │ │ │ │ ├── 1010_0_20210915.xlsx │ │ │ │ ├── 1011_0_20210622.xlsx │ │ │ │ └── 1012_0_20210923.xlsx │ │ │ ├── Shanghai_T2DM │ │ │ │ ├── 2000_0_20201230.csv │ │ │ │ ├── 2001_0_20201102.csv │ │ │ │ ├── 2001_1_20201117.csv │ │ │ │ ├── 2002_0_20210513.csv │ │ │ │ ├── 2003_0_20210615.csv │ │ │ │ ├── 2004_0_20211028.csv │ │ │ │ ├── 2005_0_20211201.csv │ │ │ │ ├── 2006_0_20211112.csv │ │ │ │ ├── 2007_0_20220108.csv │ │ │ │ ├── 2008_0_20220118.csv │ │ │ │ ├── 2009_0_20211103.csv │ │ │ │ ├── 2010_0_20220111.csv │ │ │ │ ├── 2011_0_20220123.csv │ │ │ │ ├── 2012_0_20220126.csv │ │ │ │ ├── 2013_0_20220123.csv │ │ │ │ ├── 2014_0_20201224.csv │ │ │ │ ├── 2014_1_20210317.csv │ │ │ │ ├── 2015_0_20210203.csv │ │ │ │ ├── 2015_1_20210219.csv │ │ │ │ ├── 2016_0_20201224.csv │ │ │ │ ├── 2017_0_20210102.csv │ │ │ │ ├── 2017_1_20201118.csv │ │ │ │ ├── 2018_0_20210420.csv │ │ │ │ ├── 2019_0_20210513.csv │ │ │ │ ├── 2020_0_20210423.csv │ │ │ │ ├── 2021_0_20211013.csv │ │ │ │ ├── 2022_0_20210419.csv │ │ │ │ ├── 2023_0_20210812.csv │ │ │ │ ├── 2024_0_20210429.csv │ │ │ │ ├── 2025_0_20210506.csv │ │ │ │ ├── 2026_0_20210916.csv │ │ │ │ ├── 2027_0_20210521.csv │ │ │ │ ├── 2028_0_20210426.csv │ │ │ │ ├── 2029_0_20210526.csv │ │ │ │ ├── 2030_0_20210531.csv │ │ │ │ ├── 2031_0_20210601.csv │ │ │ │ ├── 2032_0_20210727.csv │ │ │ │ ├── 2033_0_20210615.csv │ │ │ │ ├── 2034_0_20210624.csv │ │ │ │ ├── 2035_0_20210629.csv │ │ │ │ ├── 2036_0_20210803.csv │ │ │ │ ├── 2037_0_20201221.csv │ │ │ │ ├── 2038_0_20210608.csv │ │ │ │ ├── 2039_0_20210615.csv │ │ │ │ ├── 2040_0_20210729.csv │ │ │ │ ├── 2041_0_20210813.csv │ │ │ │ ├── 2042_0_20211019.csv │ │ │ │ ├── 2043_0_20210513.csv │ │ │ │ ├── 2044_0_20211101.csv │ │ │ │ ├── 2045_0_20201216.csv │ │ │ │ ├── 2046_0_20201216.csv │ │ │ │ ├── 2047_0_20210420.csv │ │ │ │ ├── 2048_0_20210426.csv │ │ │ │ ├── 2049_0_20210426.csv │ │ │ │ ├── 2050_0_20210510.csv │ │ │ │ ├── 2051_0_20210512.csv │ │ │ │ ├── 2052_0_20210511.csv │ │ │ │ ├── 2053_0_20210518.csv │ │ │ │ ├── 2054_0_20210524.csv │ │ │ │ ├── 2055_0_20210524.csv │ │ │ │ ├── 2055_1_20201207.csv │ │ │ │ ├── 2056_0_20210524.csv │ │ │ │ ├── 2057_0_20210525.csv │ │ │ │ ├── 2058_0_20210524.csv │ │ │ │ ├── 2059_0_20210525.csv │ │ │ │ ├── 2060_0_20201214.csv │ │ │ │ ├── 2061_0_20210601.csv │ │ │ │ ├── 2062_0_20210601.csv │ │ │ │ ├── 2063_0_20210608.csv │ │ │ │ ├── 2064_0_20210608.csv │ │ │ │ ├── 2065_0_20210615.csv │ │ │ │ ├── 2066_0_20210615.csv │ │ │ │ ├── 2067_0_20210615.csv │ │ │ │ ├── 2068_0_20210616.csv │ │ │ │ ├── 2069_0_20210621.csv │ │ │ │ ├── 2069_1_20210705.csv │ │ │ │ ├── 2069_2_20210825.csv │ │ │ │ ├── 2070_0_20210629.csv │ │ │ │ ├── 2071_0_20210705.csv │ │ │ │ ├── 2072_0_20210706.csv │ │ │ │ ├── 2073_0_20210703.csv │ │ │ │ ├── 2074_0_20210707.csv │ │ │ │ ├── 2074_1_20210720.csv │ │ │ │ ├── 2075_0_20210720.csv │ │ │ │ ├── 2076_0_20210720.csv │ │ │ │ ├── 2077_0_20210803.csv │ │ │ │ ├── 2078_0_20210803.csv │ │ │ │ ├── 2078_1_20210817.csv │ │ │ │ ├── 2079_0_20210809.csv │ │ │ │ ├── 2080_0_20210816.csv │ │ │ │ ├── 2081_0_20210817.csv │ │ │ │ ├── 2082_0_20210907.csv │ │ │ │ ├── 2083_0_20201214.csv │ │ │ │ ├── 2084_0_20211013.csv │ │ │ │ ├── 2085_0_20200907.csv │ │ │ │ ├── 2086_0_20200914.csv │ │ │ │ ├── 2087_0_20201012.csv │ │ │ │ ├── 2088_0_20201123.csv │ │ │ │ ├── 2089_0_20201019.csv │ │ │ │ ├── 2090_0_20201130.csv │ │ │ │ ├── 2091_0_20201029.csv │ │ │ │ ├── 2092_0_20201109.csv │ │ │ │ ├── 2093_0_20201109.csv │ │ │ │ ├── 2094_0_20211109.csv │ │ │ │ ├── 2095_0_20201116.csv │ │ │ │ ├── 2096_0_20201116.csv │ │ │ │ ├── 2097_0_20201116.csv │ │ │ │ ├── 2098_0_20201106.csv │ │ │ │ └── 2099_0_20201116.csv │ │ │ ├── Shanghai_T2DM_old │ │ │ │ ├── 2000_0_20201230.xlsx │ │ │ │ ├── 2001_0_20201102.xlsx │ │ │ │ ├── 2001_1_20201117.xlsx │ │ │ │ ├── 2002_0_20210513.xlsx │ │ │ │ ├── 2003_0_20210615.xlsx │ │ │ │ ├── 2004_0_20211028.xlsx │ │ │ │ ├── 2005_0_20211201.xlsx │ │ │ │ ├── 2006_0_20211112.xlsx │ │ │ │ ├── 2007_0_20220108.xlsx │ │ │ │ ├── 2008_0_20220118.xlsx │ │ │ │ ├── 2009_0_20211103.xlsx │ │ │ │ ├── 2010_0_20220111.xlsx │ │ │ │ ├── 2011_0_20220123.xlsx │ │ │ │ ├── 2012_0_20220126.xlsx │ │ │ │ ├── 2013_0_20220123.xlsx │ │ │ │ ├── 2014_0_20201224.xlsx │ │ │ │ ├── 2014_1_20210317.xlsx │ │ │ │ ├── 2015_0_20210203.xlsx │ │ │ │ ├── 2015_1_20210219.xlsx │ │ │ │ ├── 2016_0_20201224.xlsx │ │ │ │ ├── 2017_0_20210102.xlsx │ │ │ │ ├── 2017_1_20201118.xlsx │ │ │ │ ├── 2018_0_20210420.xlsx │ │ │ │ ├── 2019_0_20210513.xlsx │ │ │ │ ├── 2020_0_20210423.xlsx │ │ │ │ ├── 2021_0_20211013.xlsx │ │ │ │ ├── 2022_0_20210419.xlsx │ │ │ │ ├── 2023_0_20210812.xlsx │ │ │ │ ├── 2024_0_20210429.xlsx │ │ │ │ ├── 2025_0_20210506.xlsx │ │ │ │ ├── 2026_0_20210916.xlsx │ │ │ │ ├── 2027_0_20210521.xlsx │ │ │ │ ├── 2028_0_20210426.xlsx │ │ │ │ ├── 2029_0_20210526.xlsx │ │ │ │ ├── 2030_0_20210531.xlsx │ │ │ │ ├── 2031_0_20210601.xlsx │ │ │ │ ├── 2032_0_20210727.xlsx │ │ │ │ ├── 2033_0_20210615.xlsx │ │ │ │ ├── 2034_0_20210624.xlsx │ │ │ │ ├── 2035_0_20210629.xlsx │ │ │ │ ├── 2036_0_20210803.xlsx │ │ │ │ ├── 2037_0_20201221.xlsx │ │ │ │ ├── 2038_0_20210608.xlsx │ │ │ │ ├── 2039_0_20210615.xlsx │ │ │ │ ├── 2040_0_20210729.xlsx │ │ │ │ ├── 2041_0_20210813.xlsx │ │ │ │ ├── 2042_0_20211019.xlsx │ │ │ │ ├── 2043_0_20210513.xlsx │ │ │ │ ├── 2044_0_20211101.xlsx │ │ │ │ ├── 2045_0_20201216.xlsx │ │ │ │ ├── 2046_0_20201216.xlsx │ │ │ │ ├── 2047_0_20210420.xlsx │ │ │ │ ├── 2048_0_20210426.xlsx │ │ │ │ ├── 2049_0_20210426.xlsx │ │ │ │ ├── 2050_0_20210510.xlsx │ │ │ │ ├── 2051_0_20210512.xlsx │ │ │ │ ├── 2052_0_20210511.xlsx │ │ │ │ ├── 2053_0_20210518.xlsx │ │ │ │ ├── 2054_0_20210524.xlsx │ │ │ │ ├── 2055_0_20210524.xlsx │ │ │ │ ├── 2055_1_20201207.xlsx │ │ │ │ ├── 2056_0_20210524.xlsx │ │ │ │ ├── 2057_0_20210525.xlsx │ │ │ │ ├── 2058_0_20210524.xlsx │ │ │ │ ├── 2059_0_20210525.xlsx │ │ │ │ ├── 2060_0_20201214.xlsx │ │ │ │ ├── 2061_0_20210601.xlsx │ │ │ │ ├── 2062_0_20210601.xlsx │ │ │ │ ├── 2063_0_20210608.xlsx │ │ │ │ ├── 2064_0_20210608.xlsx │ │ │ │ ├── 2065_0_20210615.xlsx │ │ │ │ ├── 2066_0_20210615.xlsx │ │ │ │ ├── 2067_0_20210615.xlsx │ │ │ │ ├── 2068_0_20210616.xlsx │ │ │ │ ├── 2069_0_20210621.xlsx │ │ │ │ ├── 2069_1_20210705.xlsx │ │ │ │ ├── 2069_2_20210825.xlsx │ │ │ │ ├── 2070_0_20210629.xlsx │ │ │ │ ├── 2071_0_20210705.xlsx │ │ │ │ ├── 2072_0_20210706.xlsx │ │ │ │ ├── 2073_0_20210703.xlsx │ │ │ │ ├── 2074_0_20210707.xlsx │ │ │ │ ├── 2074_1_20210720.xlsx │ │ │ │ ├── 2075_0_20210720.xlsx │ │ │ │ ├── 2076_0_20210720.xlsx │ │ │ │ ├── 2077_0_20210803.xlsx │ │ │ │ ├── 2078_0_20210803.xlsx │ │ │ │ ├── 2078_1_20210817.xlsx │ │ │ │ ├── 2079_0_20210809.xlsx │ │ │ │ ├── 2080_0_20210816.xlsx │ │ │ │ ├── 2081_0_20210817.xlsx │ │ │ │ ├── 2082_0_20210907.xlsx │ │ │ │ ├── 2083_0_20201214.xlsx │ │ │ │ ├── 2084_0_20211013.xlsx │ │ │ │ ├── 2085_0_20200907.xlsx │ │ │ │ ├── 2086_0_20200914.xlsx │ │ │ │ ├── 2087_0_20201012.xlsx │ │ │ │ ├── 2088_0_20201123.xlsx │ │ │ │ ├── 2089_0_20201019.xlsx │ │ │ │ ├── 2090_0_20201130.xlsx │ │ │ │ ├── 2091_0_20201029.xlsx │ │ │ │ ├── 2092_0_20201109.xlsx │ │ │ │ ├── 2093_0_20201109.xlsx │ │ │ │ ├── 2094_0_20211109.xlsx │ │ │ │ ├── 2095_0_20201116.xlsx │ │ │ │ ├── 2096_0_20201116.xlsx │ │ │ │ ├── 2097_0_20201116.xlsx │ │ │ │ ├── 2098_0_20201106.xlsx │ │ │ │ └── 2099_0_20201116.xlsx │ │ │ ├── combined6.4 │ │ │ │ └── combined_data.xlsx │ │ │ ├── correlation_analysis.xlsx │ │ │ ├── drug_name_to_code.xlsx │ │ │ └── summary │ │ │ │ ├── Acute Diabetic Complications.xlsx │ │ │ │ ├── Comorbidities.xlsx │ │ │ │ ├── Diabetic Macrovascular Complications.xlsx │ │ │ │ ├── Diabetic Microvascular Complications.xlsx │ │ │ │ ├── Hypoglycemic Agents.xlsx │ │ │ │ ├── Other Agents.xlsx │ │ │ │ ├── Shanghai_T1DM_Summary0.xlsx │ │ │ │ └── Shanghai_T2DM_Summary0.xlsx │ │ └── predict.py │ ├── README.md │ ├── Transformer │ │ ├── README.assets │ │ │ ├── image-20240614222537322.png │ │ │ ├── image-20240614222548573.png │ │ │ ├── image-20240614222629816.png │ │ │ └── image-20240614223619173.png │ │ ├── README.md │ │ ├── TransformerModel.py │ │ ├── data_analysis.ipynb │ │ ├── data_preprocessing.ipynb │ │ ├── dataset.ipynb │ │ ├── dataset.py │ │ ├── dataset │ │ │ ├── T1DM │ │ │ │ ├── 1001_0_20210730.csv │ │ │ │ ├── 1002_0_20210504.csv │ │ │ │ ├── 1002_1_20210521.csv │ │ │ │ ├── 1002_2_20210909.csv │ │ │ │ ├── 1003_0_20210831.csv │ │ │ │ ├── 1004_0_20210425.csv │ │ │ │ ├── 1005_0_20210522.csv │ │ │ │ ├── 1006_0_20210114.csv │ │ │ │ ├── 1006_1_20210209.csv │ │ │ │ ├── 1006_2_20210303.csv │ │ │ │ ├── 1007_0_20210726.csv │ │ │ │ ├── 1008_0_20210713.csv │ │ │ │ ├── 1009_0_20210803.csv │ │ │ │ ├── 1010_0_20210915.csv │ │ │ │ ├── 1011_0_20210622.csv │ │ │ │ └── 1012_0_20210923.csv │ │ │ └── T2DM │ │ │ │ ├── 2000_0_20201230.csv │ │ │ │ ├── 2001_0_20201102.csv │ │ │ │ ├── 2001_1_20201117.csv │ │ │ │ ├── 2002_0_20210513.csv │ │ │ │ ├── 2003_0_20210615.csv │ │ │ │ ├── 2004_0_20211028.csv │ │ │ │ ├── 2005_0_20211201.csv │ │ │ │ ├── 2006_0_20211112.csv │ │ │ │ ├── 2007_0_20220108.csv │ │ │ │ ├── 2008_0_20220118.csv │ │ │ │ ├── 2009_0_20211103.csv │ │ │ │ ├── 2010_0_20220111.csv │ │ │ │ ├── 2011_0_20220123.csv │ │ │ │ ├── 2012_0_20220126.csv │ │ │ │ ├── 2013_0_20220123.csv │ │ │ │ ├── 2014_0_20201224.csv │ │ │ │ ├── 2014_1_20210317.csv │ │ │ │ ├── 2015_0_20210203.csv │ │ │ │ ├── 2015_1_20210219.csv │ │ │ │ ├── 2016_0_20201224.csv │ │ │ │ ├── 2017_0_20210102.csv │ │ │ │ ├── 2017_1_20201118.csv │ │ │ │ ├── 2018_0_20210420.csv │ │ │ │ ├── 2019_0_20210513.csv │ │ │ │ ├── 2020_0_20210423.csv │ │ │ │ ├── 2021_0_20211013.csv │ │ │ │ ├── 2022_0_20210419.csv │ │ │ │ ├── 2023_0_20210812.csv │ │ │ │ ├── 2024_0_20210429.csv │ │ │ │ ├── 2025_0_20210506.csv │ │ │ │ ├── 2026_0_20210916.csv │ │ │ │ ├── 2027_0_20210521.csv │ │ │ │ ├── 2028_0_20210426.csv │ │ │ │ ├── 2029_0_20210526.csv │ │ │ │ ├── 2030_0_20210531.csv │ │ │ │ ├── 2031_0_20210601.csv │ │ │ │ ├── 2032_0_20210727.csv │ │ │ │ ├── 2033_0_20210615.csv │ │ │ │ ├── 2034_0_20210624.csv │ │ │ │ ├── 2035_0_20210629.csv │ │ │ │ ├── 2036_0_20210803.csv │ │ │ │ ├── 2037_0_20201221.csv │ │ │ │ ├── 2038_0_20210608.csv │ │ │ │ ├── 2039_0_20210615.csv │ │ │ │ ├── 2040_0_20210729.csv │ │ │ │ ├── 2041_0_20210813.csv │ │ │ │ ├── 2042_0_20211019.csv │ │ │ │ ├── 2043_0_20210513.csv │ │ │ │ ├── 2044_0_20211101.csv │ │ │ │ ├── 2045_0_20201216.csv │ │ │ │ ├── 2046_0_20201216.csv │ │ │ │ ├── 2047_0_20210420.csv │ │ │ │ ├── 2048_0_20210426.csv │ │ │ │ ├── 2049_0_20210426.csv │ │ │ │ ├── 2050_0_20210510.csv │ │ │ │ ├── 2051_0_20210512.csv │ │ │ │ ├── 2052_0_20210511.csv │ │ │ │ ├── 2053_0_20210518.csv │ │ │ │ ├── 2054_0_20210524.csv │ │ │ │ ├── 2055_0_20210524.csv │ │ │ │ ├── 2055_1_20201207.csv │ │ │ │ ├── 2056_0_20210524.csv │ │ │ │ ├── 2057_0_20210525.csv │ │ │ │ ├── 2058_0_20210524.csv │ │ │ │ ├── 2059_0_20210525.csv │ │ │ │ ├── 2060_0_20201214.csv │ │ │ │ ├── 2061_0_20210601.csv │ │ │ │ ├── 2062_0_20210601.csv │ │ │ │ ├── 2063_0_20210608.csv │ │ │ │ ├── 2064_0_20210608.csv │ │ │ │ ├── 2065_0_20210615.csv │ │ │ │ ├── 2066_0_20210615.csv │ │ │ │ ├── 2067_0_20210615.csv │ │ │ │ ├── 2068_0_20210616.csv │ │ │ │ ├── 2069_0_20210621.csv │ │ │ │ ├── 2069_1_20210705.csv │ │ │ │ ├── 2069_2_20210825.csv │ │ │ │ ├── 2070_0_20210629.csv │ │ │ │ ├── 2071_0_20210705.csv │ │ │ │ ├── 2072_0_20210706.csv │ │ │ │ ├── 2073_0_20210703.csv │ │ │ │ ├── 2074_0_20210707.csv │ │ │ │ ├── 2074_1_20210720.csv │ │ │ │ ├── 2075_0_20210720.csv │ │ │ │ ├── 2076_0_20210720.csv │ │ │ │ ├── 2077_0_20210803.csv │ │ │ │ ├── 2078_0_20210803.csv │ │ │ │ ├── 2078_1_20210817.csv │ │ │ │ ├── 2079_0_20210809.csv │ │ │ │ ├── 2080_0_20210816.csv │ │ │ │ ├── 2081_0_20210817.csv │ │ │ │ ├── 2082_0_20210907.csv │ │ │ │ ├── 2083_0_20201214.csv │ │ │ │ ├── 2084_0_20211013.csv │ │ │ │ ├── 2085_0_20200907.csv │ │ │ │ ├── 2086_0_20200914.csv │ │ │ │ ├── 2087_0_20201012.csv │ │ │ │ ├── 2088_0_20201123.csv │ │ │ │ ├── 2089_0_20201019.csv │ │ │ │ ├── 2090_0_20201130.csv │ │ │ │ ├── 2091_0_20201029.csv │ │ │ │ ├── 2092_0_20201109.csv │ │ │ │ ├── 2093_0_20201109.csv │ │ │ │ ├── 2094_0_20211109.csv │ │ │ │ ├── 2095_0_20201116.csv │ │ │ │ ├── 2096_0_20201116.csv │ │ │ │ ├── 2097_0_20201116.csv │ │ │ │ ├── 2098_0_20201106.csv │ │ │ │ └── 2099_0_20201116.csv │ │ ├── fine1.py │ │ ├── fine2.py │ │ ├── main.py │ │ ├── runs │ │ │ ├── fine1_train_logs_20240613-205402 │ │ │ │ └── events.out.tfevents.1718283242.Momoyama.3504.0 │ │ │ ├── fine2_train_logs_20240613-205827 │ │ │ │ └── events.out.tfevents.1718283507.Momoyama.40912.0 │ │ │ ├── fine2_train_logs_20240613-205851 │ │ │ │ └── events.out.tfevents.1718283531.Momoyama.27888.0 │ │ │ ├── fine_train_logs_20240613-204045 │ │ │ │ └── events.out.tfevents.1718282445.Momoyama.7580.0 │ │ │ ├── train_logs_20240613-151820 │ │ │ │ └── events.out.tfevents.1718263100.Momoyama.23272.0 │ │ │ ├── train_logs_20240613-154310 │ │ │ │ └── events.out.tfevents.1718264590.Momoyama.3148.0 │ │ │ ├── train_logs_20240613-155119 │ │ │ │ └── events.out.tfevents.1718265079.Momoyama.1984.0 │ │ │ ├── train_logs_20240613-155918 │ │ │ │ └── events.out.tfevents.1718265558.Momoyama.21508.0 │ │ │ ├── train_logs_20240613-163857 │ │ │ │ └── events.out.tfevents.1718267937.Momoyama.32832.0 │ │ │ ├── train_logs_20240613-170052 │ │ │ │ └── events.out.tfevents.1718269252.Momoyama.10916.0 │ │ │ ├── train_logs_20240613-171248 │ │ │ │ └── events.out.tfevents.1718269968.Momoyama.22404.0 │ │ │ ├── train_logs_20240613-172139 │ │ │ │ └── events.out.tfevents.1718270499.Momoyama.25060.0 │ │ │ ├── train_logs_20240613-173832 │ │ │ │ └── events.out.tfevents.1718271512.Momoyama.9588.0 │ │ │ ├── train_logs_20240613-185524 │ │ │ │ └── events.out.tfevents.1718276124.Momoyama.11480.0 │ │ │ ├── train_logs_20240613-201416 │ │ │ │ └── events.out.tfevents.1718280856.Momoyama.33460.0 │ │ │ └── train_logs_20240614-113015 │ │ │ │ └── events.out.tfevents.1718335815.Momoyama.24408.0 │ │ ├── test.py │ │ ├── test_gradient.py │ │ └── transformer_preprossing.ipynb │ └── data_preprocessing.ipynb └── report.pdf └── 论文.pdf /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/.DS_Store -------------------------------------------------------------------------------- /PPT/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/.DS_Store -------------------------------------------------------------------------------- /PPT/week2-course introduction.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week2-course introduction.pptx -------------------------------------------------------------------------------- /PPT/week2-data.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week2-data.pptx -------------------------------------------------------------------------------- /PPT/week3-clustering-1.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week3-clustering-1.pptx -------------------------------------------------------------------------------- /PPT/week4-clustering-2 .pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week4-clustering-2 .pptx -------------------------------------------------------------------------------- /PPT/week5-1-cluster validity.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week5-1-cluster validity.pptx -------------------------------------------------------------------------------- /PPT/week5-2-Clustering Ensemble.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week5-2-Clustering Ensemble.ppt -------------------------------------------------------------------------------- /PPT/week6-1-bayes-classifier-KNN.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/PPT/week6-1-bayes-classifier-KNN.pptx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Data-Analysis-and-Data-Mining-2024-Spring 2 | 这是同济大学软件学院2024年网络方向数据分析与数据挖掘专选作业和笔记🌸~ 3 | -------------------------------------------------------------------------------- /hw2-Data-Pre-processing/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw2-Data-Pre-processing/.DS_Store -------------------------------------------------------------------------------- /hw2-Data-Pre-processing/2024_DAM_hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw2-Data-Pre-processing/2024_DAM_hw2.pdf -------------------------------------------------------------------------------- /hw2-Data-Pre-processing/Assignment 2_ Data Pre-processing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw2-Data-Pre-processing/Assignment 2_ Data Pre-processing.pdf -------------------------------------------------------------------------------- /hw3-Cluster/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw3-Cluster/.DS_Store -------------------------------------------------------------------------------- /hw3-Cluster/2024_DAM_hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw3-Cluster/2024_DAM_hw3.pdf -------------------------------------------------------------------------------- /hw3-Cluster/Code/README.md: -------------------------------------------------------------------------------- 1 | # 层次聚类算法实现 2 | 3 | 2051498 储岱泽 4 | 5 | --- 6 | 7 | 这是一个层次聚类算法的Python实现,用于对数据集进行聚类分析。该实现支持凝聚式和分裂式两种层次聚类方法,并提供了不同的链接方式和距离度量选项。 8 | 9 | ## 文件结构 10 | 11 | - `hierarchical_clustering.py`: 包含了层次聚类算法的完整实现代码。 12 | - `README.md`: 本文件,提供有关项目的说明和使用指南。 13 | - `test_on_dataset.ipynb`: 包含了导入鸢尾花数据集并对其使用自己写的层次聚类的类进行分析的过程。 14 | 15 | ## 使用方法 16 | 17 | ### 安装依赖 18 | 19 | 确保你已经安装了以下Python库: 20 | 21 | - numpy 22 | - scipy 23 | - matplotlib 24 | 25 | ### 运行示例 26 | 27 | - 你可以一步一步运行`test_on_dataset.ipynb`文件的单元格来查看HierarchicalClustering类运行的情况和功能。 28 | - 同时也可以运行`hierarchical_clustering.py`文件来确保这个类可用。 29 | 30 | ``` 31 | python example.py 32 | ``` 33 | 34 | 该示例将使用层次聚类算法对示例数据集进行聚类,并绘制聚类结果的散点图。 35 | 36 | ## 参数说明 37 | 38 | 在`HierarchicalClustering`类的构造函数中,你可以设置以下参数: 39 | 40 | - `n_clusters`: 期望分成的簇的个数,默认为2。 41 | - `linkage`: 链接方式选择,可选项为`'single'`、`'complete'`和`'average'`,默认为`'single'`。 42 | - `distance_method`: 距离计算方法,可选项为`'Euclidean'`、`'Manhattan'`和`'Chebyshev'`,默认为`'Euclidean'`。 43 | 44 | ## 实现细节 45 | 46 | ### 聚类算法 47 | 48 | 该实现使用了经典的层次聚类算法,采用自下而上的聚合方法,根据所选择的链接方式和距离度量计算样本之间的距离,并根据距离合并最相似的样本或簇。通过不断合并直到达到预设的簇的个数,最终得到聚类结果。 49 | 50 | ### 时间复杂度 51 | 52 | 算法的主要时间开销集中在计算样本间的距离矩阵和合并簇的过程中。假设有n个样本,计算距离矩阵的时间复杂度为O(n^2),合并簇的时间复杂度为O(n^3)。因此,整体时间复杂度为O(n^3)。 53 | 54 | 55 | ### 空间复杂度 56 | 57 | 算法的空间开销主要来⾃距离矩阵和簇的存储。距离矩阵需要O(n^2)的空间,簇的存储需要O(n)的空间。因此,整体空间复杂度为O(n^2)。 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /hw3-Cluster/Code/hierarchical_clustering.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | import time 4 | from scipy.cluster.hierarchy import dendrogram 5 | from scipy.cluster.hierarchy import linkage 6 | from scipy.spatial.distance import squareform 7 | 8 | class HierarchicalClustering: 9 | def __init__(self, n_clusters=2, linkage='single', distance_method='Euclidean'): 10 | self.n_clusters = n_clusters # 期望分成的簇的个数 11 | self.linkage = linkage # 链接方式选择 12 | self.distance_method=distance_method #距离计算方法 13 | self.cluster_points = [] # 初始化簇 14 | self.distances_dict = {} # 初始化距离矩阵字典 15 | self.link=[] #链接矩阵 16 | self.time=0 17 | 18 | def fit(self, X): 19 | start_time = time.time() 20 | n_samples, _ = X.shape 21 | self.labels_ = np.zeros(n_samples) 22 | 23 | distances = np.zeros((n_samples, n_samples)) 24 | self.cluster_points = [[i] for i in range(n_samples)] # 每个点为一个簇 25 | # 初始化簇和距离矩阵字典 26 | # print(self.cluster_points) 27 | 28 | #计算距离矩阵字典 29 | for i in range(n_samples): 30 | for j in range(n_samples): 31 | distances[i][j] = self.calculate_distance(X[i], X[j]) 32 | # print(distances) 33 | # 将距离矩阵转换为压缩形式 34 | condensed_distances = squareform(distances) 35 | self.link = linkage(condensed_distances, method=self.linkage) # 此处的distances是您计算的距离矩阵 36 | 37 | #进行聚类 38 | for _ in range(n_samples - self.n_clusters): 39 | 40 | #先寻找距离最短的两个簇 41 | min_distance = np.inf 42 | for b in range(n_samples): 43 | for c in range(b+1, n_samples): 44 | if distances[b][c] < min_distance: 45 | min_distance = distances[b][c] 46 | min_i = b #将距离最短的这两个簇给记下来 47 | min_j = c 48 | # 先对存储簇的ID的数组给处理了 49 | self.cluster_points[min_i].extend(self.cluster_points[min_j]) # 将第min_j行合并到上面的min_i 50 | del self.cluster_points[min_j] # 然后将min_j行删掉 51 | 52 | # print(self.cluster_points) 53 | 54 | # 更新距离字典 55 | for i in range(n_samples): 56 | if i != min_i and i != min_j: 57 | if self.linkage == 'single': 58 | distances[min_i, i] = min(distances[min_i, i], distances[min_j, i]) 59 | elif self.linkage == 'complete': 60 | distances[min_i, i] = max(distances[min_i, i], distances[min_j, i]) 61 | elif self.linkage == 'average': 62 | distances[min_i, i] = (distances[min_i, i] + distances[min_j, i]) / 2 63 | # print(distances) 64 | 65 | distances = np.delete(distances, min_j, axis=0) 66 | distances = np.delete(distances, min_j, axis=1) 67 | # print(distances) 68 | 69 | n_samples -= 1 # 更新样本数量 70 | 71 | # 根据簇的合并情况得到最终的标签 72 | self.labels_ = self.get_labels(self.distances_dict) 73 | # 对每个簇中的ID进行排序 74 | for i in range(len(self.cluster_points)): 75 | self.cluster_points[i].sort() 76 | 77 | end_time = time.time() 78 | self.time = end_time - start_time 79 | 80 | return self.cluster_points 81 | 82 | # 运用距离公式计算距离 83 | def calculate_distance(self, x1, x2): 84 | if self.distance_method == 'Manhattan': 85 | return np.linalg.norm(x1 - x2, ord=1) # 曼哈顿距离 86 | elif self.distance_method == 'Chebyshev': 87 | return np.linalg.norm(x1 - x2, ord=np.inf) # 切比雪夫距离 88 | elif self.distance_method == 'Euclidean': 89 | return np.linalg.norm(x1 - x2) #欧氏距离 90 | 91 | def get_labels(self, distances_dict): 92 | n_samples = len(distances_dict) 93 | labels = np.zeros(n_samples) 94 | current_label = 0 95 | cluster_dict = {} 96 | 97 | for i, distances in distances_dict.items(): 98 | if i not in cluster_dict: 99 | cluster_dict[i] = current_label 100 | current_label += 1 101 | 102 | for j, dist in distances.items(): 103 | if dist == 0: 104 | if j not in cluster_dict: 105 | cluster_dict[j] = cluster_dict[i] 106 | else: 107 | for k, v in cluster_dict.items(): 108 | if v == cluster_dict[j]: 109 | cluster_dict[k] = cluster_dict[i] 110 | break 111 | 112 | for i in range(n_samples): 113 | labels[i] = cluster_dict[i] 114 | 115 | return labels.astype(int) 116 | 117 | # 聚类结果可视化 118 | def plot_clusters(self, X,x_label,y_label,title): 119 | colors = ['r', 'g', 'b', 'c', 'm', 'y', 'k'] 120 | fig, ax = plt.subplots(1, 1, figsize=(8, 6)) # 创建一个子图 121 | 122 | # 绘制聚类结果散点图 123 | for i, cluster in enumerate(self.cluster_points): 124 | cluster_color = colors[i % len(colors)] 125 | cluster_data = X[cluster] 126 | ax.scatter(cluster_data[:, 0], cluster_data[:, 1], c=cluster_color, label=f'Cluster {i}') 127 | ax.legend() 128 | ax.set_xlabel(x_label) 129 | ax.set_ylabel(y_label) 130 | ax.set_title(title) 131 | 132 | plt.show() 133 | 134 | # 测试算法 135 | X_t = np.array([[1, 2], [1, 3], [2, 2], [8, 7], [8, 8], [7, 7]]) 136 | model_single = HierarchicalClustering(n_clusters=2, linkage='single') 137 | model_complete = HierarchicalClustering(n_clusters=2, linkage='complete') 138 | model_average = HierarchicalClustering(n_clusters=2, linkage='average') 139 | 140 | cluster1 = model_single.fit(X_t) 141 | cluster2 = model_complete.fit(X_t) 142 | cluster3 = model_average.fit(X_t) 143 | 144 | print(cluster1) 145 | print(cluster2) 146 | print(cluster3) 147 | 148 | model_single.plot_clusters(X_t,"X","Y","Cluster-single") 149 | model_complete.plot_clusters(X_t,"X","Y","Cluster-complete") 150 | model_average.plot_clusters(X_t,"X","Y","Cluster-average") 151 | -------------------------------------------------------------------------------- /hw3-Cluster/Report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw3-Cluster/Report.pdf -------------------------------------------------------------------------------- /hw4-DBSCAN/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw4-DBSCAN/.DS_Store -------------------------------------------------------------------------------- /hw4-DBSCAN/2024_DAM_hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw4-DBSCAN/2024_DAM_hw4.pdf -------------------------------------------------------------------------------- /hw4-DBSCAN/DBSCAN实现.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/hw4-DBSCAN/DBSCAN实现.pdf -------------------------------------------------------------------------------- /hw4-DBSCAN/README.md: -------------------------------------------------------------------------------- 1 | # DBSCAN聚类算法作业 2 | 3 | 本仓库包含了数据挖掘与分析课程中DBSCAN(Density-Based Spatial Clustering of Applications with Noise)算法的实现和文档。 4 | 5 | ## 项目结构 6 | 7 | ``` 8 | 2051498-储岱泽-hw4 9 | │ DBSCAN实现.pdf 10 | | README.md 11 | ├───code 12 | │ │ DBSCAN.py 13 | │ │ DBSCAN.ipynb 14 | ``` 15 | 16 | - 其中,DBSCAN.py中展示的是DBSCAN算法的用python的具体实现。 17 | - DBSCAN.ipynb展示的是运用自己写的DBSCAN在鸢尾花数据集上进行聚类实验的代码,同时实现了数据可视化。 18 | - DBSCAN实现.pdf是项目的报告。 19 | -------------------------------------------------------------------------------- /hw4-DBSCAN/code/DBSCAN.py: -------------------------------------------------------------------------------- 1 | import numpy as np # 导入numpy库,用于矩阵运算和处理 2 | import matplotlib.pyplot as plt 3 | 4 | class DBSCAN: 5 | # 初始化函数,设置eps邻域半径和minPts最小点数 6 | def __init__(self, eps, min_pts): 7 | self.eps = eps # 邻域半径,两个点成为邻居的最大距离 8 | self.min_pts = min_pts # 一个点成为“核心点”所需的最小邻居数目 9 | 10 | # 主函数,用于拟合数据并预测每个点的聚类标签 11 | def fit_predict(self, X): 12 | labels = [0] * len(X) # 初始化所有点的标签为0 13 | cluster_id = 0 # 初始化聚类ID 14 | 15 | # 对每个点进行迭代 16 | for i in range(len(X)): 17 | if labels[i] != 0: # 如果点已经被标记,则跳过 18 | continue 19 | 20 | # 获取点i的邻域点 21 | neighbors = self.region_query(X, i) 22 | if len(neighbors) < self.min_pts: # 如果邻域点数少于minPts,则为噪声点 23 | labels[i] = -1 # 标记为-1 24 | else: # 否则,将该点作为新聚类的核心点 25 | cluster_id += 1 # 聚类ID自增 26 | self.expand_cluster(X, labels, i, neighbors, cluster_id) # 扩展该核心点的聚类 27 | 28 | return labels # 返回所有点的聚类标签 29 | 30 | # 递归函数,用于扩展以核心点为核心的聚类 31 | def expand_cluster(self, X, labels, core_idx, neighbors, cluster_id): 32 | labels[core_idx] = cluster_id # 将核心点标记为当前聚类ID 33 | 34 | i = 0 # 初始化索引 35 | # 当存在待处理的邻居点时 36 | while i < len(neighbors): 37 | idx = neighbors[i] # 取出当前邻居点的索引 38 | if labels[idx] == -1: # 如果邻居是噪声点,则将其标记为当前聚类ID 39 | labels[idx] = cluster_id 40 | elif labels[idx] == 0: # 如果邻居尚未分配到任何聚类 41 | labels[idx] = cluster_id # 将其标记为当前聚类ID 42 | new_neighbors = self.region_query(X, idx) # 获取邻居点的邻域点 43 | if len(new_neighbors) >= self.min_pts: # 如果邻居点的邻域点数足够 44 | neighbors.extend(new_neighbors) # 将这些邻域点添加到待处理列表 45 | i += 1 # 移动到下一个邻居点 46 | 47 | # 寻找给定点的邻域点 48 | def region_query(self, X, idx): 49 | neighbors = [] # 初始化邻域点列表 50 | for i in range(len(X)): # 遍历所有点 51 | if np.linalg.norm(X[idx] - X[i]) < self.eps: # 如果两点之间的欧氏距离小于eps 52 | neighbors.append(i) # 将点i添加到邻域点列表 53 | return neighbors # 返回邻域点列表 54 | 55 | # 示例用法 56 | if __name__ == "__main__": 57 | # 创建一个示例数据集 58 | X = np.array([[1, 2], [2, 2], [2, 3], [8, 7], [8, 8], [25, 80]]) 59 | 60 | # 初始化DBSCAN模型并拟合数据 61 | dbscan = DBSCAN(eps=3, min_pts=2) 62 | labels = dbscan.fit_predict(X) 63 | 64 | # 打印聚类结果 65 | print("Cluster labels:", labels) 66 | 67 | # 提取每个聚类的点 68 | clusters = {} 69 | for i, label in enumerate(labels): 70 | if label not in clusters: 71 | clusters[label] = [] 72 | clusters[label].append(X[i]) 73 | 74 | # 绘制聚类结果 75 | plt.figure(figsize=(8, 6)) 76 | for label, points in clusters.items(): 77 | if label == -1: 78 | plt.scatter([p[0] for p in points], [p[1] for p in points], c='gray', label='Noise') 79 | else: 80 | plt.scatter([p[0] for p in points], [p[1] for p in points], label=f'Cluster {label}') 81 | 82 | plt.xlabel('Feature 1') 83 | plt.ylabel('Feature 2') 84 | plt.title('DBSCAN Clustering Result') 85 | plt.legend() 86 | plt.show() -------------------------------------------------------------------------------- /workshop/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/.DS_Store -------------------------------------------------------------------------------- /workshop/2024_DAM_workshop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/2024_DAM_workshop.pdf -------------------------------------------------------------------------------- /workshop/2051498-储岱泽小组-workshop/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/2051498-储岱泽小组-workshop/.DS_Store -------------------------------------------------------------------------------- /workshop/2051498-储岱泽小组-workshop/member.txt: -------------------------------------------------------------------------------- 1 | member 2 | 2051498 储岱泽 3 | 2051828 莫益萌 4 | 2151615 沈书勤 5 | 2151641 王佳垚 6 | 7 | 我们小组采用提交报告的方式来完成此次workshop~ 8 | 9 | -------------------------------------------------------------------------------- /workshop/2051498-储岱泽小组-workshop/report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/2051498-储岱泽小组-workshop/report.pdf -------------------------------------------------------------------------------- /workshop/2051498-储岱泽小组-workshop/主要参考文献Struct-GPT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/2051498-储岱泽小组-workshop/主要参考文献Struct-GPT.pdf -------------------------------------------------------------------------------- /workshop/StructGPT:一种基于LLM的处理结构化数据的通用框架.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/StructGPT:一种基于LLM的处理结构化数据的通用框架.docx -------------------------------------------------------------------------------- /workshop/StructGPT:一种基于LLM的处理结构化数据的通用框架.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/workshop/StructGPT:一种基于LLM的处理结构化数据的通用框架.pdf -------------------------------------------------------------------------------- /期末项目/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/.DS_Store -------------------------------------------------------------------------------- /期末项目/2024_Final-Project.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/2024_Final-Project.pdf -------------------------------------------------------------------------------- /期末项目/2205.13504v3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/2205.13504v3.pdf -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/.DS_Store -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/.DS_Store -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1001_0_20210730.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1001_0_20210730.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1002_0_20210504.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1002_0_20210504.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1002_1_20210521.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1002_1_20210521.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1002_2_20210909.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1002_2_20210909.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1003_0_20210831.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1003_0_20210831.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1004_0_20210425.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1004_0_20210425.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1005_0_20210522.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1005_0_20210522.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1006_0_20210114.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1006_0_20210114.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1006_1_20210209.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1006_1_20210209.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1006_2_20210303.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1006_2_20210303.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1007_0_20210726.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1007_0_20210726.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1008_0_20210713.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1008_0_20210713.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1009_0_20210803.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1009_0_20210803.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1010_0_20210915.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1010_0_20210915.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1011_0_20210622.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1011_0_20210622.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM/1012_0_20210923.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM/1012_0_20210923.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T1DM_Summary.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T1DM_Summary.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2000_0_20201230.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2000_0_20201230.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2001_0_20201102.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2001_0_20201102.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2001_1_20201117.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2001_1_20201117.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2002_0_20210513.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2002_0_20210513.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2003_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2003_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2004_0_20211028.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2004_0_20211028.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2005_0_20211201.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2005_0_20211201.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2006_0_20211112.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2006_0_20211112.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2007_0_20220108.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2007_0_20220108.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2008_0_20220118.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2008_0_20220118.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2009_0_20211103.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2009_0_20211103.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2010_0_20220111.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2010_0_20220111.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2011_0_20220123.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2011_0_20220123.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2012_0_20220126.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2012_0_20220126.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2013_0_20220123.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2013_0_20220123.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2014_0_20201224.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2014_0_20201224.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2014_1_20210317.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2014_1_20210317.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2015_0_20210203.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2015_0_20210203.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2015_1_20210219.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2015_1_20210219.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2016_0_20201224.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2016_0_20201224.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2017_0_20210102.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2017_0_20210102.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2017_1_20201118.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2017_1_20201118.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2018_0_20210420.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2018_0_20210420.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2019_0_20210513.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2019_0_20210513.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2020_0_20210423.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2020_0_20210423.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2021_0_20211013.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2021_0_20211013.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2022_0_20210419.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2022_0_20210419.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2023_0_20210812.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2023_0_20210812.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2024_0_20210429.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2024_0_20210429.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2025_0_20210506.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2025_0_20210506.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2026_0_20210916.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2026_0_20210916.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2027_0_20210521.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2027_0_20210521.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2028_0_20210426.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2028_0_20210426.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2029_0_20210526.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2029_0_20210526.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2030_0_20210531.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2030_0_20210531.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2031_0_20210601.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2031_0_20210601.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2032_0_20210727.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2032_0_20210727.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2033_0_20210615.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2033_0_20210615.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2034_0_20210624.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2034_0_20210624.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2035_0_20210629.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2035_0_20210629.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2036_0_20210803.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2036_0_20210803.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2037_0_20201221.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2037_0_20201221.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2038_0_20210608.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2038_0_20210608.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2039_0_20210615.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2039_0_20210615.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2040_0_20210729.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2040_0_20210729.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2041_0_20210813.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2041_0_20210813.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2042_0_20211019.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2042_0_20211019.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2043_0_20210513.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2043_0_20210513.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2044_0_20211101.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2044_0_20211101.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2045_0_20201216.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2045_0_20201216.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2046_0_20201216.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2046_0_20201216.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2047_0_20210420.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2047_0_20210420.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2048_0_20210426.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2048_0_20210426.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2049_0_20210426.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2049_0_20210426.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2050_0_20210510.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2050_0_20210510.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2051_0_20210512.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2051_0_20210512.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2052_0_20210511.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2052_0_20210511.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2053_0_20210518.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2053_0_20210518.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2054_0_20210524.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2054_0_20210524.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2055_0_20210524.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2055_0_20210524.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2055_1_20201207.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2055_1_20201207.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2056_0_20210524.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2056_0_20210524.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2057_0_20210525.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2057_0_20210525.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2058_0_20210524.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2058_0_20210524.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2059_0_20210525.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2059_0_20210525.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2060_0_20201214.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2060_0_20201214.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2061_0_20210601.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2061_0_20210601.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2062_0_20210601.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2062_0_20210601.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2063_0_20210608.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2063_0_20210608.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2064_0_20210608.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2064_0_20210608.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2065_0_20210615.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2065_0_20210615.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2066_0_20210615.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2066_0_20210615.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2067_0_20210615.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2067_0_20210615.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2068_0_20210616.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2068_0_20210616.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2069_0_20210621.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2069_0_20210621.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2069_1_20210705.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2069_1_20210705.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2069_2_20210825.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2069_2_20210825.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2070_0_20210629.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2070_0_20210629.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2071_0_20210705.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2071_0_20210705.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2072_0_20210706.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2072_0_20210706.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2073_0_20210703.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2073_0_20210703.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2074_0_20210707.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2074_0_20210707.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2074_1_20210720.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2074_1_20210720.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2075_0_20210720.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2075_0_20210720.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2076_0_20210720.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2076_0_20210720.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2077_0_20210803.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2077_0_20210803.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2078_0_20210803.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2078_0_20210803.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2078_1_20210817.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2078_1_20210817.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2079_0_20210809.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2079_0_20210809.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2080_0_20210816.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2080_0_20210816.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2081_0_20210817.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2081_0_20210817.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2082_0_20210907.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2082_0_20210907.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2083_0_20201214.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2083_0_20201214.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2084_0_20211013.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2084_0_20211013.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2085_0_20200907.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2085_0_20200907.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2086_0_20200914.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2086_0_20200914.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2087_0_20201012.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2087_0_20201012.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2088_0_20201123.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2088_0_20201123.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2089_0_20201019.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2089_0_20201019.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2090_0_20201130.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2090_0_20201130.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2091_0_20201029.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2091_0_20201029.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2092_0_20201109.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2092_0_20201109.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2093_0_20201109.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2093_0_20201109.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2094_0_20211109.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2094_0_20211109.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2095_0_20201116.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2095_0_20201116.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2096_0_20201116.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2096_0_20201116.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2097_0_20201116.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2097_0_20201116.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2098_0_20201106.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2098_0_20201106.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM/2099_0_20201116.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM/2099_0_20201116.xls -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/Shanghai_T2DM_Summary.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/diabetes_datasets/Shanghai_T2DM_Summary.xlsx -------------------------------------------------------------------------------- /期末项目/diabetes_datasets/note.txt: -------------------------------------------------------------------------------- 1 | This version is to add 188 CGM measurements on ShanghaiT2DM. 2 | In the "Shanghai_T2DM" folder, the file "2003_0_20210615" has extended rows from 586 to 670, with rows from 587 to 670 newly added. 3 | 4 | In the "Shanghai_T2DM" folder, the file "2029_0_20210526" has extended rows from 742 to 846 with rows from 743 to 846 newly added. From line 743 to 755, the CGM values are missing because the CGM device has been changed to a new one. The readings of the new CGM device started from 2021/6/3 12:46. 5 | 6 | 7 | “Shanghai_T2DM”文件夹中的“2003_0_20210615”文件从586行增加到670行,587~670行为新增数据 8 | “Shanghai_T2DM”文件夹中的“2029_0_20210526”文件从742行增加到846行,743~846行为新增数据 9 | 10 | 11 | 2023/10/26 -------------------------------------------------------------------------------- /期末项目/数据集说明.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/数据集说明.pdf -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/.DS_Store -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/2_slides.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/2_slides.pptx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/.DS_Store -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/LSTM.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | import numpy as np 4 | 5 | from sklearn.preprocessing import StandardScaler 6 | from sklearn.model_selection import train_test_split, KFold 7 | from sklearn.metrics import mean_squared_error, mean_absolute_error, roc_auc_score, roc_curve 8 | import tensorflow as tf 9 | from tensorflow.keras.models import Model 10 | from tensorflow.keras.layers import LSTM, Input, Dense, Dropout, concatenate, BatchNormalization 11 | from tensorflow.keras.callbacks import ReduceLROnPlateau 12 | from tensorflow.keras.initializers import HeNormal, GlorotUniform 13 | from tensorflow.keras.callbacks import Callback 14 | import matplotlib.pyplot as plt 15 | 16 | # 定义数据文件夹路径 17 | data_dir = './datasets_new/' 18 | 19 | # 定义需要读取的文件 20 | t1dm_summary_file = os.path.join(data_dir, 'summary', 'Shanghai_T1DM_Summary0.xlsx') 21 | t2dm_summary_file = os.path.join(data_dir, 'summary', 'Shanghai_T2DM_Summary0.xlsx') 22 | 23 | # 读取Summary数据,并新增一个属性type表示糖尿病类型 24 | t1dm_summary = pd.read_excel(t1dm_summary_file) 25 | t1dm_summary['type'] = 1 # T1DM类型标记为1 26 | 27 | t2dm_summary = pd.read_excel(t2dm_summary_file) 28 | t2dm_summary['type'] = 2 # T2DM类型标记为2 29 | 30 | # 读取详细数据 31 | t1dm_files = [os.path.join(data_dir, 'Shanghai_T1DM', f) for f in os.listdir(os.path.join(data_dir, 'Shanghai_T1DM')) if 32 | f.endswith('.csv')] 33 | t2dm_files = [os.path.join(data_dir, 'Shanghai_T2DM', f) for f in os.listdir(os.path.join(data_dir, 'Shanghai_T2DM')) if 34 | f.endswith('.csv')] 35 | 36 | # 读取单个病人的详细数据 37 | def read_patient_data(file): 38 | return pd.read_csv(file) 39 | 40 | # 选择我们关心的特征 41 | time_series_features = [ 42 | 'CGM (mg / dl)', 43 | 'Insulin dose - s.c.', 44 | 'CSII - bolus insulin (Novolin R, IU)', 45 | 'Carbohydrate/g' 46 | ] 47 | static_features = [ 48 | 'type','patient_id','Age (years)', 'Weight (kg)', 'BMI (kg/m2)', 'Duration of Diabetes (years)', 49 | 'HbA1c (mmol/mol)', 'Fasting Plasma Glucose (mg/dl)', '2-hour Postprandial C-peptide (nmol/L)', 50 | 'Fasting C-peptide (nmol/L)', 'Glycated Albumin (%)', 'Acute Diabetic Complications', 51 | 'Diabetic Macrovascular Complications', 'Diabetic Microvascular Complications', 52 | 'Comorbidities', 'Hypoglycemic Agents', 'Other Agents' 53 | ] 54 | median_features = [ 55 | 'Age (years)', 'Weight (kg)', 'BMI (kg/m2)', 'Duration of Diabetes (years)', 56 | 'HbA1c (mmol/mol)', 'Fasting Plasma Glucose (mg/dl)', '2-hour Postprandial C-peptide (nmol/L)', 57 | 'Fasting C-peptide (nmol/L)', 'Glycated Albumin (%)', 58 | ] 59 | # Calculate medians for T1DM and T2DM 60 | t1dm_medians = t1dm_summary[median_features].dropna().median() 61 | t2dm_medians = t2dm_summary[median_features].dropna().median() 62 | 63 | # 标准化数据 64 | scaler_time_series = StandardScaler() 65 | scaler_static = StandardScaler() 66 | scaler_target = StandardScaler() 67 | 68 | # 定义时间步长 69 | time_steps = 15 70 | 71 | import numpy as np 72 | import pandas as pd 73 | 74 | def create_sequences(patient_id, patient_data, static_data, time_series_features, static_features, target, time_steps): 75 | sequences = [] 76 | targets = [] 77 | static = static_data[static_features].values[0] 78 | 79 | # 填充静态数据中的 NaN 值 80 | if pd.isna(static).sum() > 0: 81 | nan_indices = np.where(pd.isna(static))[0] 82 | for idx in nan_indices: 83 | feature_name = static_features[idx] 84 | static[idx] = t1dm_medians[feature_name] 85 | #print(f"NaN values in static features {nan_indices} for patient {patient_id} filled with mean") 86 | 87 | for i in range(len(patient_data) - time_steps): 88 | seq = patient_data.iloc[i:i + time_steps][time_series_features].values 89 | label = patient_data.iloc[i + time_steps][target] 90 | 91 | # 填充时间序列数据中的 NaN 值 92 | if np.isnan(seq).sum() > 0: 93 | nan_indices = np.where(np.isnan(seq)) 94 | for row, col in zip(*nan_indices): 95 | feature_name = time_series_features[col] 96 | seq[row, col] = patient_data[feature_name].dropna().median() 97 | #print(f"NaN values in time series features at index {i} for patient {patient_id} filled with mean") 98 | 99 | # 填充目标数据中的 NaN 值 100 | if np.isnan(label): 101 | label = patient_data[target].mean() 102 | #print(f"NaN value in target at index {i + time_steps} for patient {patient_id} filled with mean") 103 | sequences.append((seq, static)) 104 | targets.append(label) 105 | return sequences, targets 106 | 107 | def build_model(time_steps, time_series_features, static_features): 108 | input_time_series = Input(shape=(time_steps, len(time_series_features))) 109 | input_static = Input(shape=(len(static_features),)) 110 | 111 | # LSTM层 112 | lstm_out = LSTM(units=256, return_sequences=True, kernel_initializer=HeNormal())(input_time_series) 113 | lstm_out = BatchNormalization()(lstm_out) 114 | lstm_out = Dropout(0.4)(lstm_out) 115 | lstm_out = LSTM(units=256, return_sequences=True, kernel_initializer=HeNormal())(lstm_out) 116 | lstm_out = BatchNormalization()(lstm_out) 117 | lstm_out = Dropout(0.4)(lstm_out) 118 | lstm_out = LSTM(units=128, kernel_initializer=HeNormal())(lstm_out) 119 | lstm_out = BatchNormalization()(lstm_out) 120 | lstm_out = Dropout(0.4)(lstm_out) 121 | 122 | concat = concatenate([lstm_out, input_static]) 123 | dense_out = Dense(512, activation='relu', kernel_initializer=GlorotUniform())(concat) 124 | dense_out = BatchNormalization()(dense_out) 125 | dense_out = Dropout(0.4)(dense_out) 126 | dense_out = Dense(256, activation='relu', kernel_initializer=GlorotUniform())(dense_out) 127 | dense_out = BatchNormalization()(dense_out) 128 | dense_out = Dropout(0.4)(dense_out) 129 | dense_out = Dense(128, activation='relu', kernel_initializer=GlorotUniform())(dense_out) 130 | dense_out = BatchNormalization()(dense_out) 131 | dense_out = Dropout(0.4)(dense_out) 132 | output = Dense(1, kernel_initializer=GlorotUniform())(dense_out) 133 | 134 | model = Model(inputs=[input_time_series, input_static], outputs=output) 135 | 136 | model.compile(optimizer=tf.keras.optimizers.AdamW(learning_rate=0.0001), loss='mean_squared_error', metrics=['mae']) 137 | 138 | return model 139 | 140 | # 构建模型 141 | model = build_model(time_steps, time_series_features, static_features) 142 | 143 | # 定义学习率调度器 144 | reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.5, patience=3, min_lr=0.0001) 145 | 146 | 147 | # 收集所有数据 148 | all_sequences = [] 149 | all_targets = [] 150 | 151 | # 处理一型糖尿病数据 152 | for file in t1dm_files: 153 | patient_id = os.path.basename(file).replace('.csv', '') 154 | patient_data = read_patient_data(file) 155 | static_data = t1dm_summary[t1dm_summary['patient_id'] == patient_id] 156 | 157 | if not static_data.empty: 158 | sequences, targets = create_sequences(patient_id,patient_data, static_data, time_series_features, static_features, 'CGM (mg / dl)', time_steps) 159 | all_sequences.extend(sequences) 160 | all_targets.extend(targets) 161 | 162 | # 处理二型糖尿病数据并训练模型 163 | for file in t2dm_files: 164 | patient_id = os.path.basename(file).replace('.csv', '') 165 | patient_data = read_patient_data(file) 166 | static_data = t2dm_summary[t2dm_summary['patient_id'] == patient_id] 167 | if not static_data.empty: 168 | sequences, targets = create_sequences(patient_id,patient_data, static_data, time_series_features, static_features, 'CGM (mg / dl)', time_steps) 169 | all_sequences.extend(sequences) 170 | all_targets.extend(targets) 171 | 172 | # 转换为numpy数组并标准化数据 173 | if all_sequences and all_targets: 174 | X_time_series = np.array([seq[0] for seq in all_sequences]) 175 | X_static = np.array([seq[1] for seq in all_sequences]) 176 | y = np.array(all_targets) 177 | # 178 | # # 标准化时间序列数据 179 | # X_time_series_reshaped = X_time_series.reshape(-1, X_time_series.shape[-1]) 180 | # X_time_series_scaled = scaler_time_series.fit_transform(X_time_series_reshaped) 181 | # X_time_series = X_time_series_scaled.reshape(X_time_series.shape) 182 | 183 | # 标准化静态数据 184 | X_static = scaler_static.fit_transform(X_static) 185 | 186 | df_X_static = pd.DataFrame(X_static) 187 | 188 | # Save the DataFrame to a CSV file 189 | df_X_static.to_csv('X_static.csv', index=False) 190 | 191 | 192 | 193 | # 创建一个新的索引数组用于确保静态数据和时间序列数据不会被打乱 194 | indices = np.arange(X_time_series.shape[0]) 195 | X_train_indices, X_test_indices, y_train_indices, y_test_indices = train_test_split( 196 | indices, indices, test_size=0.2, shuffle=True, random_state=42) 197 | 198 | # 使用索引进行训练和测试数据的划分 199 | X_train_time_series = X_time_series[X_train_indices] 200 | X_test_time_series = X_time_series[X_test_indices] 201 | X_train_static = X_static[X_train_indices] 202 | X_test_static = X_static[X_test_indices] 203 | y_train = y[X_train_indices] 204 | y_test = y[X_test_indices] 205 | 206 | # 打印训练和测试数据形状以调试 207 | print(f'X_train_time_series shape: {X_train_time_series.shape}') 208 | print(f'X_train_static shape: {X_train_static.shape}') 209 | print(f'X_test_time_series shape: {X_test_time_series.shape}') 210 | print(f'X_test_static shape: {X_test_static.shape}') 211 | print(f'y_train shape: {y_train.shape}') 212 | print(f'y_test shape: {y_test.shape}') 213 | 214 | 215 | # 自定义回调函数 216 | class PrintDetailedMAE(Callback): 217 | def __init__(self, val_data): 218 | super(PrintDetailedMAE, self).__init__() 219 | self.val_data = val_data 220 | 221 | def on_epoch_end(self, epoch, logs=None): 222 | val_time_series, val_static, val_labels = self.val_data 223 | predictions = self.model.predict([val_time_series, val_static]) 224 | absolute_error = np.abs(val_labels[0] - predictions[0]) 225 | print( 226 | f'Example 0: True Value = {val_labels[0]}, Predicted Value = {predictions[0]}, Absolute Error = {absolute_error}') 227 | 228 | # 使用tf.keras.metrics.MeanAbsoluteError计算MAE 229 | mae_metric = tf.keras.metrics.MeanAbsoluteError() 230 | mae_metric.update_state(val_labels, predictions) 231 | mae = mae_metric.result().numpy() 232 | print(f'Epoch {epoch + 1}: Validation MAE = {mae:.4f}') 233 | 234 | 235 | # 准备验证数据 236 | val_split = 0.2 237 | split_index = int((1 - val_split) * len(X_train_time_series)) 238 | 239 | # 验证数据 240 | X_val_time_series = X_train_time_series[split_index:] 241 | X_val_static = X_train_static[split_index:] 242 | y_val = y_train[split_index:] 243 | 244 | # 训练数据 245 | X_train_time_series = X_train_time_series[:split_index] 246 | X_train_static = X_train_static[:split_index] 247 | y_train = y_train[:split_index] 248 | 249 | # 创建并传递自定义回调函数 250 | print_detailed_mae_callback = PrintDetailedMAE((X_val_time_series, X_val_static, y_val)) 251 | 252 | # 训练模型 253 | history = model.fit( 254 | [X_train_time_series, X_train_static], y_train, 255 | epochs=50, batch_size=64, 256 | validation_data=([X_val_time_series, X_val_static], y_val), 257 | callbacks=[reduce_lr, print_detailed_mae_callback] 258 | ) 259 | 260 | # 评估模型 261 | y_pred = model.predict([X_test_time_series, X_test_static]) 262 | mse = mean_squared_error(y_test, y_pred) 263 | mae = mean_absolute_error(y_test, y_pred) 264 | 265 | # 打印评估结果 266 | print(f'Mean Squared Error (MSE): {mse}') 267 | print(f'Mean Absolute Error (MAE): {mae}') 268 | 269 | # 保存模型 270 | model.save('blood_glucose_prediction_model.h5') 271 | print("Model saved as 'blood_glucose_prediction_model.h5'") 272 | 273 | # 可视化训练过程中的损失和MAE 274 | plt.figure(figsize=(12, 6)) 275 | 276 | # 绘制训练和验证损失 277 | plt.subplot(1, 2, 1) 278 | plt.plot(history.history['loss'], label='Training Loss') 279 | plt.plot(history.history['val_loss'], label='Validation Loss') 280 | plt.xlabel('Epochs') 281 | plt.ylabel('Loss') 282 | plt.title('Training and Validation Loss') 283 | plt.legend() 284 | 285 | # 绘制训练和验证 MAE 286 | plt.subplot(1, 2, 2) 287 | plt.plot(history.history['mae'], label='Training MAE') 288 | plt.plot(history.history['val_mae'], label='Validation MAE') 289 | plt.xlabel('Epochs') 290 | plt.ylabel('MAE') 291 | plt.title('Training and Validation MAE') 292 | plt.legend() 293 | 294 | # 调整布局并保存图形 295 | plt.tight_layout() 296 | plt.savefig('training_validation_metrics.png') 297 | 298 | # 打印保存成功的消息 299 | print("Training and validation metrics plot saved as 'training_validation_metrics.png'") 300 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | ## 项目简介 4 | 5 | 本项目旨在使用长短期记忆网络(LSTM)预测糖尿病患者的血糖水平。我们通过训练一个多层LSTM模型来捕捉时间序列数据中的长时间依赖关系,并通过模型预测未来的血糖水平。 6 | 7 | ## 环境配置 8 | 9 | ### 硬件要求 10 | 11 | - CPU 或 GPU(推荐使用支持CUDA的NVIDIA GPU以加快训练速度) 12 | - 至少16GB内存 13 | 14 | ### 软件要求 15 | 16 | - 操作系统:Windows, macOS, 或 Linux 17 | - Python 版本:3.8或以上 18 | 19 | ### 依赖库 20 | 21 | - TensorFlow 2.x 22 | - NumPy 23 | - Pandas 24 | - Scikit-learn 25 | - Matplotlib 26 | - OpenPyXL (用于处理Excel文件) 27 | 28 | ### 安装依赖 29 | 30 | 可以使用 `pip` 安装所有依赖库: 31 | 32 | ```bash 33 | pip install tensorflow numpy pandas scikit-learn matplotlib openpyxl 34 | ``` 35 | 36 | ### 文件夹结构 37 | 38 | project_root/ 39 | ├── LSTM.py 40 | ├── predict.py 41 | ├── blood_glucose_prediction_model.h5 42 | ├── datasets_new/ 43 | │ ├── summary/ 44 | │ │ ├── Shanghai_T1DM_Summary0.xlsx 45 | │ │ └── Shanghai_T2DM_Summary0.xlsx 46 | │ ├── Shanghai_T1DM/ 47 | │ │ └── <患者数据文件1>.csv 48 | │ │ └── <患者数据文件2>.csv 49 | │ │ └── ... 50 | │ └── Shanghai_T2DM/ 51 | │ └── <患者数据文件1>.csv 52 | │ └── <患者数据文件2>.csv 53 | │ └── ... 54 | 55 | 56 | ### 运行步骤 57 | 58 | ```bash 59 | python LSTM.py 60 | python predict.py 61 | ``` -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1001_0_20210730.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1001_0_20210730.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1002_0_20210504.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1002_0_20210504.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1002_1_20210521.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1002_1_20210521.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1002_2_20210909.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1002_2_20210909.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1003_0_20210831.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1003_0_20210831.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1004_0_20210425.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1004_0_20210425.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1005_0_20210522.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1005_0_20210522.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1006_0_20210114.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1006_0_20210114.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1006_1_20210209.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1006_1_20210209.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1006_2_20210303.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1006_2_20210303.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1007_0_20210726.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1007_0_20210726.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1008_0_20210713.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1008_0_20210713.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1009_0_20210803.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1009_0_20210803.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1010_0_20210915.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1010_0_20210915.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1011_0_20210622.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1011_0_20210622.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1012_0_20210923.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T1DM_old/1012_0_20210923.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM/2032_0_20210727.csv: -------------------------------------------------------------------------------- 1 | Date,CGM (mg / dl),Insulin dose - s.c.,"CSII - bolus insulin (Novolin R, IU)","CSII - basal insulin (Novolin R, IU / H)",Carbohydrate/g 2 | 2021-07-27 16:21:00,97.2,0,0.0,0.5,0.0 3 | 2021-07-27 16:36:00,102.6,0,4.0,0.5,0.0 4 | 2021-07-27 16:51:00,108.0,0,0.0,0.5,0.0 5 | 2021-07-27 17:06:00,100.8,0,0.0,0.5,23.57 6 | 2021-07-27 17:21:00,109.8,0,0.0,0.5,0.0 7 | 2021-07-27 17:36:00,147.6,0,0.0,0.5,0.0 8 | 2021-07-27 17:51:00,178.2,0,0.0,0.5,0.0 9 | 2021-07-27 18:06:00,198.0,0,0.0,0.5,0.0 10 | 2021-07-27 18:21:00,208.8,0,0.0,0.5,0.0 11 | 2021-07-27 18:36:00,212.4,0,0.0,0.5,0.0 12 | 2021-07-27 18:51:00,201.6,0,0.0,0.5,0.0 13 | 2021-07-27 19:06:00,189.0,0,0.0,0.5,0.0 14 | 2021-07-27 19:21:00,189.0,0,0.0,0.5,0.0 15 | 2021-07-27 19:36:00,192.6,0,0.0,0.5,0.0 16 | 2021-07-27 19:51:00,205.2,0,0.0,0.3,0.0 17 | 2021-07-27 20:06:00,207.0,0,0.0,0.3,0.0 18 | 2021-07-27 20:21:00,185.4,0,0.0,0.3,0.0 19 | 2021-07-27 20:36:00,165.6,0,0.0,0.3,0.0 20 | 2021-07-27 20:51:00,167.4,0,0.0,0.3,0.0 21 | 2021-07-27 21:06:00,156.6,0,0.0,0.3,4.46 22 | 2021-07-27 21:21:00,129.6,0,0.0,0.3,0.0 23 | 2021-07-27 21:36:00,113.4,0,0.0,0.3,0.0 24 | 2021-07-27 21:51:00,127.8,0,0.0,0.3,0.0 25 | 2021-07-27 22:06:00,160.2,0,0.0,0.3,0.0 26 | 2021-07-27 22:21:00,181.8,0,0.0,0.3,0.0 27 | 2021-07-27 22:36:00,183.6,0,0.0,0.3,0.0 28 | 2021-07-27 22:51:00,190.8,0,0.0,0.3,0.0 29 | 2021-07-27 23:06:00,192.6,0,0.0,0.3,0.0 30 | 2021-07-27 23:21:00,174.6,0,0.0,0.3,0.0 31 | 2021-07-27 23:36:00,162.0,0,0.0,0.3,0.0 32 | 2021-07-27 23:51:00,154.8,0,0.0,0.3,0.0 33 | 2021-07-28 00:06:00,138.6,0,0.0,0.3,0.0 34 | 2021-07-28 00:21:00,122.4,0,0.0,0.3,0.0 35 | 2021-07-28 00:36:00,111.6,0,0.0,0.3,0.0 36 | 2021-07-28 00:51:00,111.6,0,0.0,0.3,0.0 37 | 2021-07-28 01:06:00,118.8,0,0.0,0.3,0.0 38 | 2021-07-28 01:21:00,115.2,0,0.0,0.3,0.0 39 | 2021-07-28 01:36:00,111.6,0,0.0,0.3,0.0 40 | 2021-07-28 01:51:00,104.4,0,0.0,0.3,0.0 41 | 2021-07-28 02:06:00,93.6,0,0.0,0.3,0.0 42 | 2021-07-28 02:21:00,102.6,0,0.0,0.3,0.0 43 | 2021-07-28 02:36:00,120.6,0,0.0,0.3,0.0 44 | 2021-07-28 02:51:00,120.6,0,0.0,0.5,0.0 45 | 2021-07-28 03:06:00,120.6,0,0.0,0.5,0.0 46 | 2021-07-28 03:21:00,149.4,0,0.0,0.5,0.0 47 | 2021-07-28 03:36:00,149.4,0,0.0,0.5,0.0 48 | 2021-07-28 03:51:00,142.2,0,0.0,0.5,0.0 49 | 2021-07-28 04:06:00,133.2,0,0.0,0.5,0.0 50 | 2021-07-28 04:21:00,129.6,0,0.0,0.5,0.0 51 | 2021-07-28 04:36:00,144.0,0,0.0,0.5,0.0 52 | 2021-07-28 04:51:00,145.8,0,0.0,0.5,0.0 53 | 2021-07-28 05:06:00,133.2,0,0.0,0.5,0.0 54 | 2021-07-28 05:21:00,133.2,0,0.0,0.5,0.0 55 | 2021-07-28 05:36:00,138.6,0,0.0,0.5,0.0 56 | 2021-07-28 05:51:00,136.8,0,0.0,0.5,0.0 57 | 2021-07-28 06:06:00,136.8,0,0.0,0.5,0.0 58 | 2021-07-28 06:21:00,138.6,0,0.0,0.5,0.0 59 | 2021-07-28 06:36:00,140.4,0,6.0,0.5,0.0 60 | 2021-07-28 06:51:00,136.8,0,0.0,0.5,0.0 61 | 2021-07-28 07:06:00,133.2,0,0.0,0.5,83.65 62 | 2021-07-28 07:21:00,153.0,0,0.0,0.5,0.0 63 | 2021-07-28 07:36:00,194.4,0,0.0,0.5,0.0 64 | 2021-07-28 07:51:00,219.6,0,0.0,0.5,0.0 65 | 2021-07-28 08:06:00,239.4,0,0.0,0.5,0.0 66 | 2021-07-28 08:21:00,277.2,0,0.0,0.5,0.0 67 | 2021-07-28 08:36:00,297.0,0,0.0,0.5,0.0 68 | 2021-07-28 08:51:00,279.0,0,0.0,0.5,0.0 69 | 2021-07-28 09:06:00,250.2,0,3.0,0.5,0.0 70 | 2021-07-28 09:21:00,230.4,0,0.0,0.5,0.0 71 | 2021-07-28 09:36:00,216.0,0,0.0,0.5,0.0 72 | 2021-07-28 09:51:00,196.2,0,0.0,0.5,0.0 73 | 2021-07-28 10:06:00,174.6,0,0.0,0.5,0.0 74 | 2021-07-28 10:21:00,149.4,0,0.0,0.5,0.0 75 | 2021-07-28 10:36:00,129.6,0,4.0,0.5,0.0 76 | 2021-07-28 10:51:00,113.4,0,0.0,0.5,0.0 77 | 2021-07-28 11:06:00,99.0,0,0.0,0.5,75.19999999999999 78 | 2021-07-28 11:21:00,79.2,0,0.0,0.5,0.0 79 | 2021-07-28 11:36:00,95.4,0,0.0,0.5,0.0 80 | 2021-07-28 11:51:00,154.8,0,0.0,0.5,0.0 81 | 2021-07-28 12:06:00,178.2,0,0.0,0.5,0.0 82 | 2021-07-28 12:21:00,169.2,0,0.0,0.5,0.0 83 | 2021-07-28 12:36:00,163.8,0,0.0,0.5,0.0 84 | 2021-07-28 12:51:00,156.6,0,0.0,0.5,0.0 85 | 2021-07-28 13:06:00,156.6,0,0.0,0.5,0.0 86 | 2021-07-28 13:21:00,149.4,0,0.0,0.5,0.0 87 | 2021-07-28 13:36:00,133.2,0,0.0,0.5,0.0 88 | 2021-07-28 13:51:00,120.6,0,0.0,0.5,0.0 89 | 2021-07-28 14:06:00,109.8,0,0.0,0.5,0.0 90 | 2021-07-28 14:21:00,93.6,0,0.0,0.5,0.0 91 | 2021-07-28 14:36:00,81.0,0,0.0,0.5,0.0 92 | 2021-07-28 14:51:00,79.2,0,0.0,0.5,0.0 93 | 2021-07-28 15:06:00,79.2,0,0.0,0.5,0.0 94 | 2021-07-28 15:21:00,84.6,0,0.0,0.5,0.0 95 | 2021-07-28 15:36:00,100.8,0,0.0,0.5,0.0 96 | 2021-07-28 15:51:00,131.4,0,0.0,0.5,0.0 97 | 2021-07-28 16:06:00,169.2,0,0.0,0.5,0.0 98 | 2021-07-28 16:21:00,198.0,0,0.0,0.5,0.0 99 | 2021-07-28 16:36:00,205.2,0,4.0,0.5,0.0 100 | 2021-07-28 16:51:00,203.4,0,0.0,0.5,0.0 101 | 2021-07-28 17:06:00,199.8,0,0.0,0.5,49.09 102 | 2021-07-28 17:21:00,190.8,0,0.0,0.5,0.0 103 | 2021-07-28 17:36:00,183.6,0,0.0,0.5,0.0 104 | 2021-07-28 17:51:00,176.4,0,0.0,0.5,0.0 105 | 2021-07-28 18:06:00,187.2,0,0.0,0.5,0.0 106 | 2021-07-28 18:21:00,221.4,0,0.0,0.5,0.0 107 | 2021-07-28 18:36:00,248.4,0,0.0,0.5,0.0 108 | 2021-07-28 18:51:00,255.6,0,0.0,0.5,0.0 109 | 2021-07-28 19:06:00,246.6,0,0.0,0.5,0.0 110 | 2021-07-28 19:21:00,250.2,0,0.0,0.5,0.0 111 | 2021-07-28 19:36:00,261.0,0,0.0,0.5,0.0 112 | 2021-07-28 19:51:00,255.6,0,0.0,0.3,0.0 113 | 2021-07-28 20:06:00,241.2,0,0.0,0.3,0.0 114 | 2021-07-28 20:21:00,228.6,0,0.0,0.3,0.0 115 | 2021-07-28 20:36:00,219.6,0,0.0,0.3,0.0 116 | 2021-07-28 20:51:00,216.0,0,0.0,0.3,0.0 117 | 2021-07-28 21:06:00,208.8,0,0.0,0.3,6.69 118 | 2021-07-28 21:21:00,198.0,0,0.0,0.3,0.0 119 | 2021-07-28 21:36:00,178.2,0,0.0,0.3,0.0 120 | 2021-07-28 21:51:00,153.0,0,0.0,0.3,0.0 121 | 2021-07-28 22:06:00,142.2,0,0.0,0.3,0.0 122 | 2021-07-28 22:21:00,142.2,0,0.0,0.3,0.0 123 | 2021-07-28 22:36:00,129.6,0,0.0,0.3,0.0 124 | 2021-07-28 22:51:00,117.0,0,0.0,0.3,0.0 125 | 2021-07-28 23:06:00,113.4,0,0.0,0.3,0.0 126 | 2021-07-28 23:21:00,109.8,0,0.0,0.3,0.0 127 | 2021-07-28 23:36:00,97.2,0,0.0,0.3,0.0 128 | 2021-07-28 23:51:00,84.6,0,0.0,0.3,0.0 129 | 2021-07-29 00:06:00,81.0,0,0.0,0.3,0.0 130 | 2021-07-29 00:21:00,88.2,0,0.0,0.3,0.0 131 | 2021-07-29 00:36:00,93.6,0,0.0,0.3,0.0 132 | 2021-07-29 00:51:00,93.6,0,0.0,0.3,0.0 133 | 2021-07-29 01:06:00,86.4,0,0.0,0.3,0.0 134 | 2021-07-29 01:21:00,79.2,0,0.0,0.3,0.0 135 | 2021-07-29 01:36:00,86.4,0,0.0,0.3,0.0 136 | 2021-07-29 01:51:00,99.0,0,0.0,0.3,0.0 137 | 2021-07-29 02:06:00,102.6,0,0.0,0.3,0.0 138 | 2021-07-29 02:21:00,104.4,0,0.0,0.3,0.0 139 | 2021-07-29 02:36:00,106.2,0,0.0,0.3,0.0 140 | 2021-07-29 02:51:00,108.0,0,0.0,0.5,0.0 141 | 2021-07-29 03:06:00,109.8,0,0.0,0.5,0.0 142 | 2021-07-29 03:21:00,115.2,0,0.0,0.5,0.0 143 | 2021-07-29 03:36:00,115.2,0,0.0,0.5,0.0 144 | 2021-07-29 03:51:00,111.6,0,0.0,0.5,0.0 145 | 2021-07-29 04:06:00,115.2,0,0.0,0.5,0.0 146 | 2021-07-29 04:21:00,120.6,0,0.0,0.5,0.0 147 | 2021-07-29 04:36:00,111.6,0,0.0,0.5,0.0 148 | 2021-07-29 04:51:00,111.6,0,0.0,0.5,0.0 149 | 2021-07-29 05:06:00,122.4,0,0.0,0.5,0.0 150 | 2021-07-29 05:21:00,131.4,0,0.0,0.5,0.0 151 | 2021-07-29 05:36:00,129.6,0,0.0,0.5,0.0 152 | 2021-07-29 05:51:00,127.8,0,0.0,0.5,0.0 153 | 2021-07-29 06:06:00,133.2,0,0.0,0.5,0.0 154 | 2021-07-29 06:21:00,136.8,0,0.0,0.5,0.0 155 | 2021-07-29 06:36:00,129.6,0,8.0,0.5,0.0 156 | 2021-07-29 06:51:00,131.4,0,0.0,0.5,0.0 157 | 2021-07-29 07:06:00,138.6,0,0.0,0.5,83.17 158 | 2021-07-29 07:21:00,158.4,0,0.0,0.5,0.0 159 | 2021-07-29 07:36:00,205.2,0,0.0,0.5,0.0 160 | 2021-07-29 07:51:00,246.6,0,0.0,0.5,0.0 161 | 2021-07-29 08:06:00,273.6,0,0.0,0.5,0.0 162 | 2021-07-29 08:21:00,291.6,0,0.0,0.5,0.0 163 | 2021-07-29 08:36:00,289.8,0,0.0,0.5,0.0 164 | 2021-07-29 08:51:00,284.4,0,0.0,0.5,0.0 165 | 2021-07-29 09:06:00,273.6,0,0.0,0.5,0.0 166 | 2021-07-29 09:21:00,259.2,0,0.0,0.5,0.0 167 | 2021-07-29 09:36:00,244.8,0,0.0,0.5,0.0 168 | 2021-07-29 09:51:00,217.8,0,0.0,0.5,0.0 169 | 2021-07-29 10:06:00,205.2,0,0.0,0.5,0.0 170 | 2021-07-29 10:21:00,194.4,0,0.0,0.5,0.0 171 | 2021-07-29 10:36:00,167.4,0,4.0,0.5,0.0 172 | 2021-07-29 10:51:00,151.2,0,0.0,0.5,0.0 173 | 2021-07-29 11:06:00,144.0,0,0.0,0.5,57.36 174 | 2021-07-29 11:21:00,138.6,0,0.0,0.5,0.0 175 | 2021-07-29 11:36:00,154.8,0,0.0,0.5,0.0 176 | 2021-07-29 11:51:00,181.8,0,0.0,0.5,0.0 177 | 2021-07-29 12:06:00,187.2,0,0.0,0.5,0.0 178 | 2021-07-29 12:21:00,187.2,0,0.0,0.5,0.0 179 | 2021-07-29 12:36:00,192.6,0,0.0,0.5,0.0 180 | 2021-07-29 12:51:00,190.8,0,0.0,0.5,0.0 181 | 2021-07-29 13:06:00,192.6,0,0.0,0.5,0.0 182 | 2021-07-29 13:21:00,199.8,0,0.0,0.5,0.0 183 | 2021-07-29 13:36:00,187.2,0,0.0,0.5,0.0 184 | 2021-07-29 13:51:00,172.8,0,0.0,0.5,0.0 185 | 2021-07-29 14:06:00,154.8,0,0.0,0.5,0.0 186 | 2021-07-29 14:21:00,129.6,0,0.0,0.5,0.0 187 | 2021-07-29 14:36:00,120.6,0,0.0,0.5,0.0 188 | 2021-07-29 14:51:00,124.2,0,0.0,0.5,0.0 189 | 2021-07-29 15:06:00,126.0,0,0.0,0.5,0.0 190 | 2021-07-29 15:21:00,126.0,0,0.0,0.5,0.0 191 | 2021-07-29 15:36:00,122.4,0,0.0,0.5,0.0 192 | 2021-07-29 15:51:00,124.2,0,0.0,0.5,0.0 193 | 2021-07-29 16:06:00,122.4,0,0.0,0.5,0.0 194 | 2021-07-29 16:21:00,111.6,0,0.0,0.5,0.0 195 | 2021-07-29 16:36:00,102.6,9,0.0,0.5,0.0 196 | 2021-07-29 16:51:00,102.6,0,0.0,0.5,0.0 197 | 2021-07-29 17:06:00,109.8,0,0.0,0.5,53.225 198 | 2021-07-29 17:21:00,142.2,0,0.0,0.5,0.0 199 | 2021-07-29 17:36:00,174.6,0,0.0,0.5,0.0 200 | 2021-07-29 17:51:00,158.4,0,0.0,0.5,0.0 201 | 2021-07-29 18:06:00,142.2,0,0.0,0.5,0.0 202 | 2021-07-29 18:21:00,142.2,0,0.0,0.5,0.0 203 | 2021-07-29 18:36:00,142.2,0,0.0,0.5,0.0 204 | 2021-07-29 18:51:00,136.8,0,0.0,0.5,0.0 205 | 2021-07-29 19:06:00,124.2,0,0.0,0.5,0.0 206 | 2021-07-29 19:21:00,118.8,0,0.0,0.5,0.0 207 | 2021-07-29 19:36:00,120.6,0,0.0,0.5,0.0 208 | 2021-07-29 19:51:00,118.8,0,0.0,0.5,0.0 209 | 2021-07-29 20:06:00,118.8,0,0.0,0.5,0.0 210 | 2021-07-29 20:21:00,122.4,0,0.0,0.5,0.0 211 | 2021-07-29 20:36:00,138.6,0,0.0,0.5,0.0 212 | 2021-07-29 20:51:00,153.0,0,0.0,0.5,0.0 213 | 2021-07-29 21:06:00,156.6,0,0.0,0.5,0.0 214 | 2021-07-29 21:21:00,169.2,0,0.0,0.5,0.0 215 | 2021-07-29 21:36:00,194.4,0,0.0,0.5,0.0 216 | 2021-07-29 21:51:00,217.8,0,0.0,0.5,0.0 217 | 2021-07-29 22:06:00,226.8,0,0.0,0.5,0.0 218 | 2021-07-29 22:21:00,225.0,0,0.0,0.5,0.0 219 | 2021-07-29 22:36:00,217.8,0,0.0,0.5,0.0 220 | 2021-07-29 22:51:00,212.4,0,0.0,0.5,0.0 221 | 2021-07-29 23:06:00,205.2,0,0.0,0.5,0.0 222 | 2021-07-29 23:21:00,192.6,0,0.0,0.5,0.0 223 | 2021-07-29 23:36:00,194.4,0,0.0,0.5,0.0 224 | 2021-07-29 23:51:00,201.6,0,0.0,0.5,0.0 225 | 2021-07-30 00:06:00,192.6,0,0.0,0.5,0.0 226 | 2021-07-30 00:21:00,181.8,0,0.0,0.5,0.0 227 | 2021-07-30 00:36:00,176.4,0,0.0,0.5,0.0 228 | 2021-07-30 00:51:00,167.4,0,0.0,0.5,0.0 229 | 2021-07-30 01:06:00,149.4,0,0.0,0.5,0.0 230 | 2021-07-30 01:21:00,133.2,0,0.0,0.5,0.0 231 | 2021-07-30 01:36:00,127.8,0,0.0,0.5,0.0 232 | 2021-07-30 01:51:00,124.2,0,0.0,0.5,0.0 233 | 2021-07-30 02:06:00,122.4,0,0.0,0.5,0.0 234 | 2021-07-30 02:21:00,118.8,0,0.0,0.5,0.0 235 | 2021-07-30 02:36:00,117.0,0,0.0,0.5,0.0 236 | 2021-07-30 02:51:00,120.6,0,0.0,0.5,0.0 237 | 2021-07-30 03:06:00,122.4,0,0.0,0.5,0.0 238 | 2021-07-30 03:21:00,113.4,0,0.0,0.5,0.0 239 | 2021-07-30 03:36:00,106.2,0,0.0,0.5,0.0 240 | 2021-07-30 03:51:00,120.6,0,0.0,0.5,0.0 241 | 2021-07-30 04:06:00,140.4,0,0.0,0.5,0.0 242 | 2021-07-30 04:21:00,133.2,0,0.0,0.5,0.0 243 | 2021-07-30 04:36:00,124.2,0,0.0,0.5,0.0 244 | 2021-07-30 04:51:00,126.0,0,0.0,0.5,0.0 245 | 2021-07-30 05:06:00,129.6,0,0.0,0.5,0.0 246 | 2021-07-30 05:21:00,136.8,0,0.0,0.5,0.0 247 | 2021-07-30 05:36:00,136.8,0,0.0,0.5,0.0 248 | 2021-07-30 05:51:00,138.6,0,0.0,0.5,0.0 249 | 2021-07-30 06:06:00,145.8,0,0.0,0.5,0.0 250 | 2021-07-30 06:21:00,151.2,0,0.0,0.5,0.0 251 | 2021-07-30 06:36:00,156.6,0,0.0,0.5,0.0 252 | 2021-07-30 06:51:00,156.6,17,0.0,0.5,0.0 253 | 2021-07-30 07:06:00,147.6,0,0.0,0.5,53.225 254 | 2021-07-30 07:21:00,144.0,0,0.0,0.5,0.0 255 | 2021-07-30 07:36:00,154.8,0,0.0,0.5,0.0 256 | 2021-07-30 07:51:00,172.8,0,0.0,0.5,0.0 257 | 2021-07-30 08:06:00,198.0,0,0.0,0.5,0.0 258 | 2021-07-30 08:21:00,216.0,0,0.0,0.5,0.0 259 | 2021-07-30 08:36:00,219.6,0,0.0,0.5,0.0 260 | 2021-07-30 08:51:00,214.2,0,0.0,0.5,0.0 261 | 2021-07-30 09:06:00,203.4,0,0.0,0.5,0.0 262 | 2021-07-30 09:21:00,192.6,0,0.0,0.5,0.0 263 | 2021-07-30 09:36:00,178.2,0,0.0,0.5,0.0 264 | 2021-07-30 09:51:00,163.8,0,0.0,0.5,0.0 265 | 2021-07-30 10:06:00,151.2,0,0.0,0.5,0.0 266 | 2021-07-30 10:21:00,142.2,0,0.0,0.5,0.0 267 | 2021-07-30 10:36:00,138.6,0,0.0,0.5,0.0 268 | 2021-07-30 10:51:00,131.4,0,0.0,0.5,0.0 269 | 2021-07-30 11:06:00,117.0,0,0.0,0.5,53.225 270 | 2021-07-30 11:21:00,109.8,0,0.0,0.5,0.0 271 | 2021-07-30 11:36:00,131.4,0,0.0,0.5,0.0 272 | 2021-07-30 11:51:00,165.6,0,0.0,0.5,0.0 273 | 2021-07-30 12:06:00,181.8,0,0.0,0.5,0.0 274 | 2021-07-30 12:21:00,176.4,0,0.0,0.5,0.0 275 | 2021-07-30 12:36:00,165.6,0,0.0,0.5,0.0 276 | 2021-07-30 12:51:00,167.4,0,0.0,0.5,0.0 277 | 2021-07-30 13:06:00,174.6,0,0.0,0.5,0.0 278 | 2021-07-30 13:21:00,176.4,0,0.0,0.5,0.0 279 | 2021-07-30 13:36:00,176.4,0,0.0,0.5,0.0 280 | 2021-07-30 13:51:00,167.4,0,0.0,0.5,0.0 281 | 2021-07-30 14:06:00,158.4,0,0.0,0.5,0.0 282 | 2021-07-30 14:21:00,153.0,0,0.0,0.5,0.0 283 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM/2035_0_20210629.csv: -------------------------------------------------------------------------------- 1 | Date,CGM (mg / dl),Insulin dose - s.c.,"CSII - bolus insulin (Novolin R, IU)","CSII - basal insulin (Novolin R, IU / H)",Carbohydrate/g 2 | 2021-06-29 17:04:00,142.2,0,0.0,0.6,77.285 3 | 2021-06-29 17:19:00,158.4,0,0.0,0.6,0.0 4 | 2021-06-29 17:34:00,172.8,0,0.0,0.6,0.0 5 | 2021-06-29 17:49:00,172.8,0,0.0,0.6,0.0 6 | 2021-06-29 18:04:00,172.8,0,0.0,0.6,0.0 7 | 2021-06-29 18:19:00,172.8,0,0.0,0.6,0.0 8 | 2021-06-29 18:34:00,172.8,0,0.0,0.6,0.0 9 | 2021-06-29 18:49:00,165.6,0,0.0,0.6,0.0 10 | 2021-06-29 19:04:00,153.0,0,0.0,0.6,0.0 11 | 2021-06-29 19:19:00,149.4,0,0.0,0.6,0.0 12 | 2021-06-29 19:34:00,149.4,0,0.0,0.6,0.0 13 | 2021-06-29 19:49:00,153.0,0,0.0,0.6,0.0 14 | 2021-06-29 20:04:00,145.8,0,0.0,0.5,0.0 15 | 2021-06-29 20:19:00,126.0,0,0.0,0.5,0.0 16 | 2021-06-29 20:34:00,127.8,0,0.0,0.5,0.0 17 | 2021-06-29 20:49:00,131.4,0,0.0,0.5,0.0 18 | 2021-06-29 21:04:00,127.8,0,0.0,0.5,0.0 19 | 2021-06-29 21:19:00,115.2,0,0.0,0.5,0.0 20 | 2021-06-29 21:34:00,104.4,0,0.0,0.5,0.0 21 | 2021-06-29 21:49:00,97.2,0,0.0,0.5,0.0 22 | 2021-06-29 22:04:00,91.8,0,0.0,0.5,0.0 23 | 2021-06-29 22:19:00,93.6,0,0.0,0.5,0.0 24 | 2021-06-29 22:34:00,100.8,0,0.0,0.5,0.0 25 | 2021-06-29 22:49:00,97.2,0,0.0,0.5,0.0 26 | 2021-06-29 23:04:00,91.8,0,0.0,0.5,0.0 27 | 2021-06-29 23:19:00,88.2,0,0.0,0.5,0.0 28 | 2021-06-29 23:34:00,82.8,0,0.0,0.5,0.0 29 | 2021-06-29 23:49:00,79.2,0,0.0,0.5,0.0 30 | 2021-06-30 00:04:00,79.2,0,0.0,0.4,0.0 31 | 2021-06-30 00:19:00,79.2,0,0.0,0.4,0.0 32 | 2021-06-30 00:34:00,66.6,0,0.0,0.4,0.0 33 | 2021-06-30 00:49:00,59.4,0,0.0,0.4,0.0 34 | 2021-06-30 01:04:00,57.6,0,0.0,0.4,0.0 35 | 2021-06-30 01:19:00,66.6,0,0.0,0.4,0.0 36 | 2021-06-30 01:34:00,77.4,0,0.0,0.4,0.0 37 | 2021-06-30 01:49:00,82.8,0,0.0,0.4,0.0 38 | 2021-06-30 02:04:00,91.8,0,0.0,0.4,0.0 39 | 2021-06-30 02:19:00,100.8,0,0.0,0.4,0.0 40 | 2021-06-30 02:34:00,102.6,0,0.0,0.4,0.0 41 | 2021-06-30 02:49:00,102.6,0,0.0,0.4,0.0 42 | 2021-06-30 03:04:00,99.0,0,0.0,0.7,0.0 43 | 2021-06-30 03:19:00,91.8,0,0.0,0.7,0.0 44 | 2021-06-30 03:34:00,97.2,0,0.0,0.7,0.0 45 | 2021-06-30 03:49:00,102.6,0,0.0,0.7,0.0 46 | 2021-06-30 04:04:00,95.4,0,0.0,0.7,0.0 47 | 2021-06-30 04:19:00,97.2,0,0.0,0.7,0.0 48 | 2021-06-30 04:34:00,104.4,0,0.0,0.7,0.0 49 | 2021-06-30 04:49:00,108.0,0,0.0,0.7,0.0 50 | 2021-06-30 05:04:00,102.6,0,0.0,0.7,0.0 51 | 2021-06-30 05:19:00,95.4,0,0.0,0.7,0.0 52 | 2021-06-30 05:34:00,106.2,0,0.0,0.7,0.0 53 | 2021-06-30 05:49:00,113.4,0,0.0,0.7,0.0 54 | 2021-06-30 06:04:00,115.2,0,0.0,0.7,0.0 55 | 2021-06-30 06:19:00,115.2,0,0.0,0.7,0.0 56 | 2021-06-30 06:34:00,111.6,0,12.0,0.7,0.0 57 | 2021-06-30 06:49:00,115.2,0,0.0,0.7,0.0 58 | 2021-06-30 07:04:00,117.0,0,0.0,0.7,81.19 59 | 2021-06-30 07:19:00,113.4,0,0.0,0.7,0.0 60 | 2021-06-30 07:34:00,115.2,0,0.0,0.7,0.0 61 | 2021-06-30 07:49:00,122.4,0,0.0,0.7,0.0 62 | 2021-06-30 08:04:00,135.0,0,0.0,0.6,0.0 63 | 2021-06-30 08:19:00,142.2,0,0.0,0.6,0.0 64 | 2021-06-30 08:34:00,151.2,0,0.0,0.6,0.0 65 | 2021-06-30 08:49:00,165.6,0,0.0,0.6,0.0 66 | 2021-06-30 09:04:00,174.6,0,0.0,0.6,0.0 67 | 2021-06-30 09:19:00,176.4,0,0.0,0.6,0.0 68 | 2021-06-30 09:34:00,172.8,0,0.0,0.6,0.0 69 | 2021-06-30 09:49:00,174.6,0,0.0,0.6,0.0 70 | 2021-06-30 10:04:00,180.0,0,0.0,0.6,0.0 71 | 2021-06-30 10:19:00,183.6,0,0.0,0.6,0.0 72 | 2021-06-30 10:34:00,180.0,0,0.0,0.6,0.0 73 | 2021-06-30 10:49:00,180.0,6,0.0,0.6,0.0 74 | 2021-06-30 11:04:00,178.2,0,0.0,0.6,73.38 75 | 2021-06-30 11:19:00,176.4,0,0.0,0.6,0.0 76 | 2021-06-30 11:34:00,181.8,0,0.0,0.6,0.0 77 | 2021-06-30 11:49:00,171.0,0,0.0,0.6,0.0 78 | 2021-06-30 12:04:00,147.6,0,0.0,0.6,0.0 79 | 2021-06-30 12:19:00,127.8,0,0.0,0.6,0.0 80 | 2021-06-30 12:34:00,111.6,0,0.0,0.6,0.0 81 | 2021-06-30 12:49:00,100.8,0,0.0,0.6,0.0 82 | 2021-06-30 13:04:00,91.8,0,0.0,0.6,0.0 83 | 2021-06-30 13:19:00,86.4,0,0.0,0.6,0.0 84 | 2021-06-30 13:34:00,79.2,0,0.0,0.6,0.0 85 | 2021-06-30 13:49:00,70.2,0,0.0,0.6,0.0 86 | 2021-06-30 14:04:00,66.6,0,0.0,0.6,0.0 87 | 2021-06-30 14:19:00,68.4,0,0.0,0.6,0.0 88 | 2021-06-30 14:34:00,72.0,0,0.0,0.6,0.0 89 | 2021-06-30 14:49:00,75.6,0,0.0,0.6,0.0 90 | 2021-06-30 15:04:00,73.8,0,0.0,0.6,0.0 91 | 2021-06-30 15:19:00,77.4,0,0.0,0.6,0.0 92 | 2021-06-30 15:34:00,82.8,0,0.0,0.6,0.0 93 | 2021-06-30 15:49:00,84.6,0,0.0,0.6,0.0 94 | 2021-06-30 16:04:00,90.0,0,0.0,0.6,0.0 95 | 2021-06-30 16:19:00,91.8,0,0.0,0.6,0.0 96 | 2021-06-30 16:34:00,95.4,0,0.0,0.6,0.0 97 | 2021-06-30 16:49:00,97.2,6,0.0,0.6,0.0 98 | 2021-06-30 17:04:00,100.8,0,0.0,0.6,77.285 99 | 2021-06-30 17:19:00,111.6,0,0.0,0.6,0.0 100 | 2021-06-30 17:34:00,122.4,0,0.0,0.6,0.0 101 | 2021-06-30 17:49:00,127.8,0,0.0,0.6,0.0 102 | 2021-06-30 18:04:00,133.2,0,0.0,0.6,0.0 103 | 2021-06-30 18:19:00,133.2,0,0.0,0.6,0.0 104 | 2021-06-30 18:34:00,126.0,0,0.0,0.6,0.0 105 | 2021-06-30 18:49:00,122.4,0,0.0,0.6,0.0 106 | 2021-06-30 19:04:00,124.2,0,0.0,0.6,0.0 107 | 2021-06-30 19:19:00,122.4,0,0.0,0.6,0.0 108 | 2021-06-30 19:34:00,120.6,0,0.0,0.6,0.0 109 | 2021-06-30 19:49:00,115.2,0,0.0,0.6,0.0 110 | 2021-06-30 20:04:00,115.2,0,0.0,0.6,0.0 111 | 2021-06-30 20:19:00,108.0,0,0.0,0.6,0.0 112 | 2021-06-30 20:34:00,97.2,0,0.0,0.6,0.0 113 | 2021-06-30 20:49:00,99.0,0,0.0,0.6,0.0 114 | 2021-06-30 21:04:00,104.4,16,0.0,0.6,0.0 115 | 2021-06-30 21:19:00,102.6,0,0.0,0.6,0.0 116 | 2021-06-30 21:34:00,99.0,0,0.0,0.6,0.0 117 | 2021-06-30 21:49:00,97.2,0,0.0,0.6,0.0 118 | 2021-06-30 22:04:00,102.6,0,0.0,0.6,0.0 119 | 2021-06-30 22:19:00,109.8,0,0.0,0.6,0.0 120 | 2021-06-30 22:34:00,115.2,0,0.0,0.6,0.0 121 | 2021-06-30 22:49:00,115.2,0,0.0,0.6,0.0 122 | 2021-06-30 23:04:00,113.4,0,0.0,0.6,0.0 123 | 2021-06-30 23:19:00,122.4,0,0.0,0.6,0.0 124 | 2021-06-30 23:34:00,120.6,0,0.0,0.6,0.0 125 | 2021-06-30 23:49:00,106.2,0,0.0,0.6,0.0 126 | 2021-07-01 00:04:00,113.4,0,0.0,0.6,0.0 127 | 2021-07-01 00:19:00,124.2,0,0.0,0.6,0.0 128 | 2021-07-01 00:34:00,120.6,0,0.0,0.6,0.0 129 | 2021-07-01 00:49:00,111.6,0,0.0,0.6,0.0 130 | 2021-07-01 01:04:00,113.4,0,0.0,0.6,0.0 131 | 2021-07-01 01:19:00,118.8,0,0.0,0.6,0.0 132 | 2021-07-01 01:34:00,122.4,0,0.0,0.6,0.0 133 | 2021-07-01 01:49:00,124.2,0,0.0,0.6,0.0 134 | 2021-07-01 02:04:00,131.4,0,0.0,0.6,0.0 135 | 2021-07-01 02:19:00,135.0,0,0.0,0.6,0.0 136 | 2021-07-01 02:34:00,129.6,0,0.0,0.6,0.0 137 | 2021-07-01 02:49:00,129.6,0,0.0,0.6,0.0 138 | 2021-07-01 03:04:00,133.2,0,0.0,0.6,0.0 139 | 2021-07-01 03:19:00,138.6,0,0.0,0.6,0.0 140 | 2021-07-01 03:34:00,144.0,0,0.0,0.6,0.0 141 | 2021-07-01 03:49:00,140.4,0,0.0,0.6,0.0 142 | 2021-07-01 04:04:00,138.6,0,0.0,0.6,0.0 143 | 2021-07-01 04:19:00,133.2,0,0.0,0.6,0.0 144 | 2021-07-01 04:34:00,133.2,0,0.0,0.6,0.0 145 | 2021-07-01 04:49:00,133.2,0,0.0,0.6,0.0 146 | 2021-07-01 05:04:00,136.8,0,0.0,0.6,0.0 147 | 2021-07-01 05:19:00,136.8,0,0.0,0.6,0.0 148 | 2021-07-01 05:34:00,136.8,0,0.0,0.6,0.0 149 | 2021-07-01 05:49:00,138.6,0,0.0,0.6,0.0 150 | 2021-07-01 06:04:00,142.2,0,0.0,0.6,0.0 151 | 2021-07-01 06:19:00,140.4,0,0.0,0.6,0.0 152 | 2021-07-01 06:34:00,136.8,0,0.0,0.6,0.0 153 | 2021-07-01 06:49:00,136.8,13,0.0,0.6,0.0 154 | 2021-07-01 07:04:00,135.0,0,0.0,0.6,77.285 155 | 2021-07-01 07:19:00,138.6,0,0.0,0.6,0.0 156 | 2021-07-01 07:34:00,142.2,0,0.0,0.6,0.0 157 | 2021-07-01 07:49:00,149.4,0,0.0,0.6,0.0 158 | 2021-07-01 08:04:00,154.8,0,0.0,0.6,0.0 159 | 2021-07-01 08:19:00,153.0,0,0.0,0.6,0.0 160 | 2021-07-01 08:34:00,149.4,0,0.0,0.6,0.0 161 | 2021-07-01 08:49:00,142.2,0,0.0,0.6,0.0 162 | 2021-07-01 09:04:00,131.4,0,0.0,0.6,0.0 163 | 2021-07-01 09:19:00,124.2,0,0.0,0.6,0.0 164 | 2021-07-01 09:34:00,118.8,0,0.0,0.6,0.0 165 | 2021-07-01 09:49:00,115.2,0,0.0,0.6,0.0 166 | 2021-07-01 10:04:00,118.8,0,0.0,0.6,0.0 167 | 2021-07-01 10:19:00,120.6,0,0.0,0.6,0.0 168 | 2021-07-01 10:34:00,124.2,0,0.0,0.6,0.0 169 | 2021-07-01 10:49:00,129.6,6,0.0,0.6,0.0 170 | 2021-07-01 11:04:00,129.6,0,0.0,0.6,77.285 171 | 2021-07-01 11:19:00,136.8,0,0.0,0.6,0.0 172 | 2021-07-01 11:34:00,145.8,0,0.0,0.6,0.0 173 | 2021-07-01 11:49:00,144.0,0,0.0,0.6,0.0 174 | 2021-07-01 12:04:00,129.6,0,0.0,0.6,0.0 175 | 2021-07-01 12:19:00,113.4,0,0.0,0.6,0.0 176 | 2021-07-01 12:34:00,102.6,0,0.0,0.6,0.0 177 | 2021-07-01 12:49:00,95.4,0,0.0,0.6,0.0 178 | 2021-07-01 13:04:00,90.0,0,0.0,0.6,0.0 179 | 2021-07-01 13:19:00,82.8,0,0.0,0.6,0.0 180 | 2021-07-01 13:34:00,75.6,0,0.0,0.6,0.0 181 | 2021-07-01 13:49:00,72.0,0,0.0,0.6,0.0 182 | 2021-07-01 14:04:00,72.0,0,0.0,0.6,0.0 183 | 2021-07-01 14:19:00,73.8,0,0.0,0.6,0.0 184 | 2021-07-01 14:34:00,81.0,0,0.0,0.6,0.0 185 | 2021-07-01 14:49:00,90.0,0,0.0,0.6,0.0 186 | 2021-07-01 15:04:00,93.6,0,0.0,0.6,0.0 187 | 2021-07-01 15:19:00,95.4,0,0.0,0.6,0.0 188 | 2021-07-01 15:34:00,97.2,0,0.0,0.6,0.0 189 | 2021-07-01 15:49:00,102.6,0,0.0,0.6,0.0 190 | 2021-07-01 16:04:00,104.4,0,0.0,0.6,0.0 191 | 2021-07-01 16:19:00,108.0,0,0.0,0.6,0.0 192 | 2021-07-01 16:34:00,111.6,0,0.0,0.6,0.0 193 | 2021-07-01 16:49:00,111.6,6,0.0,0.6,0.0 194 | 2021-07-01 17:04:00,113.4,0,0.0,0.6,77.285 195 | 2021-07-01 17:19:00,118.8,0,0.0,0.6,0.0 196 | 2021-07-01 17:34:00,127.8,0,0.0,0.6,0.0 197 | 2021-07-01 17:49:00,135.0,0,0.0,0.6,0.0 198 | 2021-07-01 18:04:00,138.6,0,0.0,0.6,0.0 199 | 2021-07-01 18:19:00,138.6,0,0.0,0.6,0.0 200 | 2021-07-01 18:34:00,138.6,0,0.0,0.6,0.0 201 | 2021-07-01 18:49:00,133.2,0,0.0,0.6,0.0 202 | 2021-07-01 19:04:00,129.6,0,0.0,0.6,0.0 203 | 2021-07-01 19:19:00,131.4,0,0.0,0.6,0.0 204 | 2021-07-01 19:34:00,127.8,0,0.0,0.6,0.0 205 | 2021-07-01 19:49:00,120.6,0,0.0,0.6,0.0 206 | 2021-07-01 20:04:00,120.6,0,0.0,0.6,0.0 207 | 2021-07-01 20:19:00,122.4,0,0.0,0.6,0.0 208 | 2021-07-01 20:34:00,127.8,0,0.0,0.6,0.0 209 | 2021-07-01 20:49:00,127.8,0,0.0,0.6,0.0 210 | 2021-07-01 21:04:00,124.2,16,0.0,0.6,0.0 211 | 2021-07-01 21:19:00,122.4,0,0.0,0.6,0.0 212 | 2021-07-01 21:34:00,117.0,0,0.0,0.6,0.0 213 | 2021-07-01 21:49:00,115.2,0,0.0,0.6,0.0 214 | 2021-07-01 22:04:00,113.4,0,0.0,0.6,0.0 215 | 2021-07-01 22:19:00,113.4,0,0.0,0.6,0.0 216 | 2021-07-01 22:34:00,109.8,0,0.0,0.6,0.0 217 | 2021-07-01 22:49:00,102.6,0,0.0,0.6,0.0 218 | 2021-07-01 23:04:00,106.2,0,0.0,0.6,0.0 219 | 2021-07-01 23:19:00,115.2,0,0.0,0.6,0.0 220 | 2021-07-01 23:34:00,115.2,0,0.0,0.6,0.0 221 | 2021-07-01 23:49:00,111.6,0,0.0,0.6,0.0 222 | 2021-07-02 00:04:00,109.8,0,0.0,0.6,0.0 223 | 2021-07-02 00:19:00,111.6,0,0.0,0.6,0.0 224 | 2021-07-02 00:34:00,113.4,0,0.0,0.6,0.0 225 | 2021-07-02 00:49:00,118.8,0,0.0,0.6,0.0 226 | 2021-07-02 01:04:00,124.2,0,0.0,0.6,0.0 227 | 2021-07-02 01:19:00,127.8,0,0.0,0.6,0.0 228 | 2021-07-02 01:34:00,124.2,0,0.0,0.6,0.0 229 | 2021-07-02 01:49:00,120.6,0,0.0,0.6,0.0 230 | 2021-07-02 02:04:00,118.8,0,0.0,0.6,0.0 231 | 2021-07-02 02:19:00,122.4,0,0.0,0.6,0.0 232 | 2021-07-02 02:34:00,127.8,0,0.0,0.6,0.0 233 | 2021-07-02 02:49:00,124.2,0,0.0,0.6,0.0 234 | 2021-07-02 03:04:00,122.4,0,0.0,0.6,0.0 235 | 2021-07-02 03:19:00,120.6,0,0.0,0.6,0.0 236 | 2021-07-02 03:34:00,117.0,0,0.0,0.6,0.0 237 | 2021-07-02 03:49:00,118.8,0,0.0,0.6,0.0 238 | 2021-07-02 04:04:00,126.0,0,0.0,0.6,0.0 239 | 2021-07-02 04:19:00,126.0,0,0.0,0.6,0.0 240 | 2021-07-02 04:34:00,124.2,0,0.0,0.6,0.0 241 | 2021-07-02 04:49:00,124.2,0,0.0,0.6,0.0 242 | 2021-07-02 05:04:00,124.2,0,0.0,0.6,0.0 243 | 2021-07-02 05:19:00,124.2,0,0.0,0.6,0.0 244 | 2021-07-02 05:34:00,129.6,0,0.0,0.6,0.0 245 | 2021-07-02 05:49:00,129.6,0,0.0,0.6,0.0 246 | 2021-07-02 06:04:00,127.8,0,0.0,0.6,0.0 247 | 2021-07-02 06:19:00,127.8,0,0.0,0.6,0.0 248 | 2021-07-02 06:34:00,126.0,14,0.0,0.6,0.0 249 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2000_0_20201230.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2000_0_20201230.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2001_0_20201102.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2001_0_20201102.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2001_1_20201117.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2001_1_20201117.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2002_0_20210513.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2002_0_20210513.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2003_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2003_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2004_0_20211028.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2004_0_20211028.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2005_0_20211201.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2005_0_20211201.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2006_0_20211112.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2006_0_20211112.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2007_0_20220108.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2007_0_20220108.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2008_0_20220118.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2008_0_20220118.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2009_0_20211103.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2009_0_20211103.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2010_0_20220111.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2010_0_20220111.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2011_0_20220123.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2011_0_20220123.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2012_0_20220126.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2012_0_20220126.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2013_0_20220123.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2013_0_20220123.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2014_0_20201224.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2014_0_20201224.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2014_1_20210317.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2014_1_20210317.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2015_0_20210203.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2015_0_20210203.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2015_1_20210219.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2015_1_20210219.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2016_0_20201224.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2016_0_20201224.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2017_0_20210102.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2017_0_20210102.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2017_1_20201118.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2017_1_20201118.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2018_0_20210420.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2018_0_20210420.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2019_0_20210513.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2019_0_20210513.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2020_0_20210423.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2020_0_20210423.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2021_0_20211013.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2021_0_20211013.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2022_0_20210419.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2022_0_20210419.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2023_0_20210812.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2023_0_20210812.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2024_0_20210429.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2024_0_20210429.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2025_0_20210506.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2025_0_20210506.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2026_0_20210916.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2026_0_20210916.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2027_0_20210521.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2027_0_20210521.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2028_0_20210426.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2028_0_20210426.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2029_0_20210526.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2029_0_20210526.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2030_0_20210531.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2030_0_20210531.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2031_0_20210601.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2031_0_20210601.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2032_0_20210727.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2032_0_20210727.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2033_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2033_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2034_0_20210624.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2034_0_20210624.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2035_0_20210629.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2035_0_20210629.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2036_0_20210803.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2036_0_20210803.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2037_0_20201221.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2037_0_20201221.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2038_0_20210608.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2038_0_20210608.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2039_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2039_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2040_0_20210729.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2040_0_20210729.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2041_0_20210813.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2041_0_20210813.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2042_0_20211019.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2042_0_20211019.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2043_0_20210513.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2043_0_20210513.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2044_0_20211101.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2044_0_20211101.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2045_0_20201216.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2045_0_20201216.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2046_0_20201216.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2046_0_20201216.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2047_0_20210420.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2047_0_20210420.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2048_0_20210426.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2048_0_20210426.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2049_0_20210426.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2049_0_20210426.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2050_0_20210510.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2050_0_20210510.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2051_0_20210512.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2051_0_20210512.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2052_0_20210511.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2052_0_20210511.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2053_0_20210518.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2053_0_20210518.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2054_0_20210524.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2054_0_20210524.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2055_0_20210524.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2055_0_20210524.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2055_1_20201207.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2055_1_20201207.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2056_0_20210524.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2056_0_20210524.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2057_0_20210525.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2057_0_20210525.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2058_0_20210524.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2058_0_20210524.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2059_0_20210525.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2059_0_20210525.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2060_0_20201214.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2060_0_20201214.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2061_0_20210601.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2061_0_20210601.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2062_0_20210601.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2062_0_20210601.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2063_0_20210608.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2063_0_20210608.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2064_0_20210608.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2064_0_20210608.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2065_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2065_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2066_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2066_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2067_0_20210615.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2067_0_20210615.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2068_0_20210616.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2068_0_20210616.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2069_0_20210621.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2069_0_20210621.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2069_1_20210705.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2069_1_20210705.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2069_2_20210825.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2069_2_20210825.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2070_0_20210629.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2070_0_20210629.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2071_0_20210705.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2071_0_20210705.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2072_0_20210706.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2072_0_20210706.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2073_0_20210703.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2073_0_20210703.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2074_0_20210707.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2074_0_20210707.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2074_1_20210720.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2074_1_20210720.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2075_0_20210720.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2075_0_20210720.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2076_0_20210720.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2076_0_20210720.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2077_0_20210803.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2077_0_20210803.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2078_0_20210803.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2078_0_20210803.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2078_1_20210817.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2078_1_20210817.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2079_0_20210809.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2079_0_20210809.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2080_0_20210816.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2080_0_20210816.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2081_0_20210817.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2081_0_20210817.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2082_0_20210907.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2082_0_20210907.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2083_0_20201214.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2083_0_20201214.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2084_0_20211013.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2084_0_20211013.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2085_0_20200907.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2085_0_20200907.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2086_0_20200914.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2086_0_20200914.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2087_0_20201012.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2087_0_20201012.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2088_0_20201123.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2088_0_20201123.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2089_0_20201019.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2089_0_20201019.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2090_0_20201130.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2090_0_20201130.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2091_0_20201029.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2091_0_20201029.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2092_0_20201109.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2092_0_20201109.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2093_0_20201109.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2093_0_20201109.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2094_0_20211109.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2094_0_20211109.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2095_0_20201116.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2095_0_20201116.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2096_0_20201116.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2096_0_20201116.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2097_0_20201116.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2097_0_20201116.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2098_0_20201106.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2098_0_20201106.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2099_0_20201116.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/Shanghai_T2DM_old/2099_0_20201116.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/combined6.4/combined_data.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/combined6.4/combined_data.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/correlation_analysis.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/correlation_analysis.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/drug_name_to_code.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/drug_name_to_code.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Acute Diabetic Complications.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Acute Diabetic Complications.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Comorbidities.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Comorbidities.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Diabetic Macrovascular Complications.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Diabetic Macrovascular Complications.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Diabetic Microvascular Complications.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Diabetic Microvascular Complications.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Hypoglycemic Agents.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Hypoglycemic Agents.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Other Agents.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Other Agents.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Shanghai_T1DM_Summary0.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Shanghai_T1DM_Summary0.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Shanghai_T2DM_Summary0.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/LSTM/datasets_new/summary/Shanghai_T2DM_Summary0.xlsx -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/LSTM/predict.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import numpy as np 4 | import pandas as pd 5 | import tensorflow as tf 6 | from sklearn.preprocessing import StandardScaler 7 | import matplotlib.pyplot as plt 8 | 9 | # 载入保存的模型 10 | loaded_model = tf.keras.models.load_model('blood_glucose_prediction_model.h5') 11 | print("Model loaded from 'blood_glucose_prediction_model.h5'") 12 | 13 | time_series_features = [ 14 | 'CGM (mg / dl)', 15 | 'Insulin dose - s.c.', 16 | 'CSII - bolus insulin (Novolin R, IU)', 17 | 'Carbohydrate/g' 18 | ] 19 | static_features = [ 20 | 'type','patient_id','Age (years)', 'Weight (kg)', 'BMI (kg/m2)', 'Duration of Diabetes (years)', 21 | 'HbA1c (mmol/mol)', 'Fasting Plasma Glucose (mg/dl)', '2-hour Postprandial C-peptide (nmol/L)', 22 | 'Fasting C-peptide (nmol/L)', 'Glycated Albumin (%)', 'Acute Diabetic Complications', 23 | 'Diabetic Macrovascular Complications', 'Diabetic Microvascular Complications', 24 | 'Comorbidities', 'Hypoglycemic Agents', 'Other Agents' 25 | ] 26 | 27 | # 定义时间步长 28 | time_steps = 15 29 | 30 | 31 | data_dir = './datasets_new/' 32 | patient_id = '2054_0_20210524' 33 | patient_file = os.path.join(data_dir, 'Shanghai_T2DM/', f'{patient_id}.csv') 34 | 35 | 36 | 37 | 38 | # 读取Summary数据,并新增一个属性type表示糖尿病类型 39 | t2dm_summary_file = os.path.join(data_dir, 'summary', 'Shanghai_T2DM_Summary0.xlsx') 40 | t2dm_summary = pd.read_excel(t2dm_summary_file) 41 | t2dm_summary['type'] = 2 # T1DM类型标记为1 42 | 43 | # 从summary数据中获取病人的静态特征 44 | static_data = t2dm_summary[t2dm_summary['patient_id'] == patient_id] 45 | 46 | # 读取单个病人的详细数据 47 | patient_data = pd.read_csv(patient_file) 48 | 49 | # 提取前15个时间步的数据 50 | input_time_series = patient_data[time_series_features].iloc[:15].values 51 | 52 | # 提取前15个时间步的数据用于预测,第16-19个时间步的数据用于验证和可视化 53 | target_cgm_values = patient_data['CGM (mg / dl)'].iloc[15:19].values 54 | 55 | # 提取静态特征数据 56 | static_data = static_data[static_features].values[0] 57 | 58 | 59 | # 标准化静态特征 60 | scaler_static = StandardScaler() 61 | static_data_scaled = scaler_static.fit_transform(static_data.reshape(1, -1)) 62 | 63 | # 创建输入数据 64 | input_time_series = input_time_series.reshape(1, 15, len(time_series_features)) 65 | 66 | # 进行预测 67 | loaded_model = tf.keras.models.load_model('blood_glucose_prediction_model.h5') 68 | print("Model loaded from 'blood_glucose_prediction_model.h5'") 69 | 70 | predictions = [] 71 | for i in range(4): 72 | next_prediction = loaded_model.predict([input_time_series, static_data_scaled])[0][0] 73 | predictions.append(next_prediction) 74 | 75 | # 更新输入序列 76 | new_step = np.array([[next_prediction, 0, 0, 0]]) # 其他特征值设置为0 77 | input_time_series = np.append(input_time_series[:, 1:, :], new_step.reshape(1, 1, -1), axis=1) 78 | 79 | # 可视化预测结果和实际值 80 | time_points = [15,30,45,60] 81 | plt.plot(time_points, predictions, label='Predicted', marker='o') 82 | plt.plot(time_points, target_cgm_values, label='Actual', marker='x') 83 | plt.xlabel('Time Point(min)') 84 | plt.ylabel('Blood Glucose Level (mg/dl)') 85 | plt.title('Predicted vs Actual Blood Glucose Levels for Patient') 86 | plt.legend() 87 | plt.grid(True) 88 | plt.show() 89 | 90 | # 输出预测结果 91 | for i, (pred, actual) in enumerate(zip(predictions, target_cgm_values)): 92 | print(f'Time Point {i + 16}: Predicted = {pred}, Actual = {actual}, Error = {abs(pred - actual)}') 93 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/README.md: -------------------------------------------------------------------------------- 1 | # Code 2 | 3 | 本次作业我们采用两种方式进行血糖水平时间序列的预测。 4 | 5 | 一种是LSTM一种是Transformer。 6 | 7 | 在code文件夹中有一个ipynb文件和两个子文件夹。 8 | 其中ipynb文件是数据预处理的代码,两个子文件夹分别是LSTM和Transformer方法的实现。 9 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614222537322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614222537322.png -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614222548573.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614222548573.png -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614222629816.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614222629816.png -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614223619173.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/README.assets/image-20240614223619173.png -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/README.md: -------------------------------------------------------------------------------- 1 | # 0. 目录介绍 2 | 3 | ~~~ 4 | D:. 5 | │ dataset.ipynb 6 | │ dataset.py 7 | │ data_analysis.ipynb 8 | │ data_preprocessing.ipynb 9 | │ fine1.py 10 | │ fine2.py 11 | │ main.py 12 | │ README.md 13 | │ test.py 14 | │ test_gradient.py 15 | │ TransformerModel.py 16 | │ transformer_preprossing.ipynb 17 | │ 18 | ├─data 19 | │ │ Shanghai_T1DM_Summary.csv 20 | │ │ Shanghai_T2DM_Summary.csv 21 | │ │ 22 | │ ├─Shanghai_T1DM 23 | │ └─Shanghai_T2DM 24 | ├─dataset 25 | │ ├─T1DM 26 | │ ├─T1DM_Augmentation 27 | │ ├─T1DM_Upsampling 28 | │ ├─T2DM 29 | │ ├─T2DM_Augmentation 30 | │ └─T2DM_Downsampling 31 | ├─models 32 | └─runs 33 | ~~~ 34 | 35 | `dataset.py` 是加载数据集的代码 36 | 37 | `fine1.py` 是针对T1DM微调的代码 38 | 39 | `fine2.py` 是针对T2DM微调的代码 40 | 41 | `TransformerModel.py` 是Transformer的实现 42 | 43 | `test_gradient.py` 是梯度综合分析展示特征贡献度的代码 44 | 45 | `test.py` 是用于测试模型的 MSE 和 MAE 的代码 46 | 47 | `transformer_preprossing.ipynb` 和 `dataset.ipynb` 是在训练之前再对数据集进行加工的代码 48 | 49 | `data_preprocessing.ipynb` 和 `data_analysis.ipynb` 是数据预处理和相关性分析特征工程的代码 50 | 51 | `data` 是原数据文件夹 52 | 53 | `dataset` 是处理后数据文件夹 54 | 55 | `models` 是存放模型文件夹 56 | 57 | `runs` 是存放运行日志文件夹 58 | 59 | # 1. 运行环境 60 | 61 | * GPU cuda版本: 62 | 63 | ![image-20240614222548573](./README.assets/image-20240614222548573.png) 64 | 65 | * 系统版本: 66 | 67 | ![image-20240614222629816](./README.assets/image-20240614222629816.png) 68 | 69 | * 硬件规格 70 | 71 | ![image-20240614223619173](./README.assets/image-20240614223619173.png) 72 | 73 | * python版本为 3.11.5 ,深度学习框架主要使用 pytorch == 2.2.2+cu121 74 | * 其他 python 库主要使用了numpy, matplotlib, tqdm, tensorboard, sklearn, pandas 75 | 76 | # 2.运行步骤 77 | 78 | 1. 预训练模型训练请将处理好的数据放置到指定文件夹下后运行 main.py 文件 79 | 2. 微调模型可以分别运行 fine1.py 和 fine2.py 文件,需要填入预训练的模型路径 80 | 3. 测试模型可以运行 test.py 文件,需要填入模型路径 81 | 4. 梯度综合分析展示特征贡献度可以直接运行 test_gradient.py -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/TransformerModel.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.optim as optim 4 | import math 5 | 6 | 7 | class TransformerModel(nn.Module): 8 | def __init__( 9 | self, 10 | input_dim, 11 | output_dim, 12 | d_model=32, 13 | nhead=4, 14 | num_encoder_layers=3, 15 | num_decoder_layers=3, 16 | dim_feedforward=128, 17 | dropout=0.1, 18 | ): 19 | super(TransformerModel, self).__init__() 20 | self.d_model = d_model 21 | self.embedding = nn.Linear(input_dim, d_model) 22 | self.transformer = nn.Transformer( 23 | d_model, 24 | nhead, 25 | num_encoder_layers, 26 | num_decoder_layers, 27 | dim_feedforward, 28 | dropout, 29 | batch_first=True, 30 | ) 31 | self.decoder_embedding = nn.Linear(output_dim, d_model) 32 | self.fc_out = nn.Linear(d_model, output_dim) 33 | self.init_weights() 34 | 35 | def init_weights(self): 36 | # 使用Xavier初始化适用于所有线性层 37 | nn.init.xavier_uniform_(self.embedding.weight) 38 | nn.init.xavier_uniform_(self.fc_out.weight) 39 | nn.init.xavier_uniform_(self.decoder_embedding.weight) 40 | 41 | def forward(self, src, tgt): 42 | src = self.embedding(src) 43 | tgt = self.decoder_embedding(tgt) 44 | output = self.transformer(src, tgt) 45 | output = self.fc_out(output) 46 | return output 47 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/dataset.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 20, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "\n", 12 | "\n", 13 | "# 定义一个函数将分钟数转换为周期性特征\n", 14 | "def time_to_cyclical(minute_series, max_val=1440): # 1440 分钟表示一天的总分钟数\n", 15 | " sin_vals = np.sin(2 * np.pi * minute_series / max_val)\n", 16 | " cos_vals = np.cos(2 * np.pi * minute_series / max_val)\n", 17 | " return sin_vals, cos_vals\n", 18 | "\n", 19 | "def solve1(name):\n", 20 | "\n", 21 | " # 读取数据摘要文件\n", 22 | " data_summary = pd.read_csv(f\"data/Shanghai_{name}_Summary.csv\")\n", 23 | "\n", 24 | " # 选择需要复制的特定列\n", 25 | " selected_columns = [\n", 26 | " \"Duration of Diabetes (years)\",\n", 27 | " \"Fasting Plasma Glucose (mg/dl)\",\n", 28 | " \"2-hour Postprandial Insulin (pmol/L)\",\n", 29 | " \"HbA1c (mmol/mol)\",\n", 30 | " \"Glycated Albumin (%)\",\n", 31 | " ]\n", 32 | "\n", 33 | " # 药物相关度字典\n", 34 | " drug_correlations = {\n", 35 | " \"Humulin R\": 1.365444158221848,\n", 36 | " \"insulin aspart 70/30\": 1.06324690222164,\n", 37 | " \"voglibose\": 0.946377183963179,\n", 38 | " \"metformin\": 0.6986628850317034,\n", 39 | " \"Novolin R\": 0.6854082306114344,\n", 40 | " \"sitagliptin\": 0.6852370154880306,\n", 41 | " \"insulin degludec\": 0.5551849984711914,\n", 42 | " \"insulin glargine\": 0.5544288133650825,\n", 43 | " \"insulin glarigine\": 0.5064889597678641,\n", 44 | " \"Gansulin R\": 0.4889905571280143,\n", 45 | " \"glimepiride\": 0.45700893221455063,\n", 46 | " \"insulin aspart 50/50\": 0.45700893221455063,\n", 47 | " \"Novolin 30R\": 0.44981075394747994,\n", 48 | " \"Novolin 50R\": 0.43604410870946597,\n", 49 | " \"pioglitazone\": 0.43580275030128934,\n", 50 | " \"insulin glulisine\": 0.4347913458122733,\n", 51 | " \"insulin detemir\": 0.41448751289298663,\n", 52 | " \"dapagliflozin\": 0.3989705959581452,\n", 53 | " \"canagliflozin\": 0.39839570463199087,\n", 54 | " \"repaglinide\": 0.3973211454109254,\n", 55 | " \"insulin aspart\": 0.37804370240755825,\n", 56 | " \"Gansulin 40R\": 0.36299685165116846,\n", 57 | " \"acarbose\": 0.3312078141826219,\n", 58 | " \"Humulin 70/30\": 0.2605611291192308,\n", 59 | " \"gliquidone\": 0.15197177803775078,\n", 60 | " \"gliclazide\": 0.1351941319739795,\n", 61 | " \"liraglutide\": 0.12751629718275428,\n", 62 | " }\n", 63 | "\n", 64 | " # 获取患者ID列\n", 65 | " id_column = data_summary[\"Patient Number\"]\n", 66 | "\n", 67 | " # 读取药物特征数据\n", 68 | " drug_data = pd.read_csv(\"data/hypoglycemic_agents.csv\")\n", 69 | "\n", 70 | "\n", 71 | " for id_value in id_column:\n", 72 | " # 读取每个病人的数据文件\n", 73 | " data = pd.read_csv(f\"data/Shanghai_{name}/\" + str(id_value) + \".csv\")\n", 74 | "\n", 75 | " # 处理日期列,提取小时和分钟\n", 76 | " data[\"Date\"] = pd.to_datetime(data[\"Date\"])\n", 77 | " data[\"Minute_of_day\"] = data[\"Date\"].dt.hour * 60 + data[\"Date\"].dt.minute\n", 78 | "\n", 79 | " # 将分钟数转换为周期性特征\n", 80 | " data[\"Minute_sin\"], data[\"Minute_cos\"] = time_to_cyclical(data[\"Minute_of_day\"])\n", 81 | "\n", 82 | " # 删除中间变量Minute_of_day\n", 83 | " data.drop(\n", 84 | " columns=[\"Minute_of_day\", \"CSII - bolus insulin (Novolin R, IU)\"], inplace=True\n", 85 | " )\n", 86 | "\n", 87 | "\n", 88 | " # 获取当前病人的药物使用信息\n", 89 | " patient_drug_data = drug_data[drug_data[\"Patient Number\"] == id_value]\n", 90 | "\n", 91 | " # 将需要单独列为特征的药物特征添加到数据中\n", 92 | " for drug in [\"Humulin R\", \"insulin aspart 70/30\", \"voglibose\"]:\n", 93 | " if drug in patient_drug_data.columns:\n", 94 | " data[drug] = patient_drug_data[drug].values[0]\n", 95 | "\n", 96 | " # 处理相关性在0.5到0.75之间的药物特征\n", 97 | " medium_corr_drugs = [\n", 98 | " drug for drug, corr in drug_correlations.items() if 0.5 <= corr < 0.75\n", 99 | " ]\n", 100 | " if not patient_drug_data.empty:\n", 101 | " data[\"medium_corr_drugs\"] = (\n", 102 | " patient_drug_data[medium_corr_drugs].sum(axis=1).values[0]\n", 103 | " )\n", 104 | "\n", 105 | " # 获取当前病人的摘要信息\n", 106 | " patient_summary = data_summary[data_summary[\"Patient Number\"] == id_value][\n", 107 | " selected_columns\n", 108 | " ]\n", 109 | "\n", 110 | " # 将病人的摘要信息复制到每一行\n", 111 | " for col in selected_columns:\n", 112 | " data[col] = patient_summary.iloc[0][col]\n", 113 | "\n", 114 | " # 保存更新后的数据\n", 115 | " data.to_csv(f\"dataset/{name}/\" + str(id_value) + \".csv\", index=False)\n", 116 | "\n", 117 | "\n", 118 | "solve1(\"T1DM\")\n", 119 | "solve1(\"T2DM\")" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": null, 125 | "metadata": {}, 126 | "outputs": [], 127 | "source": [] 128 | } 129 | ], 130 | "metadata": { 131 | "kernelspec": { 132 | "display_name": "base", 133 | "language": "python", 134 | "name": "python3" 135 | }, 136 | "language_info": { 137 | "codemirror_mode": { 138 | "name": "ipython", 139 | "version": 3 140 | }, 141 | "file_extension": ".py", 142 | "mimetype": "text/x-python", 143 | "name": "python", 144 | "nbconvert_exporter": "python", 145 | "pygments_lexer": "ipython3", 146 | "version": "3.11.5" 147 | } 148 | }, 149 | "nbformat": 4, 150 | "nbformat_minor": 2 151 | } 152 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/dataset.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import numpy as np 3 | import os 4 | import torch 5 | from torch.utils.data import Dataset, DataLoader, random_split 6 | from sklearn.preprocessing import StandardScaler 7 | 8 | 9 | class CGMDataset(Dataset): 10 | def __init__(self, file_paths=None, input_window_size=4, output_window_size=4): 11 | self.data = [] 12 | self.targets = [] 13 | if file_paths: 14 | for file_path in file_paths: 15 | X, y = self.process_file( 16 | file_path, input_window_size, output_window_size 17 | ) 18 | self.data.append(X) 19 | self.targets.append(y) 20 | 21 | self.data = np.concatenate(self.data, axis=0) 22 | self.targets = np.concatenate(self.targets, axis=0) 23 | 24 | # 检查X_mixed中是否有NaN值 25 | if np.isnan(self.data).any(): 26 | print("X_mixed contains NaN values") 27 | 28 | # 检查y_mixed中是否有NaN值 29 | if np.isnan(self.targets).any(): 30 | print("y_mixed contains NaN values") 31 | 32 | def __len__(self): 33 | return len(self.data) 34 | 35 | def __getitem__(self, idx): 36 | data = self.data[idx] 37 | return torch.tensor(data, dtype=torch.float32), torch.tensor( 38 | self.targets[idx], dtype=torch.float32 39 | ) 40 | 41 | @staticmethod 42 | def process_file(file_path, input_window_size=4, output_window_size=4): 43 | data = pd.read_csv(file_path) 44 | 45 | # 删除包含NaN值的行 46 | data = data.dropna() 47 | 48 | # 获取所有特征,删除Date列 49 | features = data.drop(columns=["Date"]).values 50 | targets = data["CGM (mg / dl)"].values 51 | 52 | X = [] 53 | y = [] 54 | 55 | for i in range(len(data) - input_window_size - output_window_size): 56 | X.append(features[i : i + input_window_size]) # 保持时间窗口内的特征维度 57 | y.append( 58 | targets[ 59 | i + input_window_size : i + input_window_size + output_window_size 60 | ] 61 | ) # 目标是下四个时间点的血糖值 62 | 63 | return np.array(X), np.array(y) 64 | 65 | @staticmethod 66 | def upsample(X, y, factor): 67 | indices = np.random.choice(len(X), size=int(len(X) * factor), replace=True) 68 | return X[indices], y[indices] 69 | 70 | @staticmethod 71 | def downsample(X, y, factor): 72 | indices = np.random.choice(len(X), size=int(len(X) * factor), replace=False) 73 | return X[indices], y[indices] 74 | 75 | 76 | def getLoader(): 77 | # 文件夹路径 78 | directory_paths = {"T1DM": "dataset/T1DM", "T2DM": "dataset/T2DM"} 79 | 80 | # 获取文件路径 81 | file_paths_T1DM = [ 82 | os.path.join(directory_paths["T1DM"], filename) 83 | for filename in os.listdir(directory_paths["T1DM"]) 84 | if filename.endswith(".csv") 85 | ] 86 | file_paths_T2DM = [ 87 | os.path.join(directory_paths["T2DM"], filename) 88 | for filename in os.listdir(directory_paths["T2DM"]) 89 | if filename.endswith(".csv") 90 | ] 91 | 92 | # 创建单独的数据集,不进行采样处理 93 | input_window_size = 8 # 可调节的输入窗口 94 | output_window_size = 4 # 固定的输出窗口 95 | 96 | dataset_T1DM = CGMDataset( 97 | file_paths_T1DM, 98 | input_window_size=input_window_size, 99 | output_window_size=output_window_size, 100 | ) 101 | dataset_T2DM = CGMDataset( 102 | file_paths_T2DM, 103 | input_window_size=input_window_size, 104 | output_window_size=output_window_size, 105 | ) 106 | 107 | # 对T1DM和T2DM分别进行上采样和下采样 108 | upsample_factor_T1DM = 2.5 109 | downsample_factor_T2DM = 0.4 110 | 111 | X_T1DM, y_T1DM = dataset_T1DM.data, dataset_T1DM.targets 112 | X_T2DM, y_T2DM = dataset_T2DM.data, dataset_T2DM.targets 113 | 114 | # 检查X_mixed中是否有NaN值 115 | if np.isnan(X_T1DM).any(): 116 | print("X_mixed contains NaN values") 117 | 118 | # 检查y_mixed中是否有NaN值 119 | if np.isnan(X_T2DM).any(): 120 | print("y_mixed contains NaN values") 121 | 122 | X_T1DM, y_T1DM = CGMDataset.upsample(X_T1DM, y_T1DM, upsample_factor_T1DM) 123 | X_T2DM, y_T2DM = CGMDataset.downsample(X_T2DM, y_T2DM, downsample_factor_T2DM) 124 | 125 | # 检查X_mixed中是否有NaN值 126 | if np.isnan(X_T1DM).any(): 127 | print("X_mixed contains NaN values") 128 | 129 | # 检查y_mixed中是否有NaN值 130 | if np.isnan(X_T2DM).any(): 131 | print("y_mixed contains NaN values") 132 | 133 | # 混合数据集 134 | X_mixed = np.concatenate([X_T1DM, X_T2DM], axis=0) 135 | y_mixed = np.concatenate([y_T1DM, y_T2DM], axis=0) 136 | 137 | # 检查X_mixed中是否有NaN值 138 | if np.isnan(X_mixed).any(): 139 | print("X_mixed contains NaN values") 140 | 141 | # 检查y_mixed中是否有NaN值 142 | if np.isnan(y_mixed).any(): 143 | print("y_mixed contains NaN values") 144 | 145 | # 创建StandardScaler对象 146 | scaler_X = StandardScaler() 147 | 148 | # 将三维数据转换为二维 149 | X_mixed_2D = X_mixed.reshape(-1, X_mixed.shape[-1]) 150 | 151 | # 使用X_mixed来拟合scaler,然后对X_mixed进行转换 152 | X_mixed_2D = scaler_X.fit_transform(X_mixed_2D) 153 | 154 | # 将二维数据转回三维 155 | X_mixed = X_mixed_2D.reshape(X_mixed.shape) 156 | 157 | dataset_mixed = CGMDataset() 158 | dataset_mixed.data = X_mixed 159 | dataset_mixed.targets = y_mixed 160 | 161 | # 将数据集划分为训练集和验证集 162 | train_size = int(0.9 * len(dataset_mixed)) 163 | val_size = len(dataset_mixed) - train_size 164 | train_dataset, val_dataset = random_split(dataset_mixed, [train_size, val_size]) 165 | 166 | print(f"Mixed dataset size: {len(dataset_mixed)}") 167 | 168 | # 数据加载器 169 | train_loader = DataLoader(train_dataset, batch_size=32, shuffle=True) 170 | val_loader = DataLoader(val_dataset, batch_size=32, shuffle=False) 171 | 172 | return train_loader, val_loader 173 | 174 | 175 | def getT1Loader(): 176 | # 文件夹路径 177 | directory_paths = {"T1DM": "dataset/T1DM", "T2DM": "dataset/T2DM"} 178 | 179 | # 获取文件路径 180 | file_paths_T1DM = [ 181 | os.path.join(directory_paths["T1DM"], filename) 182 | for filename in os.listdir(directory_paths["T1DM"]) 183 | if filename.endswith(".csv") 184 | ] 185 | 186 | # 创建单独的数据集,不进行采样处理 187 | input_window_size = 4 # 可调节的输入窗口 188 | output_window_size = 4 # 固定的输出窗口 189 | 190 | dataset_T1DM = CGMDataset( 191 | file_paths_T1DM, 192 | input_window_size=input_window_size, 193 | output_window_size=output_window_size, 194 | ) 195 | 196 | # 创建StandardScaler对象 197 | scaler_X = StandardScaler() 198 | 199 | # 将三维数据转换为二维 200 | X_2D = dataset_T1DM.data.reshape(-1, dataset_T1DM.data.shape[-1]) 201 | 202 | # 使用X_mixed来拟合scaler,然后对X_mixed进行转换 203 | X_2D = scaler_X.fit_transform(X_2D) 204 | 205 | # 将二维数据转回三维 206 | dataset_T1DM.data = X_2D.reshape(dataset_T1DM.data.shape) 207 | 208 | X_T1DM, y_T1DM = dataset_T1DM.data, dataset_T1DM.targets 209 | 210 | # 检查X_mixed中是否有NaN值 211 | if np.isnan(X_T1DM).any(): 212 | print("X_mixed contains NaN values") 213 | 214 | # 检查y_mixed中是否有NaN值 215 | if np.isnan(y_T1DM).any(): 216 | print("y_mixed contains NaN values") 217 | 218 | # 将数据集划分为训练集和验证集 219 | train_size = int(0.9 * len(dataset_T1DM)) 220 | val_size = len(dataset_T1DM) - train_size 221 | train_dataset, val_dataset = random_split(dataset_T1DM, [train_size, val_size]) 222 | 223 | print(f"Mixed dataset size: {len(dataset_T1DM)}") 224 | 225 | # 数据加载器 226 | train_loader = DataLoader(train_dataset, batch_size=32, shuffle=True) 227 | val_loader = DataLoader(val_dataset, batch_size=32, shuffle=False) 228 | 229 | return train_loader, val_loader 230 | 231 | 232 | def getT2Loader(): 233 | # 文件夹路径 234 | directory_paths = {"T1DM": "dataset/T1DM", "T2DM": "dataset/T2DM"} 235 | 236 | # 获取文件路径 237 | file_paths_T2DM = [ 238 | os.path.join(directory_paths["T2DM"], filename) 239 | for filename in os.listdir(directory_paths["T2DM"]) 240 | if filename.endswith(".csv") 241 | ] 242 | 243 | # 创建单独的数据集,不进行采样处理 244 | input_window_size = 4 # 可调节的输入窗口 245 | output_window_size = 4 # 固定的输出窗口 246 | 247 | dataset_T2DM = CGMDataset( 248 | file_paths_T2DM, 249 | input_window_size=input_window_size, 250 | output_window_size=output_window_size, 251 | ) 252 | 253 | # 创建StandardScaler对象 254 | scaler_X = StandardScaler() 255 | 256 | # 将三维数据转换为二维 257 | X_2D = dataset_T2DM.data.reshape(-1, dataset_T2DM.data.shape[-1]) 258 | 259 | # 使用X_mixed来拟合scaler,然后对X_mixed进行转换 260 | X_2D = scaler_X.fit_transform(X_2D) 261 | 262 | # 将二维数据转回三维 263 | dataset_T2DM.data = X_2D.reshape(dataset_T2DM.data.shape) 264 | 265 | X_T1DM, y_T1DM = dataset_T2DM.data, dataset_T2DM.targets 266 | 267 | # 检查X_mixed中是否有NaN值 268 | if np.isnan(X_T1DM).any(): 269 | print("X_mixed contains NaN values") 270 | 271 | # 检查y_mixed中是否有NaN值 272 | if np.isnan(y_T1DM).any(): 273 | print("y_mixed contains NaN values") 274 | 275 | # 将数据集划分为训练集和验证集 276 | train_size = int(0.9 * len(dataset_T2DM)) 277 | val_size = len(dataset_T2DM) - train_size 278 | train_dataset, val_dataset = random_split(dataset_T2DM, [train_size, val_size]) 279 | 280 | print(f"Mixed dataset size: {len(dataset_T2DM)}") 281 | 282 | # 数据加载器 283 | train_loader = DataLoader(train_dataset, batch_size=32, shuffle=True) 284 | val_loader = DataLoader(val_dataset, batch_size=32, shuffle=False) 285 | 286 | return train_loader, val_loader 287 | 288 | 289 | # if __name__ == "__main__": 290 | 291 | 292 | # # 打印数据集大小 293 | # print(f"T1DM dataset size: {len(dataset_T1DM)}") 294 | # print(f"T2DM dataset size: {len(dataset_T2DM)}") 295 | # print(f"Mixed dataset size: {len(dataset_mixed)}") 296 | 297 | # # 打印混合数据集的一条数据 298 | # sample_X, sample_y = dataset_T1DM[0] 299 | # print(f"Sample X: {sample_X}") 300 | # print(f"Sample y: {sample_y}") 301 | 302 | # # 计算并显示各数据集的比重 303 | # total_data_count = len(dataset_mixed) 304 | # t1dm_proportion = len(X_T1DM) / total_data_count 305 | # t2dm_proportion = len(X_T2DM) / total_data_count 306 | # print(f"T1DM data proportion: {t1dm_proportion:.2%}") 307 | # print(f"T2DM data proportion: {t2dm_proportion:.2%}") 308 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/fine1.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import torch 3 | from torch.utils.tensorboard import SummaryWriter 4 | from dataset import getT1Loader 5 | from TransformerModel import TransformerModel 6 | import torch.nn as nn 7 | import torch.optim as optim 8 | from tqdm import tqdm # 导入tqdm 9 | 10 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 11 | print(device) 12 | 13 | # 获取当前时间戳 14 | timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") 15 | 16 | # 创建一个SummaryWriter实例,使用时间戳作为日志目录的名称 17 | writer = SummaryWriter(f"runs/fine1_train_logs_{timestamp}") 18 | 19 | 20 | def train( 21 | model, 22 | train_loader, 23 | val_loader, 24 | criterion, 25 | optimizer, 26 | num_epochs=20, 27 | ): 28 | model = model.to(device) 29 | criterion = criterion.to(device) 30 | 31 | best_val_loss = float("inf") # 用于保存最佳验证损失 32 | 33 | step = 0 34 | for epoch in range(num_epochs): 35 | model.train() 36 | epoch_loss = 0 37 | 38 | print("Size of the loader: ", len(train_loader)) 39 | for src, tgt in tqdm(train_loader): 40 | src = src.to(device) 41 | tgt = tgt.to(device) 42 | optimizer.zero_grad() 43 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 44 | loss = 0 45 | for t in range(tgt.size(1)): 46 | output = model(src, tgt_input) 47 | loss += criterion(output[:, -1, :], tgt[:, t : t + 1]) 48 | tgt_input = torch.cat((tgt_input, output[:, -1:, :]), dim=1) 49 | loss.backward() 50 | optimizer.step() 51 | epoch_loss += loss.item() 52 | step += 1 53 | writer.add_scalar("Training Loss", loss.item(), step) 54 | avg_train_loss = epoch_loss / len(train_loader) 55 | print(f"Epoch {epoch+1}, Training Loss: {avg_train_loss}") 56 | # 验证集上的损失 57 | model.eval() 58 | val_loss = 0 59 | with torch.no_grad(): 60 | for src, tgt in val_loader: 61 | src = src.to(device) 62 | tgt = tgt.to(device) 63 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 64 | loss = 0 65 | for t in range(tgt.size(1)): 66 | output = model(src, tgt_input) 67 | loss += criterion(output[:, -1, :], tgt[:, t : t + 1]) 68 | tgt_input = torch.cat((tgt_input, output[:, -1:, :]), dim=1) 69 | val_loss += loss.item() 70 | avg_val_loss = val_loss / len(val_loader) 71 | print(f"Epoch {epoch+1}, Validation Loss: {avg_val_loss}") 72 | writer.add_scalar("Validation Loss", avg_val_loss, epoch) # 记录验证损失 73 | 74 | # 如果模型在验证集上表现更好,保存模型 75 | if avg_val_loss < best_val_loss: 76 | best_val_loss = avg_val_loss 77 | torch.save(model.state_dict(), f"models/fine1_best_model_{timestamp}.pth") 78 | print("Model Saved") 79 | 80 | 81 | # 假设getLoader返回的是训练和验证数据加载器 82 | train_loader, val_loader = getT1Loader() 83 | # 获取一个数据批次 84 | data, target = next(iter(train_loader)) 85 | data = data.to(device) 86 | target = target.to(device) 87 | 88 | # 加载预训练模型 89 | pretrained_model_path = "models/best_model_20240613-173832.pth" 90 | pretrained_model = torch.load(pretrained_model_path) 91 | 92 | 93 | model = TransformerModel(input_dim=15, output_dim=1) 94 | model.load_state_dict(pretrained_model) 95 | criterion = nn.L1Loss() 96 | optimizer = optim.Adam(model.parameters(), lr=0.001, weight_decay=0.0001) 97 | 98 | train( 99 | model, 100 | train_loader, 101 | val_loader, 102 | criterion, 103 | optimizer, 104 | num_epochs=20, 105 | ) 106 | 107 | writer.close() # 关闭SummaryWriter 108 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/fine2.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import torch 3 | from torch.utils.tensorboard import SummaryWriter 4 | from dataset import getT2Loader 5 | from TransformerModel import TransformerModel 6 | import torch.nn as nn 7 | import torch.optim as optim 8 | from tqdm import tqdm # 导入tqdm 9 | 10 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 11 | print(device) 12 | 13 | # 获取当前时间戳 14 | timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") 15 | 16 | # 创建一个SummaryWriter实例,使用时间戳作为日志目录的名称 17 | writer = SummaryWriter(f"runs/fine2_train_logs_{timestamp}") 18 | 19 | 20 | def train( 21 | model, 22 | train_loader, 23 | val_loader, 24 | criterion, 25 | optimizer, 26 | scheduler, 27 | num_epochs=20, 28 | ): 29 | model = model.to(device) 30 | criterion = criterion.to(device) 31 | 32 | best_val_loss = float("inf") # 用于保存最佳验证损失 33 | 34 | step = 0 35 | for epoch in range(num_epochs): 36 | model.train() 37 | epoch_loss = 0 38 | 39 | print("Size of the loader: ", len(train_loader)) 40 | for src, tgt in tqdm(train_loader): 41 | src = src.to(device) 42 | tgt = tgt.to(device) 43 | optimizer.zero_grad() 44 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 45 | loss = 0 46 | for t in range(tgt.size(1)): 47 | output = model(src, tgt_input) 48 | loss += criterion(output[:, -1, :], tgt[:, t : t + 1]) 49 | tgt_input = torch.cat((tgt_input, output[:, -1:, :]), dim=1) 50 | loss.backward() 51 | optimizer.step() 52 | epoch_loss += loss.item() 53 | step += 1 54 | writer.add_scalar("Training Loss", loss.item(), step) 55 | scheduler.step() 56 | avg_train_loss = epoch_loss / len(train_loader) 57 | print(f"Epoch {epoch+1}, Training Loss: {avg_train_loss}") 58 | # 验证集上的损失 59 | model.eval() 60 | val_loss = 0 61 | with torch.no_grad(): 62 | for src, tgt in val_loader: 63 | src = src.to(device) 64 | tgt = tgt.to(device) 65 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 66 | loss = 0 67 | for t in range(tgt.size(1)): 68 | output = model(src, tgt_input) 69 | loss += criterion(output[:, -1, :], tgt[:, t : t + 1]) 70 | tgt_input = torch.cat((tgt_input, output[:, -1:, :]), dim=1) 71 | val_loss += loss.item() 72 | avg_val_loss = val_loss / len(val_loader) 73 | print(f"Epoch {epoch+1}, Validation Loss: {avg_val_loss}") 74 | writer.add_scalar("Validation Loss", avg_val_loss, epoch) # 记录验证损失 75 | 76 | # 如果模型在验证集上表现更好,保存模型 77 | if avg_val_loss < best_val_loss: 78 | best_val_loss = avg_val_loss 79 | torch.save(model.state_dict(), f"models/fine2_best_model_{timestamp}.pth") 80 | print("Model Saved") 81 | 82 | 83 | # 假设getLoader返回的是训练和验证数据加载器 84 | train_loader, val_loader = getT2Loader() 85 | # 获取一个数据批次 86 | data, target = next(iter(train_loader)) 87 | data = data.to(device) 88 | target = target.to(device) 89 | 90 | # 加载预训练模型 91 | pretrained_model_path = "models/best_model_20240613-173832.pth" 92 | pretrained_model = torch.load(pretrained_model_path) 93 | 94 | 95 | model = TransformerModel(input_dim=15, output_dim=1) 96 | model.load_state_dict(pretrained_model) 97 | criterion = nn.L1Loss() 98 | optimizer = optim.Adam(model.parameters(), lr=0.001, weight_decay=0.0001) 99 | scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=10, eta_min=1e-5) 100 | 101 | train( 102 | model, 103 | train_loader, 104 | val_loader, 105 | criterion, 106 | optimizer, 107 | scheduler, 108 | num_epochs=20, 109 | ) 110 | 111 | writer.close() # 关闭SummaryWriter 112 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/main.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import torch 3 | from torch.utils.tensorboard import SummaryWriter 4 | from dataset import getLoader 5 | from TransformerModel import TransformerModel 6 | import torch.nn as nn 7 | import torch.optim as optim 8 | from tqdm import tqdm # 导入tqdm 9 | 10 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 11 | print(device) 12 | 13 | # 获取当前时间戳 14 | timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") 15 | 16 | # 创建一个SummaryWriter实例,使用时间戳作为日志目录的名称 17 | writer = SummaryWriter(f"runs/train_logs_{timestamp}") 18 | 19 | 20 | def train( 21 | model, 22 | train_loader, 23 | val_loader, 24 | criterion, 25 | optimizer, 26 | scheduler, 27 | num_epochs=20, 28 | ): 29 | model = model.to(device) 30 | criterion = criterion.to(device) 31 | 32 | best_val_loss = float("inf") # 用于保存最佳验证损失 33 | 34 | step = 0 35 | for epoch in range(num_epochs): 36 | model.train() 37 | epoch_loss = 0 38 | 39 | print("Size of the loader: ", len(train_loader)) 40 | for src, tgt in tqdm(train_loader): 41 | src = src.to(device) 42 | tgt = tgt.to(device) 43 | optimizer.zero_grad() 44 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 45 | loss = 0 46 | for t in range(tgt.size(1)): 47 | output = model(src, tgt_input) 48 | loss += criterion(output[:, -1, :], tgt[:, t : t + 1]) 49 | tgt_input = torch.cat((tgt_input, output[:, -1:, :]), dim=1) 50 | loss.backward() 51 | optimizer.step() 52 | epoch_loss += loss.item() 53 | step += 1 54 | writer.add_scalar("Training Loss", loss.item(), step) 55 | scheduler.step() 56 | avg_train_loss = epoch_loss / len(train_loader) 57 | print(f"Epoch {epoch+1}, Training Loss: {avg_train_loss}") 58 | # 验证集上的损失 59 | model.eval() 60 | val_loss = 0 61 | with torch.no_grad(): 62 | for src, tgt in val_loader: 63 | src = src.to(device) 64 | tgt = tgt.to(device) 65 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 66 | loss = 0 67 | for t in range(tgt.size(1)): 68 | output = model(src, tgt_input) 69 | loss += criterion(output[:, -1, :], tgt[:, t : t + 1]) 70 | tgt_input = torch.cat((tgt_input, output[:, -1:, :]), dim=1) 71 | val_loss += loss.item() 72 | avg_val_loss = val_loss / len(val_loader) 73 | print(f"Epoch {epoch+1}, Validation Loss: {avg_val_loss}") 74 | writer.add_scalar("Validation Loss", avg_val_loss, epoch) # 记录验证损失 75 | 76 | # 如果模型在验证集上表现更好,保存模型 77 | if avg_val_loss < best_val_loss: 78 | best_val_loss = avg_val_loss 79 | torch.save(model.state_dict(), f"models/best_model_{timestamp}.pth") 80 | print("Model Saved") 81 | 82 | 83 | # 假设getLoader返回的是训练和验证数据加载器 84 | train_loader, val_loader = getLoader() 85 | # 获取一个数据批次 86 | data, target = next(iter(train_loader)) 87 | data = data.to(device) 88 | target = target.to(device) 89 | 90 | 91 | model = TransformerModel(input_dim=15, output_dim=1) 92 | criterion = nn.MSELoss() 93 | optimizer = optim.Adam(model.parameters(), lr=0.001, weight_decay=0.0001) 94 | scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=10, eta_min=1e-5) 95 | 96 | 97 | train( 98 | model, 99 | train_loader, 100 | val_loader, 101 | criterion, 102 | optimizer, 103 | scheduler, 104 | num_epochs=20, 105 | ) 106 | 107 | writer.close() # 关闭SummaryWriter 108 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/fine1_train_logs_20240613-205402/events.out.tfevents.1718283242.Momoyama.3504.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/fine1_train_logs_20240613-205402/events.out.tfevents.1718283242.Momoyama.3504.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/fine2_train_logs_20240613-205827/events.out.tfevents.1718283507.Momoyama.40912.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/fine2_train_logs_20240613-205827/events.out.tfevents.1718283507.Momoyama.40912.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/fine2_train_logs_20240613-205851/events.out.tfevents.1718283531.Momoyama.27888.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/fine2_train_logs_20240613-205851/events.out.tfevents.1718283531.Momoyama.27888.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/fine_train_logs_20240613-204045/events.out.tfevents.1718282445.Momoyama.7580.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/fine_train_logs_20240613-204045/events.out.tfevents.1718282445.Momoyama.7580.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-151820/events.out.tfevents.1718263100.Momoyama.23272.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-151820/events.out.tfevents.1718263100.Momoyama.23272.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-154310/events.out.tfevents.1718264590.Momoyama.3148.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-154310/events.out.tfevents.1718264590.Momoyama.3148.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-155119/events.out.tfevents.1718265079.Momoyama.1984.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-155119/events.out.tfevents.1718265079.Momoyama.1984.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-155918/events.out.tfevents.1718265558.Momoyama.21508.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-155918/events.out.tfevents.1718265558.Momoyama.21508.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-163857/events.out.tfevents.1718267937.Momoyama.32832.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-163857/events.out.tfevents.1718267937.Momoyama.32832.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-170052/events.out.tfevents.1718269252.Momoyama.10916.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-170052/events.out.tfevents.1718269252.Momoyama.10916.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-171248/events.out.tfevents.1718269968.Momoyama.22404.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-171248/events.out.tfevents.1718269968.Momoyama.22404.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-172139/events.out.tfevents.1718270499.Momoyama.25060.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-172139/events.out.tfevents.1718270499.Momoyama.25060.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-173832/events.out.tfevents.1718271512.Momoyama.9588.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-173832/events.out.tfevents.1718271512.Momoyama.9588.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-185524/events.out.tfevents.1718276124.Momoyama.11480.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-185524/events.out.tfevents.1718276124.Momoyama.11480.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-201416/events.out.tfevents.1718280856.Momoyama.33460.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240613-201416/events.out.tfevents.1718280856.Momoyama.33460.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240614-113015/events.out.tfevents.1718335815.Momoyama.24408.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/code/Transformer/runs/train_logs_20240614-113015/events.out.tfevents.1718335815.Momoyama.24408.0 -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/test.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from dataset import getLoader, getT1Loader, getT2Loader 3 | from TransformerModel import TransformerModel 4 | import torch.nn as nn 5 | 6 | # 定义设备 7 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 8 | 9 | # 加载训练好的模型 10 | model = TransformerModel(input_dim=15, output_dim=1) 11 | model.load_state_dict( 12 | torch.load("models/best_model_20240614-113015.pth") 13 | ) # 将 替换为实际的时间戳 14 | model = model.to(device) 15 | 16 | # 定义损失函数 17 | criterion = nn.L1Loss() # 使用MAE 18 | 19 | mse_criterion = nn.MSELoss() # 使用MSE 20 | 21 | # 获取数据加载器 22 | train_loader, val_loader = getLoader() 23 | 24 | # 在验证集上进行预测并分别计算每个时间点的MAE 25 | model.eval() 26 | total_losses = [0, 0, 0, 0] 27 | total_mses = [0, 0, 0, 0] 28 | counts = [0, 0, 0, 0] 29 | 30 | with torch.no_grad(): 31 | for src, tgt in val_loader: 32 | src = src.to(device) 33 | tgt = tgt.to(device) 34 | tgt_input = torch.zeros((tgt.size(0), 1, 1), device=src.device) 35 | predictions = [] 36 | for _ in range(tgt.size(1)): 37 | output = model(src, tgt_input) 38 | next_value = output[:, -1:, :] 39 | predictions.append(next_value) 40 | tgt_input = torch.cat((tgt_input, next_value), dim=1) 41 | predictions = torch.cat(predictions, dim=1) 42 | 43 | # 调整 predictions 的形状 44 | predictions = predictions.squeeze(-1) # 从 [32, 4, 1] 变为 [32, 4] 45 | 46 | # 计算每个时间点的MAE 47 | for t in range(tgt.size(1)): 48 | loss = criterion(predictions[:, t], tgt[:, t]) 49 | mse_loss = mse_criterion(predictions[:, t], tgt[:, t]) 50 | total_losses[t] += loss.item() * tgt.size(0) 51 | total_mses[t] += mse_loss.item() * tgt.size(0) 52 | counts[t] += tgt.size(0) 53 | 54 | # 平均MAE 55 | avg_maes = [total_losses[t] / counts[t] for t in range(4)] 56 | 57 | avg_mses = [total_mses[t] / counts[t] for t in range(4)] 58 | 59 | maes = 0 60 | mses = 0 61 | for t, mae in enumerate(avg_maes): 62 | maes += mae 63 | print(f"Average MAE at time point {t+1}: {mae}") 64 | 65 | print(f"Overall MAE: {maes / 4}") 66 | 67 | for t, mse in enumerate(avg_mses): 68 | mses += mse 69 | print(f"Average MSE at time point {t+1}: {mse}") 70 | 71 | print(f"Overall MSE: {mses / 4}") 72 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/test_gradient.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from dataset import getLoader, getT1Loader, getT2Loader 3 | from TransformerModel import TransformerModel 4 | import torch.nn as nn 5 | import matplotlib.pyplot as plt 6 | import numpy as np 7 | 8 | # 定义设备 9 | device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 10 | 11 | # 加载训练好的模型 12 | model = TransformerModel(input_dim=15, output_dim=1) 13 | model.load_state_dict( 14 | torch.load("models/best_model_20240614-113015.pth") 15 | ) # 将 替换为实际的时间戳 16 | model = model.to(device) 17 | 18 | # 定义损失函数 19 | criterion = nn.L1Loss() # 使用MAE 20 | mse_criterion = nn.MSELoss() # 使用MSE 21 | 22 | # 获取数据加载器 23 | train_loader, val_loader = getLoader() 24 | 25 | 26 | # 计算梯度贡献度 27 | def calculate_gradients(model, inputs, targets): 28 | model.eval() 29 | inputs = inputs.to(device).requires_grad_(True) 30 | targets = targets.to(device) 31 | 32 | outputs = model(inputs, torch.zeros((inputs.size(0), 1, 1), device=device)) 33 | loss = criterion(outputs[:, -1, :], targets[:, -1]) 34 | model.zero_grad() 35 | loss.backward() 36 | 37 | gradients = inputs.grad.data.cpu().numpy() 38 | return gradients 39 | 40 | 41 | # 初始化存储梯度贡献度的数组 42 | gradient_contributions = None 43 | 44 | # 计算验证集上的梯度贡献度 45 | with torch.no_grad(): 46 | for src, tgt in val_loader: 47 | src = src.to(device) 48 | tgt = tgt.to(device) 49 | 50 | gradients = calculate_gradients(model, src, tgt) 51 | 52 | if gradient_contributions is None: 53 | gradient_contributions = gradients 54 | else: 55 | gradient_contributions += gradients 56 | 57 | # 平均梯度贡献度 58 | gradient_contributions /= len(val_loader) 59 | 60 | # 可视化梯度贡献度 61 | time_series_features = [ 62 | "CGM (mg / dl)", 63 | "Insulin dose - s.c.", 64 | "CSII - bolus insulin (Novolin R, IU)", 65 | "Carbohydrate/g", 66 | ] 67 | static_features = [ 68 | "type", 69 | "patient_id", 70 | "Age (years)", 71 | "Weight (kg)", 72 | "BMI (kg/m2)", 73 | "Duration of Diabetes (years)", 74 | "HbA1c (mmol/mol)", 75 | "Fasting Plasma Glucose (mg/dl)", 76 | "2-hour Postprandial C-peptide (nmol/L)", 77 | "Fasting C-peptide (nmol/L)", 78 | "Glycated Albumin (%)", 79 | "Acute Diabetic Complications", 80 | "Diabetic Macrovascular Complications", 81 | "Diabetic Microvascular Complications", 82 | "Comorbidities", 83 | "Hypoglycemic Agents", 84 | "Other Agents", 85 | ] 86 | 87 | # 对时间序列特征和静态特征分别计算梯度贡献度的均值 88 | avg_time_series_gradients = np.mean(gradient_contributions, axis=(0, 2)) 89 | avg_static_gradients = np.mean(gradient_contributions, axis=(0, 1)) 90 | 91 | # 绘制时间序列特征的梯度贡献度 92 | plt.figure(figsize=(12, 6)) 93 | plt.bar(range(len(time_series_features)), avg_time_series_gradients, align="center") 94 | plt.xticks(range(len(time_series_features)), time_series_features, rotation=90) 95 | plt.xlabel("时间序列特征") 96 | plt.ylabel("梯度贡献度") 97 | plt.title("时间序列特征的梯度贡献度") 98 | plt.show() 99 | 100 | # 绘制静态特征的梯度贡献度 101 | plt.figure(figsize=(12, 6)) 102 | plt.bar(range(len(static_features)), avg_static_gradients, align="center") 103 | plt.xticks(range(len(static_features)), static_features, rotation=90) 104 | plt.xlabel("静态特征") 105 | plt.ylabel("梯度贡献度") 106 | plt.title("静态特征的梯度贡献度") 107 | plt.show() 108 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/code/Transformer/transformer_preprossing.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "text/plain": [ 11 | "((650, 4, 15),\n", 12 | " (650, 4),\n", 13 | " array([[[ 1.13400000e+02, 0.00000000e+00, 3.00000000e-01,\n", 14 | " 0.00000000e+00, -9.44089020e-01, -3.29690645e-01,\n", 15 | " 1.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n", 16 | " 0.00000000e+00, 1.00000000e+01, 3.52800000e+02,\n", 17 | " 3.63955000e+02, 1.15311000e+02, 4.07000000e+01],\n", 18 | " [ 1.24200000e+02, 0.00000000e+00, 3.00000000e-01,\n", 19 | " 0.00000000e+00, -9.63630453e-01, -2.67238376e-01,\n", 20 | " 1.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n", 21 | " 0.00000000e+00, 1.00000000e+01, 3.52800000e+02,\n", 22 | " 3.63955000e+02, 1.15311000e+02, 4.07000000e+01],\n", 23 | " [ 1.29600000e+02, 0.00000000e+00, 3.00000000e-01,\n", 24 | " 6.65100000e+01, -9.79045472e-01, -2.03641751e-01,\n", 25 | " 1.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n", 26 | " 0.00000000e+00, 1.00000000e+01, 3.52800000e+02,\n", 27 | " 3.63955000e+02, 1.15311000e+02, 4.07000000e+01],\n", 28 | " [ 1.42200000e+02, 0.00000000e+00, 3.00000000e-01,\n", 29 | " 0.00000000e+00, -9.90268069e-01, -1.39173101e-01,\n", 30 | " 1.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n", 31 | " 0.00000000e+00, 1.00000000e+01, 3.52800000e+02,\n", 32 | " 3.63955000e+02, 1.15311000e+02, 4.07000000e+01]]]),\n", 33 | " array([[156.6, 162. , 163.8, 165.6]]))" 34 | ] 35 | }, 36 | "execution_count": 2, 37 | "metadata": {}, 38 | "output_type": "execute_result" 39 | } 40 | ], 41 | "source": [ 42 | "import pandas as pd\n", 43 | "import numpy as np\n", 44 | "\n", 45 | "\n", 46 | "# 定义处理单个文件的函数\n", 47 | "def process_file(file_path, window_size=4):\n", 48 | " data = pd.read_csv(file_path)\n", 49 | "\n", 50 | " # 获取所有特征,删除Date列\n", 51 | " features = data.drop(columns=[\"Date\"]).values\n", 52 | " targets = data[\"CGM (mg / dl)\"].values\n", 53 | "\n", 54 | " X = []\n", 55 | " y = []\n", 56 | "\n", 57 | " for i in range(len(data) - 2 * window_size):\n", 58 | " X.append(features[i : i + window_size]) # 保持时间窗口内的特征维度\n", 59 | " y.append(\n", 60 | " targets[i + window_size : i + 2 * window_size]\n", 61 | " ) # 目标是下四个时间点的血糖值\n", 62 | "\n", 63 | " return np.array(X), np.array(y)\n", 64 | "\n", 65 | "\n", 66 | "# 测试处理单个文件\n", 67 | "file_path = \"dataset/T1DM/1001_0_20210730.csv\"\n", 68 | "X, y = process_file(file_path)\n", 69 | "\n", 70 | "X.shape, y.shape, X[:1], y[:1]" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": 4, 76 | "metadata": {}, 77 | "outputs": [ 78 | { 79 | "name": "stdout", 80 | "output_type": "stream", 81 | "text": [ 82 | "All X shape: (127170, 4, 15)\n", 83 | "All y shape: (127170, 4)\n", 84 | "Sample X: [[[ 1.13400000e+02 0.00000000e+00 3.00000000e-01 0.00000000e+00\n", 85 | " -9.44089020e-01 -3.29690645e-01 1.00000000e+00 0.00000000e+00\n", 86 | " 0.00000000e+00 0.00000000e+00 1.00000000e+01 3.52800000e+02\n", 87 | " 3.63955000e+02 1.15311000e+02 4.07000000e+01]\n", 88 | " [ 1.24200000e+02 0.00000000e+00 3.00000000e-01 0.00000000e+00\n", 89 | " -9.63630453e-01 -2.67238376e-01 1.00000000e+00 0.00000000e+00\n", 90 | " 0.00000000e+00 0.00000000e+00 1.00000000e+01 3.52800000e+02\n", 91 | " 3.63955000e+02 1.15311000e+02 4.07000000e+01]\n", 92 | " [ 1.29600000e+02 0.00000000e+00 3.00000000e-01 6.65100000e+01\n", 93 | " -9.79045472e-01 -2.03641751e-01 1.00000000e+00 0.00000000e+00\n", 94 | " 0.00000000e+00 0.00000000e+00 1.00000000e+01 3.52800000e+02\n", 95 | " 3.63955000e+02 1.15311000e+02 4.07000000e+01]\n", 96 | " [ 1.42200000e+02 0.00000000e+00 3.00000000e-01 0.00000000e+00\n", 97 | " -9.90268069e-01 -1.39173101e-01 1.00000000e+00 0.00000000e+00\n", 98 | " 0.00000000e+00 0.00000000e+00 1.00000000e+01 3.52800000e+02\n", 99 | " 3.63955000e+02 1.15311000e+02 4.07000000e+01]]]\n", 100 | "Sample y: [[156.6 162. 163.8 165.6]]\n", 101 | "Data proportion from dataset/T1DM/: 12.24%\n", 102 | "Data proportion from dataset/T2DM: 87.76%\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "import pandas as pd\n", 108 | "import numpy as np\n", 109 | "import os\n", 110 | "\n", 111 | "\n", 112 | "# 定义处理单个文件的函数\n", 113 | "def process_file(file_path, window_size=4):\n", 114 | " data = pd.read_csv(file_path)\n", 115 | "\n", 116 | " # 获取所有特征,删除Date列\n", 117 | " features = data.drop(columns=[\"Date\"]).values\n", 118 | " targets = data[\"CGM (mg / dl)\"].values\n", 119 | "\n", 120 | " X = []\n", 121 | " y = []\n", 122 | "\n", 123 | " for i in range(len(data) - 2 * window_size):\n", 124 | " X.append(features[i : i + window_size]) # 保持时间窗口内的特征维度\n", 125 | " y.append(\n", 126 | " targets[i + window_size : i + 2 * window_size]\n", 127 | " ) # 目标是下四个时间点的血糖值\n", 128 | "\n", 129 | " return np.array(X), np.array(y)\n", 130 | "\n", 131 | "\n", 132 | "# 文件夹路径\n", 133 | "directory_paths = [\"dataset/T1DM\", \"dataset/T2DM\"]\n", 134 | "\n", 135 | "# 处理所有CSV文件并组合结果\n", 136 | "all_X = []\n", 137 | "all_y = []\n", 138 | "\n", 139 | "# 用于存储每个文件夹中的数据量\n", 140 | "folder_data_counts = {}\n", 141 | "\n", 142 | "for directory_path in directory_paths:\n", 143 | " folder_X = []\n", 144 | " folder_y = []\n", 145 | " for filename in os.listdir(directory_path):\n", 146 | " if filename.endswith(\".csv\"):\n", 147 | " file_path = os.path.join(directory_path, filename)\n", 148 | " try:\n", 149 | " X, y = process_file(file_path)\n", 150 | " folder_X.append(X)\n", 151 | " folder_y.append(y)\n", 152 | " except Exception as e:\n", 153 | " print(f\"Error processing file {filename} in {directory_path}: {e}\")\n", 154 | "\n", 155 | " # 记录每个文件夹中的数据量\n", 156 | " folder_X = np.concatenate(folder_X, axis=0)\n", 157 | " folder_y = np.concatenate(folder_y, axis=0)\n", 158 | " folder_data_counts[directory_path] = len(folder_X)\n", 159 | "\n", 160 | " all_X.append(folder_X)\n", 161 | " all_y.append(folder_y)\n", 162 | "\n", 163 | "all_X = np.concatenate(all_X, axis=0)\n", 164 | "all_y = np.concatenate(all_y, axis=0)\n", 165 | "\n", 166 | "# 显示结果数据的形状\n", 167 | "print(\"All X shape:\", all_X.shape)\n", 168 | "print(\"All y shape:\", all_y.shape)\n", 169 | "\n", 170 | "# 检查前几个样本\n", 171 | "print(\"Sample X:\", all_X[:1])\n", 172 | "print(\"Sample y:\", all_y[:1])\n", 173 | "\n", 174 | "# 计算并显示各文件夹数据的比重\n", 175 | "total_data_count = len(all_X)\n", 176 | "for folder, count in folder_data_counts.items():\n", 177 | " proportion = count / total_data_count\n", 178 | " print(f\"Data proportion from {folder}: {proportion:.2%}\")" 179 | ] 180 | }, 181 | { 182 | "cell_type": "code", 183 | "execution_count": 2, 184 | "metadata": {}, 185 | "outputs": [ 186 | { 187 | "name": "stdout", 188 | "output_type": "stream", 189 | "text": [ 190 | "All X shape: (83558, 4, 15)\n", 191 | "All y shape: (83558, 4)\n", 192 | "Sample X: [[[ 1.51200000e+02 0.00000000e+00 9.00000000e-01 0.00000000e+00\n", 193 | " 8.92978943e-01 -4.50098441e-01 0.00000000e+00 0.00000000e+00\n", 194 | " 0.00000000e+00 2.00000000e+00 2.60000000e+01 1.81800000e+02\n", 195 | " 7.54710000e+02 6.94050000e+01 1.96000000e+01]\n", 196 | " [ 1.42200000e+02 0.00000000e+00 6.00000000e-01 0.00000000e+00\n", 197 | " 8.61629160e-01 -5.07538363e-01 0.00000000e+00 0.00000000e+00\n", 198 | " 0.00000000e+00 2.00000000e+00 2.60000000e+01 1.81800000e+02\n", 199 | " 7.54710000e+02 6.94050000e+01 1.96000000e+01]\n", 200 | " [ 1.31400000e+02 0.00000000e+00 6.00000000e-01 0.00000000e+00\n", 201 | " 8.26589749e-01 -5.62804928e-01 0.00000000e+00 0.00000000e+00\n", 202 | " 0.00000000e+00 2.00000000e+00 2.60000000e+01 1.81800000e+02\n", 203 | " 7.54710000e+02 6.94050000e+01 1.96000000e+01]\n", 204 | " [ 1.13400000e+02 0.00000000e+00 6.00000000e-01 0.00000000e+00\n", 205 | " 7.88010754e-01 -6.15661475e-01 0.00000000e+00 0.00000000e+00\n", 206 | " 0.00000000e+00 2.00000000e+00 2.60000000e+01 1.81800000e+02\n", 207 | " 7.54710000e+02 6.94050000e+01 1.96000000e+01]]]\n", 208 | "Sample y: [[97.2 82.8 70.2 63. ]]\n", 209 | "Data proportion from dataset/T1DM: 46.57%\n", 210 | "Data proportion from dataset/T2DM: 53.43%\n" 211 | ] 212 | } 213 | ], 214 | "source": [ 215 | "import pandas as pd\n", 216 | "import numpy as np\n", 217 | "import os\n", 218 | "\n", 219 | "\n", 220 | "# 定义处理单个文件的函数\n", 221 | "def process_file(file_path, window_size=4):\n", 222 | " data = pd.read_csv(file_path)\n", 223 | "\n", 224 | " # 获取所有特征,删除Date列\n", 225 | " features = data.drop(columns=[\"Date\"]).values\n", 226 | " targets = data[\"CGM (mg / dl)\"].values\n", 227 | "\n", 228 | " X = []\n", 229 | " y = []\n", 230 | "\n", 231 | " for i in range(len(data) - 2 * window_size):\n", 232 | " X.append(features[i : i + window_size]) # 保持时间窗口内的特征维度\n", 233 | " y.append(\n", 234 | " targets[i + window_size : i + 2 * window_size]\n", 235 | " ) # 目标是下四个时间点的血糖值\n", 236 | "\n", 237 | " return np.array(X), np.array(y)\n", 238 | "\n", 239 | "\n", 240 | "# 文件夹路径\n", 241 | "directory_paths = [\"dataset/T1DM\", \"dataset/T2DM\"]\n", 242 | "\n", 243 | "# 处理所有CSV文件并组合结果\n", 244 | "all_X = []\n", 245 | "all_y = []\n", 246 | "\n", 247 | "# 用于存储每个文件夹中的数据量\n", 248 | "folder_data_counts = {}\n", 249 | "\n", 250 | "for directory_path in directory_paths:\n", 251 | " folder_X = []\n", 252 | " folder_y = []\n", 253 | " for filename in os.listdir(directory_path):\n", 254 | " if filename.endswith(\".csv\"):\n", 255 | " file_path = os.path.join(directory_path, filename)\n", 256 | " try:\n", 257 | " X, y = process_file(file_path)\n", 258 | " folder_X.append(X)\n", 259 | " folder_y.append(y)\n", 260 | " except Exception as e:\n", 261 | " print(f\"Error processing file {filename} in {directory_path}: {e}\")\n", 262 | "\n", 263 | " # 合并文件夹内的所有数据\n", 264 | " folder_X = np.concatenate(folder_X, axis=0)\n", 265 | " folder_y = np.concatenate(folder_y, axis=0)\n", 266 | "\n", 267 | " # 对T1DM数据进行随机上采样2.5倍\n", 268 | " if \"T1DM\" in directory_path:\n", 269 | " upsample_indices = np.random.choice(\n", 270 | " len(folder_X), size=int(len(folder_X) * 2.5), replace=True\n", 271 | " )\n", 272 | " folder_X = folder_X[upsample_indices]\n", 273 | " folder_y = folder_y[upsample_indices]\n", 274 | "\n", 275 | " # 对T2DM数据进行随机下采样40%\n", 276 | " if \"T2DM\" in directory_path:\n", 277 | " sample_indices = np.random.choice(\n", 278 | " len(folder_X), size=int(len(folder_X) * 0.4), replace=False\n", 279 | " )\n", 280 | " folder_X = folder_X[sample_indices]\n", 281 | " folder_y = folder_y[sample_indices]\n", 282 | "\n", 283 | " # 记录每个文件夹中的数据量(采样后)\n", 284 | " folder_data_counts[directory_path] = len(folder_X)\n", 285 | "\n", 286 | " all_X.append(folder_X)\n", 287 | " all_y.append(folder_y)\n", 288 | "\n", 289 | "all_X = np.concatenate(all_X, axis=0)\n", 290 | "all_y = np.concatenate(all_y, axis=0)\n", 291 | "\n", 292 | "# 显示结果数据的形状\n", 293 | "print(\"All X shape:\", all_X.shape)\n", 294 | "print(\"All y shape:\", all_y.shape)\n", 295 | "\n", 296 | "# 检查前几个样本\n", 297 | "print(\"Sample X:\", all_X[:1])\n", 298 | "print(\"Sample y:\", all_y[:1])\n", 299 | "\n", 300 | "# 计算并显示各文件夹数据的比重(采样后)\n", 301 | "total_data_count = len(all_X)\n", 302 | "for folder, count in folder_data_counts.items():\n", 303 | " proportion = count / total_data_count\n", 304 | " print(f\"Data proportion from {folder}: {proportion:.2%}\")" 305 | ] 306 | }, 307 | { 308 | "cell_type": "code", 309 | "execution_count": null, 310 | "metadata": {}, 311 | "outputs": [], 312 | "source": [] 313 | } 314 | ], 315 | "metadata": { 316 | "kernelspec": { 317 | "display_name": "base", 318 | "language": "python", 319 | "name": "python3" 320 | }, 321 | "language_info": { 322 | "codemirror_mode": { 323 | "name": "ipython", 324 | "version": 3 325 | }, 326 | "file_extension": ".py", 327 | "mimetype": "text/x-python", 328 | "name": "python", 329 | "nbconvert_exporter": "python", 330 | "pygments_lexer": "ipython3", 331 | "version": "3.11.5" 332 | } 333 | }, 334 | "nbformat": 4, 335 | "nbformat_minor": 2 336 | } 337 | -------------------------------------------------------------------------------- /期末项目/血糖时间序列预测/report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/血糖时间序列预测/report.pdf -------------------------------------------------------------------------------- /期末项目/论文.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deidei1210/Data-Analysis-and-Data-Mining-2024-Spring/3f0209cf5b32ff08819da8e9b2182683a6f66ad0/期末项目/论文.pdf --------------------------------------------------------------------------------