跨行查找关系的 ML 模型
Posted
技术标签:
【中文标题】跨行查找关系的 ML 模型【英文标题】:ML model that finds relationships across the rows 【发布时间】:2021-10-26 11:59:35 【问题描述】:我从网球比赛video 中提取了一个球的 x,y 坐标 附言x,y坐标格式如下
coords2 = [(985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (985.0, 325.0), (978.0, 345.0), (969.8571428571429, 375.0), (961.7142857142857, 405.0), (953.5714285714286, 435.0), (945.4285714285714, 465.0), (937.2857142857143, 495.0), (929.1428571428571, 525.0), (921.0, 555.0), (918.0, 574.0), (918.0, 574.0), (904.0, 613.0), (895.0, 644.0), (886.0, 649.0), (877.0, 654.0), (870.0, 658.0), (870.0, 658.0), (861.0, 664.0), (853.0, 672.0), (846.0, 679.0), (837.0, 688.0), (827.0, 695.0), (827.0, 695.0), (821.0, 707.0), (812.0, 716.0), (803.3333333333334, 729.0), (794.6666666666666, 742.0), (786.0, 755.0), (786.0, 755.0), (782.0, 769.0), (782.0, 746.0), (786.0, 730.0), (793.0, 700.0), (800.0, 677.0), (800.0, 677.0), (803.0, 656.0), (807.0, 640.0), (814.0, 620.0), (819.0, 593.0), (819.0, 579.0), (819.0, 579.0), (825.0, 562.0), (831.0, 546.0), (834.0, 532.0), (833.5, 668.5), (833.0, 805.0), (833.0, 805.0), (837.5714285714286, 751.0), (842.1428571428571, 697.0), (846.7142857142857, 643.0), (851.2857142857143, 589.0), (855.8571428571429, 535.0), (860.4285714285714, 481.0), (865.0, 427.0), (867.0, 418.0), (871.0, 409.0), (872.0, 400.0), (877.0, 392.0), (877.0, 392.0), (877.0, 385.0), (883.0, 377.0), (883.0, 369.0), (887.0, 366.0), (890.0, 358.0), (890.0, 357.0), (892.0, 352.0), (894.0, 346.0), (897.0, 340.0), (898.0, 336.0), (900.0, 332.0), (900.0, 332.0), (902.0, 329.0), (905.0, 325.0), (905.0, 322.0), (908.0, 320.0), (910.0, 316.0), (910.0, 316.0), (912.0, 315.0), (914.0, 314.0), (916.0, 310.0), (919.0, 308.0), (919.0, 306.0), (919.0, 306.0), (920.0, 305.0), (924.0, 306.0), (922.0, 306.0), (926.0, 305.0), (928.0, 305.0), (926.0, 307.0), (930.0, 306.0), (930.0, 305.0), (932.0, 305.0), (933.0, 307.0), (935.0, 310.0), (935.0, 308.0), (936.0, 310.0), (937.0, 313.0), (938.0, 314.0), (940.0, 316.0), (942.0, 319.0), (942.0, 319.0), (942.0, 322.0), (943.0, 323.0), (945.0, 324.0), (946.0, 316.0), (945.0, 306.0), (945.0, 306.0), (945.0, 298.0), (946.0, 291.0), (947.0, 284.0), (947.0, 278.0), (950.0, 272.0), (949.0, 273.0), (950.0, 266.0), (951.0, 261.0), (950.0, 255.0), (950.0, 251.0), (951.0, 245.0), (951.0, 245.0), (953.0, 241.0), (952.0, 237.0), (950.0, 236.0), (945.0, 237.0), (939.0, 240.0), (938.0, 239.0), (934.0, 242.0), (928.0, 244.0), (922.0, 250.0), (917.0, 252.0), (911.0, 256.0), (911.0, 256.0), (905.0, 263.0), (899.0, 267.0), (896.0, 274.0), (890.0, 278.0), (883.0, 286.0), (883.0, 286.0), (878.0, 293.0), (873.0, 300.0), (869.0, 309.0), (863.0, 318.0), (858.0, 329.0), (858.0, 329.0), (851.0, 338.0), (846.0, 349.0), (840.0, 359.0), (835.0, 371.0), (830.0, 384.0), (830.0, 384.0), (825.0, 397.0), (818.0, 410.0), (812.0, 424.0), (807.25, 437.875), (802.5, 451.75), (797.75, 465.625), (793.0, 479.5), (788.25, 493.375), (783.5, 507.25), (778.75, 521.125), (774.0, 535.0), (773.0, 537.0), (768.0, 550.0), (761.0, 572.0), (754.0, 592.0), (750.0, 615.0), (748.0, 624.0), (748.0, 624.0), (739.0, 652.0), (733.0, 674.0), (728.0, 698.0), (727.0, 718.0), (718.0, 733.0), (718.0, 733.0), (714.0, 732.0), (709.0, 729.0), (705.0, 728.0), (702.0, 729.0), (694.0, 728.0), (696.0, 728.0), (692.0, 728.0), (688.0, 730.0), (684.0, 730.0), (678.0, 731.0), (675.0, 734.0), (675.0, 734.0), (673.0, 737.0), (667.0, 741.0), (664.0, 743.0), (659.0, 749.0), (653.0, 755.0), (653.0, 755.0), (650.0, 759.0), (647.0, 765.0), (642.0, 774.0), (636.0, 780.0), (633.0, 786.0), (633.0, 787.0), (630.0, 796.0), (625.0, 804.0), (629.0, 769.0), (634.0, 737.0), (633.0, 718.0), (633.0, 718.0), (640.0, 697.0), (644.0, 657.0), (649.0, 640.0), (651.0, 616.0), (655.0, 592.0), (654.0, 591.0), (654.0, 578.0), (656.0, 560.0), (659.0, 544.0), (662.0, 525.0), (663.5, 514.25), (665.0, 503.5), (666.5, 492.75), (668.0, 482.0), (670.3333333333334, 470.6666666666667), (672.6666666666666, 459.3333333333333), (675.0, 448.0), (675.0, 448.0), (676.0, 437.5), (677.0, 427.0), (677.0, 419.0), (678.0, 410.0), (678.0, 404.0), (678.0, 404.0), (679.0, 394.0), (682.0, 394.0), (682.0, 385.0), (682.0, 380.0), (683.0, 374.0), (683.0, 374.0), (684.0, 370.0), (684.0, 367.0), (684.0, 364.0), (685.0, 361.0), (686.0, 359.0), (686.0, 359.0), (686.0, 357.0), (686.0, 356.0), (687.0, 353.0), (686.0, 353.0), (687.0, 352.0), (687.0, 352.0), (688.0, 350.0), (687.0, 339.0), (685.0, 329.0), (687.0, 318.0), (686.0, 309.0), (687.0, 309.0), (681.0, 300.0), (686.0, 293.0), (688.0, 283.0), (689.0, 273.0), (688.0, 268.0), (689.0, 270.0), (689.0, 261.0), (688.0, 256.0), (688.0, 250.0), (689.0, 243.0), (688.0, 238.0), (688.0, 238.0), (690.0, 237.0), (690.0, 231.0), (690.0, 228.0), (691.0, 226.0), (696.0, 227.0), (699.0, 226.0), (705.0, 227.0), (710.3, 227.7), (715.6, 228.4), (720.9, 229.1), (726.2, 229.8), (731.5, 230.5), (736.8, 231.2), (742.1, 231.9), (747.4, 232.6), (752.7, 233.3), (758.0, 234.0), (758.0, 234.0), (762.0, 239.0), (769.0, 241.0), (775.0, 243.0), (780.0, 246.0), (787.0, 250.0), (787.0, 250.0), (793.0, 253.0), (800.0, 256.0), (806.0, 261.0), (812.0, 263.0), (820.0, 266.0), (820.0, 266.0), (826.0, 271.0), (832.0, 274.0), (840.0, 279.0), (845.0, 283.0), (851.0, 289.0), (852.0, 289.0), (858.0, 296.0), (866.0, 299.0), (874.0, 306.0), (879.0, 312.0), (888.0, 318.0), (888.0, 318.0), (893.0, 323.0), (900.0, 330.0), (908.0, 338.0), (914.0, 344.0), (922.0, 350.0), (922.0, 350.0), (928.0, 360.0), (937.0, 367.0), (945.0, 378.0), (950.0, 384.0), (955.6666666666666, 390.0), (961.3333333333334, 396.0), (967.0, 402.0), (974.0, 411.0), (980.0, 421.0), (989.0, 428.0), (995.5, 437.0), (1002.0, 446.0), (1008.5, 455.0), (1015.0, 464.0), (1021.5, 473.0), (1028.0, 482.0), (1034.5, 491.0), (1041.0, 500.0), (1047.5, 509.0), (1054.0, 518.0), (1061.0, 533.0), (1066.0, 543.0), (1076.0, 557.0), (1077.0, 558.0), (1087.0, 569.0), (1093.0, 585.0), (1101.0, 601.0), (1110.0, 614.0), (1119.0, 629.0), (1119.0, 629.0), (1128.0, 642.0), (1136.0, 662.0), (1142.25, 667.0833333333334), (1148.5, 672.1666666666666), (1154.75, 677.25), (1161.0, 682.3333333333334), (1167.25, 687.4166666666666), (1173.5, 692.5), (1179.75, 697.5833333333334), (1186.0, 702.6666666666666), (1192.25, 707.75), (1198.5, 712.8333333333334), (1204.75, 717.9166666666666), (1211.0, 723.0), (1216.0, 718.0), (1220.0, 719.0), (1226.0, 719.0), (1227.0, 718.0), (1232.0, 718.0), (1238.0, 719.0), (1243.0, 721.0), (1252.0, 721.0), (1256.0, 721.0), (1256.0, 721.0), (1262.0, 725.0), (1268.0, 728.0), (1273.0, 731.0), (1280.0, 734.0), (1286.0, 737.0), (1286.0, 737.0), (1293.0, 742.0), (1298.0, 746.0), (1305.0, 749.0), (1302.0, 720.0), (1299.0, 691.0), (1299.0, 691.0), (1295.0, 668.0), (1295.0, 649.0), (1288.0, 623.0), (1285.0, 597.0), (1280.0, 571.0), (1280.0, 571.0), (1277.0, 552.0), (1274.4444444444443, 538.4444444444445), (1271.888888888889, 524.8888888888889), (1269.3333333333333, 511.3333333333333), (1266.7777777777778, 497.77777777777777), (1264.2222222222222, 484.22222222222223), (1261.6666666666667, 470.6666666666667), (1259.111111111111, 457.1111111111111), (1256.5555555555557, 443.55555555555554), (1254.0, 430.0), (1249.0, 417.0), (1249.0, 417.0), (1246.0, 409.0), (1242.0, 399.0), (1239.0, 392.0), (1237.0, 384.0), (1234.0, 379.0), (1234.0, 379.0), (1231.0, 373.0), (1230.0, 367.0), (1227.0, 364.0), (1225.0, 361.0), (1222.0, 358.0), (1222.0, 358.0), (1220.0, 356.0), (1219.0, 353.0), (1214.0, 353.0), (1212.0, 352.0), (1209.0, 350.0), (1209.0, 350.0), (1207.0, 351.0), (1206.0, 350.0), (1204.0, 352.0), (1202.0, 350.0), (1202.0, 335.0), (1202.0, 335.0), (1200.0, 324.0), (1198.0, 313.0), (1196.0, 302.5), (1194.0, 292.0), (1195.0, 281.0), (1195.0, 281.0), (1194.0, 273.0), (1191.0, 263.0), (1191.0, 256.0), (1191.0, 247.0), (1190.0, 239.0), (1190.0, 239.0), (1189.0, 234.0), (1189.0, 228.0), (1189.0, 221.0), (1188.0, 216.0), (1186.0, 213.0), (1187.0, 212.0), (1184.0, 209.0), (1183.0, 205.0), (1182.0, 200.0), (1181.0, 195.0), (1181.0, 195.0), (1181.0, 195.0), (1178.4, 195.16190476190476), (1175.8, 195.32380952380953), (1173.2, 195.4857142857143), (1170.6, 195.64761904761906), (1168.0, 195.8095238095238), (1165.4, 195.97142857142856), (1162.8, 196.13333333333333), (1160.2, 196.2952380952381), (1157.6, 196.45714285714286), (1155.0, 196.61904761904762), (1152.4, 196.78095238095239), (1149.8, 196.94285714285715), (1147.2, 197.10476190476192), (1144.6, 197.26666666666668), (1142.0, 197.42857142857142), (1139.4, 197.59047619047618), (1136.8, 197.75238095238095), (1134.2, 197.9142857142857), (1131.6, 198.07619047619048), (1129.0, 198.23809523809524), (1126.4, 198.4), (1123.8, 198.56190476190477), (1121.2, 198.72380952380954), (1118.6, 198.8857142857143), (1116.0, 199.04761904761904), (1113.4, 199.2095238095238), (1110.8, 199.37142857142857), (1108.2, 199.53333333333333), (1105.6, 199.6952380952381), (1103.0, 199.85714285714286), (1100.4, 200.01904761904763), (1097.8, 200.1809523809524), (1095.2, 200.34285714285716), (1092.6, 200.5047619047619), (1090.0, 200.66666666666666), (1087.4, 200.82857142857142), (1084.8, 200.9904761904762), (1082.2, 201.15238095238095), (1079.6, 201.31428571428572), (1077.0, 201.47619047619048), (1074.4, 201.63809523809525), (1071.8, 201.8), (1069.2, 201.96190476190475), (1066.6, 202.1238095238095), (1064.0, 202.28571428571428), (1061.4, 202.44761904761904), (1058.8, 202.6095238095238), (1056.2, 202.77142857142857), (1053.6, 202.93333333333334), (1051.0, 203.0952380952381), (1048.4, 203.25714285714287), (1045.8, 203.41904761904763), (1043.2, 203.58095238095237), (1040.6, 203.74285714285713), (1038.0, 203.9047619047619), (1035.4, 204.06666666666666), (1032.8, 204.22857142857143), (1030.2, 204.3904761904762), (1027.6, 204.55238095238096), (1025.0, 204.71428571428572), (1022.4, 204.8761904761905), (1019.8, 205.03809523809525), (1017.2, 205.2), (1014.6, 205.36190476190475), (1012.0, 205.52380952380952), (1009.4, 205.68571428571428), (1006.8, 205.84761904761905), (1004.2, 206.0095238095238), (1001.6, 206.17142857142858), (999.0, 206.33333333333334), (996.4, 206.4952380952381), (993.8, 206.65714285714284), (991.2, 206.8190476190476), (988.6, 206.98095238095237), (986.0, 207.14285714285714), (983.4, 207.3047619047619), (980.8, 207.46666666666667), (978.2, 207.62857142857143), (975.6, 207.7904761904762), (973.0, 207.95238095238096), (970.4, 208.11428571428573), (967.8, 208.27619047619046), (965.2, 208.43809523809523), (962.6, 208.6), (960.0, 208.76190476190476), (957.4, 208.92380952380952), (954.8, 209.0857142857143), (952.2, 209.24761904761905), (949.6, 209.40952380952382), (947.0, 209.57142857142858), (944.4, 209.73333333333335), (941.8, 209.89523809523808), (939.2, 210.05714285714285), (936.6, 210.21904761904761), (934.0, 210.38095238095238), (931.4, 210.54285714285714), (928.8, 210.7047619047619), (926.2, 210.86666666666667), (923.5999999999999, 211.02857142857144), (921.0, 211.1904761904762), (918.4, 211.35238095238094), (915.8, 211.5142857142857), (913.2, 211.67619047619047), (910.5999999999999, 211.83809523809524), (908.0, 212.0), (906.0, 222.0), (901.0, 235.0), (900.0, 235.0), (898.0, 249.0), (893.0, 263.0), (888.0, 276.0), (883.0, 292.0), (878.0, 303.0), (871.0, 426.3333333333333), (864.0, 549.6666666666666), (857.0, 673.0), (860.0, 519.0), (863.0, 365.0), (859.0, 384.0), (859.0, 384.0), (855.0, 398.0), (851.0, 411.0), (849.0, 412.0), (845.0, 413.0), (841.0, 414.0), (841.0, 414.0), (837.0, 414.0), (835.0, 413.0), (830.0, 415.0), (828.0, 416.0), (825.0, 416.0), (825.0, 416.0), (821.0, 419.0), (817.0, 421.0), (816.0, 424.0), (813.0, 425.0), (809.0, 423.0), (809.0, 423.0), (805.0, 405.0), (804.0, 378.0), (803.0, 360.0), (799.0, 340.0), (800.0, 324.0), (800.0, 324.0), (797.6666666666666, 307.3333333333333), (795.3333333333334, 290.6666666666667), (793.0, 274.0), (791.0, 259.0), (788.0, 248.0), (788.0, 248.0), (787.0, 235.0), (783.0, 224.0), (783.0, 214.0), (781.0, 204.0), (785.6875, 229.8125), (790.375, 255.625), (795.0625, 281.4375), (799.75, 307.25), (804.4375, 333.0625), (809.125, 358.875), (813.8125, 384.6875), (818.5, 410.5), (823.1875, 436.3125), (827.875, 462.125), (832.5625, 487.9375), (837.25, 513.75), (841.9375, 539.5625), (846.625, 565.375), (851.3125, 591.1875), (856.0, 617.0), (857.0, 617.0), (860.0, 617.0), (855.2727272727273, 580.0), (850.5454545454545, 543.0), (845.8181818181819, 506.0), (841.0909090909091, 469.0), (836.3636363636364, 432.0), (831.6363636363636, 395.0), (826.9090909090909, 358.0), (822.1818181818181, 321.0), (817.4545454545455, 284.0), (812.7272727272727, 247.0), (808.0, 210.0), (814.0, 226.0), (818.0, 239.0), (820.0, 238.0), (824.0, 250.0), (830.0, 260.0), (836.0, 275.0), (839.0, 286.0), (843.3333333333334, 297.6666666666667), (847.6666666666666, 309.3333333333333), (852.0, 321.0), (858.0, 334.0), (860.0, 350.0), (868.0, 366.0), (875.0, 383.0), (875.0, 383.0), (880.0, 402.0), (885.0, 418.0), (891.4285714285714, 428.0), (897.8571428571429, 438.0), (904.2857142857143, 448.0), (910.7142857142857, 458.0), (917.1428571428571, 468.0), (923.5714285714286, 478.0), (930.0, 488.0), (936.4285714285714, 498.0), (942.8571428571429, 508.0), (949.2857142857143, 518.0), (955.7142857142858, 528.0), (962.1428571428571, 538.0), (968.5714285714286, 548.0), (975.0, 558.0), (991.0, 561.0), (991.0, 561.0), (994.0, 570.0), (997.0, 579.0), (1000.3333333333334, 578.6666666666666), (1003.6666666666666, 578.3333333333334), (1007.0, 578.0), (1010.3333333333334, 577.6666666666666), (1013.6666666666666, 577.3333333333334), (1017.0, 577.0), (992.0, 529.0), (967.0, 481.0), (942.0, 433.0), (942.0, 433.0), (943.0, 424.0), (944.0, 420.0), (946.0, 412.0), (949.0, 407.0), (948.0, 401.0), (948.0, 401.0), (948.0, 397.0), (949.0, 391.0), (950.0, 391.0), (952.0, 385.0), (954.0, 381.0), (954.0, 381.0), (954.0, 378.0), (954.0, 375.0), (955.0, 372.0), (956.0, 371.0), (956.0, 368.0), (956.0, 368.0), (956.0, 368.0), (960.0, 365.0), (959.0, 363.0), (960.0, 364.0), (961.0, 364.0), (961.0, 364.0), (963.0, 363.0), (963.0, 364.0), (962.0, 364.0), (965.0, 365.0), (967.0, 367.0), (967.0, 367.0), (967.0, 367.0), (966.0, 370.0), (966.0, 371.0), (968.0, 374.0), (969.0, 377.0), (969.0, 377.0), (969.0, 381.0), (969.0, 384.0), (969.0, 388.0), (970.5, 391.0), (972.0, 394.0), (972.0, 394.0), (971.0, 399.0), (972.0, 404.0), (973.0, 409.0), (972.0, 414.0), (973.0, 418.0), (973.0, 418.0), (973.0, 424.0), (973.0, 430.0), (972.0, 437.0), (972.1, 436.3), (972.2, 435.6), (972.3, 434.9), (972.4, 434.2), (972.5, 433.5), (972.6, 432.8), (972.7, 432.1), (972.8, 431.4), (972.9, 430.7), (973.0, 430.0), (974.0, 423.0), (974.0, 416.0), (974.0, 411.0), (974.0, 407.0), (974.0, 407.0), (973.0, 403.0), (972.0, 396.0), (971.5, 392.5), (971.0, 389.0), (973.0, 385.0), (973.0, 385.0), (972.0, 384.0), (973.0, 379.0), (972.0, 377.0), (971.0, 374.0), (972.0, 373.0), (973.0, 373.0), (972.0, 372.9375), (971.0, 372.875), (970.0, 372.8125), (969.0, 372.75), (968.0, 372.6875), (967.0, 372.625), (966.0, 372.5625), (965.0, 372.5), (964.0, 372.4375), (963.0, 372.375), (962.0, 372.3125), (961.0, 372.25), (960.0, 372.1875), (959.0, 372.125), (958.0, 372.0625), (957.0, 372.0), (956.3529411764706, 374.3529411764706), (955.7058823529412, 376.70588235294116), (955.0588235294117, 379.05882352941177), (954.4117647058823, 381.4117647058824), (953.7647058823529, 383.7647058823529), (953.1176470588235, 386.11764705882354), (952.4705882352941, 388.47058823529414), (951.8235294117648, 390.8235294117647), (951.1764705882352, 393.1764705882353), (950.5294117647059, 395.52941176470586), (949.8823529411765, 397.88235294117646), (949.2352941176471, 400.2352941176471), (948.5882352941177, 402.5882352941176), (947.9411764705883, 404.94117647058823), (947.2941176470588, 407.29411764705884), (946.6470588235294, 409.6470588235294), (946.0, 412.0), (941.0, 413.0), (935.0, 414.0), (936.0, 414.0), (929.0, 414.0), (922.0, 413.0), (914.0, 414.0), (908.0, 416.0), (902.0, 417.0), (902.0, 417.0), (894.0, 418.0), (889.0, 422.0), (882.0, 424.0), (873.0, 425.0), (867.0, 428.0), (867.0, 428.0), (861.0, 436.0), (853.0, 437.0), (846.8888888888889, 442.5), (840.7777777777778, 448.0), (834.6666666666666, 453.5), (828.5555555555555, 459.0), (822.4444444444445, 464.5), (816.3333333333334, 470.0), (810.2222222222222, 475.5), (804.1111111111111, 481.0), (798.0, 486.5), (791.8888888888889, 492.0), (785.7777777777778, 497.5), (779.6666666666666, 503.0), (773.5555555555555, 508.5), (767.4444444444445, 514.0), (761.3333333333334, 519.5), (755.2222222222222, 525.0), (749.1111111111111, 530.5), (743.0, 536.0), (738.0, 543.0), (732.0, 552.0), (732.0, 545.0), (732.0, 545.0), (734.0, 532.0), (723.0, 549.0), (712.0, 566.0), (701.0, 583.0), (711.8333333333334, 556.6666666666666), (722.6666666666666, 530.3333333333334), (733.5, 504.0), (744.3333333333334, 477.6666666666667), (755.1666666666666, 451.33333333333337), (766.0, 425.0), (770.0, 413.0), (769.0, 414.0), (774.0, 405.0), (776.0, 392.0), (780.0, 384.0), (783.0, 374.0), (788.0, 363.0), (788.0, 363.0), (791.0, 354.0), (794.0, 346.0), (799.0, 339.0), (802.0, 331.0), (805.0, 324.0), (805.0, 324.0), (808.0, 319.0), (813.0, 312.0), (814.0, 304.0), (818.0, 299.0), (824.0, 295.0), (824.0, 295.0), (828.0, 288.0), (828.0, 285.0), (832.0, 280.0), (835.0, 276.0), (838.0, 274.0), (838.0, 274.0), (842.0, 269.0), (846.0, 266.0), (848.0, 265.0), (852.0, 262.0), (855.0, 260.0), (855.0, 260.0), (857.0, 259.0), (861.0, 256.0), (864.5, 254.5), (868.0, 253.0), (885.75, 281.4166666666667), (903.5, 309.8333333333333), (921.25, 338.25), (939.0, 366.6666666666667), (956.75, 395.08333333333337), (974.5, 423.5), (992.25, 451.9166666666667), (1010.0, 480.33333333333337), (1027.75, 508.75), (1045.5, 537.1666666666667), (1063.25, 565.5833333333334), (1081.0, 594.0), (1091.0, 586.0), (1091.0, 586.0), (1103.0, 573.0), (1113.0, 564.0), (1126.0, 553.0), (1140.0, 542.0), (1150.0, 533.0), (1150.0, 533.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0), (1163.0, 523.0)]
使用这些坐标,我构建了一个由 3 列组成的 DataFrame:x、y、bounce(球接触球场的坐标 - 手动找到)
示例:
... | x | y | bounce |
---|---|---|---|
0 | 985.0 | 325.0 | 0 |
1 | 985.0 | 325.0 | 0 |
2 | 985.0 | 325.0 | 0 |
3 | 985.0 | 325.0 | 0 |
4 | 985.0 | 325.0 | 0 |
.. | ... | ... | ... |
921 | 1163.0 | 523.0 | 0 |
922 | 1163.0 | 523.0 | 0 |
923 | 1163.0 | 523.0 | 0 |
924 | 1163.0 | 523.0 | 0 |
925 | 1275.0 | 572.0 | 1 |
[926 rows x 3 columns] |
如果我根据帧号绘制 x 和 y 坐标,并为反弹点绘制散点图,我得到
我可以看到存在某种模式,反弹发生在峰值前 10-30 帧(局部 Max/local Min),但我使用 sklearn
构建的 ML 模型似乎无法捕捉到它。
import numpy as np
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import confusion_matrix
X = df.drop('bounce', 1)
y = df['bounce']
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)
X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y)
grid="C":np.logspace(-3,3,7), "penalty":["l1","l2"]# l1 lasso l2 ridge
logreg = LogisticRegression(C = 0.001, penalty='l2')
logreg.fit(X_train, y_train)
y_pred = logreg.predict(X_test)
tn, fp, fn, tp = confusion_matrix(y_test, y_pred).ravel()
print(tn, fp, fn, tp)
>>> 381 0 6 0
据我所知,对于 sklearn ML 模型而言,它会寻找跨列的关系,而每一行都是一个新案例。
在我的情况下,列之间没有太多,而是行具有更高的价值,我该如何相应地训练我的模型?
【问题讨论】:
【参考方案1】:将帧视为时间点,将数据视为时间序列数据将有助于更好地捕捉关系。时间序列模型有不同的训练方法,最好相应地重新构建预测问题。
This Post 似乎是这个问题的一个很好的起点。
【讨论】:
以上是关于跨行查找关系的 ML 模型的主要内容,如果未能解决你的问题,请参考以下文章