dane treningowe w osobnym pliku

This commit is contained in:
Paulina J 2019-06-09 20:13:57 +02:00
parent b133be73bd
commit 93ac9d9df5
2 changed files with 290 additions and 289 deletions

302
Tree1.py
View File

@ -26,296 +26,20 @@ class TreeClass:
#print(com)
def make_tree(self, plant, pl_stats):
features = []
features = [
[1, True, 199, 900, 950],
[1, True, 150, 840, 880],
[1, True, 149, 780, 770],
[1, True, 133, 630, 680],
[1, True, 125, 555, 567],
[1, True, 112, 920, 834],
[1, True, 173, 947, 736],
[1, True, 143, 934, 642],
[1, True, 126, 928, 521],
[1, True, 136, 842, 756],
[1, True, 174, 860, 641],
[1, True, 186, 826, 531],
[1, True, 163, 769, 695],
[1, True, 176, 728, 543],
[1, True, 146, 684, 528],
[1, True, 158, 853, 964],
[1, True, 176, 746, 935],
[1, True, 169, 661, 961],
[1, True, 129, 584, 935],
[1, True, 187, 755, 812],
[1, True, 194, 642, 836],
[1, True, 173, 583, 861],
[1, True, 115, 628, 716],
[1, True, 123, 592, 756],
[1, True, 165, 584, 614],
[1, True, 3800, 450, 941],
[1, True, 290, 340, 958],
[1, True, 240, 290, 914],
[1, True, 350, 140, 980],
[1, True, 451, 68, 926],
[1, True, 230, 479, 856],
[1, True, 260, 310, 824],
[1, True, 568, 256, 834],
[1, True, 427, 149, 873],
[1, True, 237, 46, 831],
[1, True, 341, 416, 784],
[1, True, 413, 369, 716],
[1, True, 689, 251, 761],
[1, True, 746, 183, 743],
[1, True, 856, 45, 736],
[1, True, 652, 415, 641],
[1, True, 931, 346, 694],
[1, True, 347, 258, 623],
[1, True, 248, 149, 684],
[1, True, 354, 24, 617],
[1, True, 619, 416, 518],
[1, True, 746, 352, 585],
[1, True, 456, 271, 544],
[1, True, 746, 164, 572],
[1, True, 620, 38, 565],
[1, True, 321, 920, 412],
[1, True, 520, 935, 348],
[1, True, 364, 961, 259],
[1, True, 206, 946, 148],
[1, True, 402, 916, 62],
[1, True, 660, 850, 461],
[1, True, 542, 827, 320],
[1, True, 490, 886, 280],
[1, True, 640, 851, 140],
[1, True, 840, 867, 80],
[1, True, 746, 716, 486],
[1, True, 142, 769, 364],
[1, True, 246, 784, 249],
[1, True, 368, 751, 165],
[1, True, 6789, 755, 16],
[1, True, 1203, 649, 426],
[1, True, 924, 685, 310],
[1, True, 864, 694, 267],
[1, True, 592, 628, 128],
[1, True, 482, 673, 38],
[1, True, 235, 542, 461],
[1, True, 357, 549, 364],
[1, True, 751, 502, 288],
[1, True, 1452, 589, 176],
[1, True, 845, 516, 67],
[1, True, 37812, 489, 468],
[1, True, 3728, 387, 328],
[1, True, 1934, 234, 264],
[1, True, 13562, 149, 168],
[1, True, 698, 84, 61],
[1, True, 1789, 475, 386],
[1, True, 201, 425, 235],
[1, True, 358, 467, 147],
[1, True, 942, 491, 37],
[1, True, 1056, 367, 241],
[1, True, 846, 352, 130],
[1, True, 754, 312, 75],
[1, True, 564, 210, 138],
[1, True, 416, 289, 62],
[1, True, 256, 139, 67],
[1, True, 1365, 371, 492],
[1, True, 954, 254, 452],
[1, True, 821, 185, 449],
[1, True, 564, 76, 421],
[1, True, 648, 276, 305],
[1, True, 246, 123, 368],
[1, True, 461, 43, 378],
[1, True, 368, 185, 249],
[1, True, 597, 54, 294],
[1, True, 694, 73, 165],
[1, True, 1454, 948, 921],
[1, True, 1888, 838, 868],
[1, True, 1126, 741, 756],
[1, True, 895, 634, 627],
[1, True, 738, 565, 528],
[1, True, 814, 974, 842],
[1, True, 1413, 961, 751],
[1, True, 3628, 958, 657],
[1, True, 364, 948, 556],
[1, True, 6729, 863, 748],
[1, True, 258, 854, 618],
[1, True, 352, 814, 550],
[1, True, 37822, 779, 670],
[1, True, 4315, 752, 546],
[1, True, 288, 635, 558],
[1, True, 384, 857, 943],
[1, True, 476, 741, 938],
[1, True, 376, 638, 976],
[1, True, 228, 534, 936],
[1, True, 534, 749, 855],
[1, True, 684, 651, 835],
[1, True, 854, 536, 827],
[1, True, 1526, 628, 756],
[1, True, 924, 524, 712],
[1, True, 846, 514, 638],
[1, True, 1872, 547, 501],
[1, False, 6789, 672, 405],
[1, False, 37812, 589, 420],
[1, False, 3728, 890, 778],
[1, False, 799, 734, 634],
[1, False, 799, 734, 634],
[1, False, 799, 734, 634],
[0, True, 134, 910, 950],
[0, True, 254, 890, 840],
[0, True, 124, 763, 746],
[0, True, 168, 667, 641],
[0, True, 148, 546, 531],
[0, True, 261, 916, 843],
[0, True, 284, 951, 762],
[0, True, 256, 922, 610],
[0, True, 123, 956, 552],
[0, True, 87, 840, 781],
[0, True, 189, 820, 690],
[0, True, 222, 813, 560],
[0, True, 168, 746, 635],
[0, True, 234, 768, 523],
[0, True, 155, 624, 516],
[0, True, 278, 846, 962],
[0, True, 226, 769, 931],
[0, True, 184, 647, 951],
[0, True, 124, 563, 947],
[0, True, 156, 761, 854],
[0, True, 178, 632, 846],
[0, True, 98, 589, 812],
[0, True, 134, 658, 715],
[0, True, 169, 528, 762],
[0, True, 234, 553, 674],
[0, True, 300, 450, 920],
[0, True, 4580, 350, 961],
[0, True, 1290, 240, 923],
[0, True, 340, 170, 974],
[0, True, 7650, 28, 945],
[0, True, 3455, 429, 801],
[0, True, 684, 358, 826],
[0, True, 569, 214, 836],
[0, True, 469, 148, 853],
[0, True, 396, 61, 816],
[0, True, 769, 462, 756],
[0, True, 1584, 367, 761],
[0, True, 648, 231, 752],
[0, True, 1147, 182, 726],
[0, True, 685, 58, 795],
[0, True, 596, 486, 634],
[0, True, 1462, 368, 614],
[0, True, 1062, 245, 658],
[0, True, 482, 156, 674],
[0, True, 584, 84, 623],
[0, True, 469, 421, 574],
[0, True, 657, 345, 563],
[0, True, 846, 215, 587],
[0, True, 769, 156, 532],
[0, True, 845, 34, 542],
[0, True, 358, 941, 468],
[0, True, 1354, 932, 394],
[0, True, 458, 954, 265],
[0, True, 369, 914, 178],
[0, True, 946, 954, 62],
[0, True, 746, 821, 428],
[0, True, 340, 880, 360],
[0, True, 410, 812, 220],
[0, True, 386, 856, 148],
[0, True, 589, 816, 75],
[0, True, 950, 765, 420],
[0, True, 869, 715, 362],
[0, True, 1304, 763, 296],
[0, True, 746, 736, 162],
[0, True, 684, 712, 84],
[0, True, 935, 622, 413],
[0, True, 3040, 680, 360],
[0, True, 840, 601, 280],
[0, True, 765, 682, 164],
[0, True, 568, 624, 72],
[0, True, 485, 563, 426],
[0, True, 385, 531, 368],
[0, True, 934, 546, 235],
[0, True, 312, 574, 163],
[0, True, 468, 513, 63],
[0, True, 1024, 536, 542],
[0, True, 478, 468, 413],
[0, True, 369, 345, 368],
[0, True, 562, 248, 267],
[0, True, 836, 186, 148],
[0, True, 745, 54, 36],
[0, True, 3400, 550, 460],
[0, True, 562, 532, 368],
[0, True, 765, 589, 241],
[0, True, 1628, 518, 160],
[0, True, 740, 560, 49],
[0, True, 698, 415, 345],
[0, True, 528, 464, 231],
[0, True, 694, 432, 184],
[0, True, 746, 413, 46],
[0, True, 340, 380, 260],
[0, True, 840, 300, 190],
[0, True, 740, 360, 35],
[0, True, 489, 232, 154],
[0, True, 568, 254, 63],
[0, True, 950, 189, 92],
[0, True, 368, 436, 584],
[0, True, 465, 381, 523],
[0, True, 649, 225, 548],
[0, True, 968, 145, 568],
[0, True, 1205, 29, 519],
[0, True, 382, 365, 492],
[0, True, 594, 237, 459],
[0, True, 846, 164, 425],
[0, True, 715, 56, 445],
[0, True, 1306, 284, 364],
[0, True, 563, 134, 385],
[0, True, 469, 72, 318],
[0, True, 746, 164, 296],
[0, True, 528, 64, 205],
[0, True, 674, 58, 169],
[0, True, 1524, 924, 938],
[0, True, 1892, 896, 865],
[0, True, 1246, 736, 762],
[0, True, 895, 648, 623],
[0, True, 726, 537, 584],
[0, True, 648, 934, 864],
[0, True, 1423, 922, 746],
[0, True, 3728, 987, 678],
[0, True, 458, 934, 514],
[0, True, 6789, 855, 759],
[0, True, 254, 843, 628],
[0, True, 367, 865, 564],
[0, True, 37812, 789, 668],
[0, True, 4365, 769, 534],
[0, True, 299, 630, 555],
[0, True, 368, 852, 937],
[0, True, 468, 716, 925],
[0, True, 374, 648, 986],
[0, True, 216, 526, 925],
[0, True, 528, 746, 851],
[0, True, 648, 632, 816],
[0, True, 846, 528, 853],
[0, True, 1506, 648, 731],
[0, True, 954, 520, 749],
[0, True, 846, 543, 616],
[0, True, 1892, 532, 500],
[0, False, 190, 240, 740],
[0, False, 240, 690, 250],
[0, False, 150, 120, 850],
[0, False, 230, 850, 180],
[0, False, 2345, 21, 342],
[0, False, 2561, 244, 532]
]
with open('dane.txt') as data:
for line in data:
elements = line.split(", ")
for element in elements:
if element == "True":
element = True
elif element == "False":
element = False
else:
element = int(element)
features.append(elements)
labels = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,

277
dane.txt Normal file
View File

@ -0,0 +1,277 @@
1, True, 199, 900, 950
1, True, 150, 840, 880
1, True, 149, 780, 770
1, True, 133, 630, 680
1, True, 125, 555, 567
1, True, 112, 920, 834
1, True, 173, 947, 736
1, True, 143, 934, 642
1, True, 126, 928, 521
1, True, 136, 842, 756
1, True, 174, 860, 641
1, True, 186, 826, 531
1, True, 163, 769, 695
1, True, 176, 728, 543
1, True, 146, 684, 528
1, True, 158, 853, 964
1, True, 176, 746, 935
1, True, 169, 661, 961
1, True, 129, 584, 935
1, True, 187, 755, 812
1, True, 194, 642, 836
1, True, 173, 583, 861
1, True, 115, 628, 716
1, True, 123, 592, 756
1, True, 165, 584, 614
1, True, 3800, 450, 941
1, True, 290, 340, 958
1, True, 240, 290, 914
1, True, 350, 140, 980
1, True, 451, 68, 926
1, True, 230, 479, 856
1, True, 260, 310, 824
1, True, 568, 256, 834
1, True, 427, 149, 873
1, True, 237, 46, 831
1, True, 341, 416, 784
1, True, 413, 369, 716
1, True, 689, 251, 761
1, True, 746, 183, 743
1, True, 856, 45, 736
1, True, 652, 415, 641
1, True, 931, 346, 694
1, True, 347, 258, 623
1, True, 248, 149, 684
1, True, 354, 24, 617
1, True, 619, 416, 518
1, True, 746, 352, 585
1, True, 456, 271, 544
1, True, 746, 164, 572
1, True, 620, 38, 565
1, True, 321, 920, 399
1, True, 520, 935, 348
1, True, 364, 961, 259
1, True, 206, 946, 148
1, True, 402, 916, 62
1, True, 660, 850, 361
1, True, 542, 827, 320
1, True, 490, 886, 280
1, True, 640, 851, 140
1, True, 840, 867, 80
1, True, 746, 716, 386
1, True, 142, 769, 364
1, True, 246, 784, 249
1, True, 368, 751, 165
1, True, 6789, 755, 16
1, True, 1203, 649, 226
1, True, 924, 685, 310
1, True, 864, 694, 267
1, True, 592, 628, 128
1, True, 482, 673, 38
1, True, 235, 542, 461
1, True, 357, 549, 364
1, True, 751, 502, 288
1, True, 1452, 589, 176
1, True, 845, 516, 67
1, True, 37812, 489, 368
1, True, 3728, 387, 328
1, True, 1934, 234, 264
1, True, 13562, 149, 168
1, True, 698, 84, 61
1, True, 1789, 475, 386
1, True, 201, 425, 235
1, True, 358, 467, 147
1, True, 942, 491, 37
1, True, 1056, 367, 241
1, True, 846, 352, 130
1, True, 754, 312, 75
1, True, 564, 210, 138
1, True, 416, 289, 62
1, True, 256, 139, 67
1, True, 1365, 471, 392
1, True, 954, 254, 352
1, True, 821, 185, 349
1, True, 564, 76, 221
1, True, 648, 276, 305
1, True, 246, 123, 368
1, True, 461, 43, 378
1, True, 368, 185, 249
1, True, 597, 54, 294
1, True, 694, 73, 165
1, True, 1454, 948, 921
1, True, 1888, 838, 868
1, True, 1126, 741, 756
1, True, 895, 634, 627
1, True, 738, 565, 528
1, True, 814, 974, 842
1, True, 1413, 961, 751
1, True, 3628, 958, 657
1, True, 364, 948, 556
1, True, 6729, 863, 748
1, True, 258, 854, 618
1, True, 352, 814, 550
1, True, 37822, 779, 670
1, True, 4315, 752, 546
1, True, 288, 635, 558
1, True, 384, 857, 943
1, True, 476, 741, 938
1, True, 376, 638, 976
1, True, 228, 534, 936
1, True, 534, 749, 855
1, True, 684, 651, 835
1, True, 854, 536, 827
1, True, 1526, 628, 756
1, True, 924, 524, 712
1, True, 846, 514, 638
1, True, 1872, 547, 501
1, False, 6789, 672, 405
1, False, 37812, 589, 420
1, False, 3728, 890, 778
1, False, 799, 734, 634
1, False, 799, 734, 634
1, False, 799, 734, 634
0, True, 134, 910, 950
0, True, 254, 890, 840
0, True, 124, 763, 746
0, True, 168, 667, 641
0, True, 148, 546, 531
0, True, 261, 916, 843
0, True, 284, 951, 762
0, True, 256, 922, 610
0, True, 123, 956, 552
0, True, 87, 840, 781
0, True, 189, 820, 690
0, True, 222, 813, 560
0, True, 168, 746, 635
0, True, 234, 768, 523
0, True, 155, 624, 516
0, True, 278, 846, 962
0, True, 226, 769, 931
0, True, 184, 647, 951
0, True, 124, 563, 947
0, True, 156, 761, 854
0, True, 178, 632, 846
0, True, 98, 589, 812
0, True, 134, 658, 715
0, True, 169, 528, 762
0, True, 234, 553, 674
0, True, 300, 450, 920
0, True, 4580, 350, 961
0, True, 1290, 240, 923
0, True, 340, 170, 974
0, True, 7650, 28, 945
0, True, 3455, 429, 801
0, True, 684, 358, 826
0, True, 569, 214, 836
0, True, 469, 148, 853
0, True, 396, 61, 816
0, True, 769, 462, 756
0, True, 1584, 367, 761
0, True, 648, 231, 752
0, True, 1147, 182, 726
0, True, 685, 58, 795
0, True, 596, 486, 634
0, True, 1462, 368, 614
0, True, 1062, 245, 658
0, True, 482, 156, 674
0, True, 584, 84, 623
0, True, 469, 421, 574
0, True, 657, 345, 563
0, True, 846, 215, 587
0, True, 769, 156, 532
0, True, 845, 34, 542
0, True, 358, 941, 468
0, True, 1354, 932, 394
0, True, 458, 954, 265
0, True, 369, 914, 178
0, True, 946, 954, 62
0, True, 746, 821, 428
0, True, 340, 880, 360
0, True, 410, 812, 220
0, True, 386, 856, 148
0, True, 589, 816, 75
0, True, 950, 765, 420
0, True, 869, 715, 362
0, True, 1304, 763, 296
0, True, 746, 736, 162
0, True, 684, 712, 84
0, True, 935, 622, 413
0, True, 3040, 680, 360
0, True, 840, 601, 280
0, True, 765, 682, 164
0, True, 568, 624, 72
0, True, 485, 663, 426
0, True, 385, 631, 368
0, True, 934, 646, 235
0, True, 312, 674, 163
0, True, 468, 613, 63
0, True, 1024, 536, 442
0, True, 478, 468, 413
0, True, 369, 345, 368
0, True, 562, 248, 267
0, True, 836, 186, 148
0, True, 745, 54, 36
0, True, 3400, 550, 460
0, True, 562, 532, 368
0, True, 765, 589, 241
0, True, 1628, 518, 160
0, True, 740, 560, 49
0, True, 698, 415, 345
0, True, 528, 464, 231
0, True, 694, 432, 184
0, True, 746, 413, 46
0, True, 340, 380, 260
0, True, 840, 300, 190
0, True, 740, 360, 35
0, True, 489, 232, 154
0, True, 568, 254, 63
0, True, 950, 189, 92
0, True, 368, 436, 484
0, True, 465, 381, 423
0, True, 649, 225, 448
0, True, 968, 145, 468
0, True, 1205, 29, 419
0, True, 382, 365, 492
0, True, 594, 237, 459
0, True, 846, 164, 425
0, True, 715, 56, 445
0, True, 1306, 284, 364
0, True, 563, 134, 385
0, True, 469, 72, 318
0, True, 746, 164, 296
0, True, 528, 64, 205
0, True, 674, 58, 169
0, True, 1524, 924, 938
0, True, 1892, 896, 865
0, True, 1246, 736, 762
0, True, 895, 648, 623
0, True, 726, 637, 584
0, True, 648, 934, 864
0, True, 1423, 922, 746
0, True, 3728, 987, 678
0, True, 458, 934, 514
0, True, 6789, 855, 759
0, True, 254, 843, 628
0, True, 367, 865, 564
0, True, 37812, 789, 668
0, True, 4365, 769, 534
0, True, 299, 630, 555
0, True, 368, 852, 937
0, True, 468, 716, 925
0, True, 374, 648, 986
0, True, 216, 626, 925
0, True, 528, 746, 851
0, True, 648, 632, 816
0, True, 846, 628, 853
0, True, 1506, 648, 731
0, True, 954, 610, 749
0, True, 846, 643, 616
0, True, 1892, 632, 500
0, False, 190, 240, 740
0, False, 240, 690, 250
0, False, 150, 120, 850
0, False, 230, 850, 180
0, False, 2345, 21, 342
0, False, 2561, 244, 532