├── housing.pkl ├── missing_dataset_falcon9.xlsx ├── _week13-applied-datascience.pdf ├── README.md ├── data_for_kmean.csv ├── data_falcon9.csv ├── dataset_falcon9.csv ├── week1-notebook1-monogram2.ipynb ├── week2-notebook1-monogram2.ipynb ├── preprocessed_dataset.csv ├── week7-notebook1-KNN-monogram2.ipynb ├── week8-notebook1-DecisionTree-RandomForest-monogram2.ipynb └── week6-notebook1-Logistic-Regression-monogram2.ipynb /housing.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monahatami1/monogram2/HEAD/housing.pkl -------------------------------------------------------------------------------- /missing_dataset_falcon9.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monahatami1/monogram2/HEAD/missing_dataset_falcon9.xlsx -------------------------------------------------------------------------------- /_week13-applied-datascience.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/monahatami1/monogram2/HEAD/_week13-applied-datascience.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # monogram2 2 | در این ریپو تمرینات دوره "دیتاساینس کاربردی" دیتارودمپ به اشتراک گذاشنه شده است. 3 | دوره دیتاساینس کاربردی یک دوره پروژه محور است. 4 | -------------------------------------------------------------------------------- /data_for_kmean.csv: -------------------------------------------------------------------------------- 1 | Feature 1,Feature 2 2 | -6.428840947998266,10.141117387887057 3 | 5.868678884919712,5.201103558017895 4 | -0.37610937488566665,3.2642794268364614 5 | 2.1667918115781717,9.56300521918858 6 | 5.095085704731294,7.207527180480231 7 | -10.878888191149594,-6.113180400834563 8 | 2.034055541118602,9.76664755215618 9 | -1.7179877144476108,1.4140114006529538 10 | 1.1691134097614637,8.245569882970244 11 | -1.3518544352927309,3.1324534540375204 12 | -6.1854821356557625,9.674065554703438 13 | -1.1985660160776135,2.504089366453676 14 | 2.902968625306456,7.912510029304244 15 | 2.392500227450193,5.381739706188428 16 | -5.275451467256436,9.638366588811735 17 | -0.5668146871518737,0.056026275490682176 18 | 5.973366275133855,5.871720219253212 19 | -2.3135526825560575,0.5239800923523743 20 | -10.134475610966595,-3.431308370677069 21 | -4.540826294007317,11.392017391998055 22 | -10.41558326938338,-5.675458358055395 23 | 0.6647966932244738,0.09423047178561017 24 | 2.114604769543774,3.5593848844586713 25 | -11.179022089148255,-9.309766048464859 26 | -6.636982511358251,6.394264357014962 27 | -7.67422004581943,-7.268396535372234 28 | -7.986682604649974,-9.571133080989501 29 | 1.2798368434097702,0.3531507774469469 30 | 3.5448024388675554,7.935356780250796 31 | 4.0394018113877035,4.888704326726142 32 | -2.8811889757801543,9.129193914647235 33 | -9.110099105992715,-7.697816604719698 34 | 5.260011717657308,4.740074344701907 35 | 2.058597235014227,-2.4408303865828724 36 | -1.712898336801897,2.5122119709320296 37 | -5.405623186876656,7.47228315276904 38 | -11.199512264915725,-2.5527674372947766 39 | -11.375364102886182,-4.9452509125363875 40 | -11.782183619597355,-9.508830069768326 41 | 1.7481550323849884,2.0559567946080737 42 | -9.003923335694054,-6.208162031285014 43 | -2.865645835992866,7.529341527409561 44 | -1.4274229256736635,8.335190778031768 45 | -3.1093343152090243,10.164146430419013 46 | 0.2711300950143205,2.583038237646317 47 | 0.8215565612951625,6.769668062658922 48 | -4.114954811962205,8.026213447308953 49 | 1.5541492807050865,3.2765768719558537 50 | -11.65462114107793,-8.006737204821357 51 | -1.220096367167577,4.904662114018048 52 | 3.220176304273833,-0.5949262040703083 53 | -5.404528920842814,7.199970270084177 54 | 6.027953509647421,4.016962396708966 55 | 0.4026004512393698,0.6734520115802854 56 | -7.389850087040175,-5.618830753483983 57 | -1.6053770673516432,5.985236390431823 58 | 0.8727703615022516,4.462053002730058 59 | 1.0344524139919222,1.8120349703691772 60 | -3.8894301817305,5.292626531966162 61 | 3.168355294184256,6.730391909048816 62 | -8.073096890528902,-7.959240034644401 63 | 0.9161316461081208,7.461392512342853 64 | -7.396482975489173,-4.953533515483878 65 | -1.7163270096438699,8.485403001691777 66 | 2.7139628283922956,8.373618211934117 67 | -2.1657088483979243,-0.9800363685218327 68 | -11.94743689132695,-6.964326164470866 69 | 4.895392190220613,6.078679812020913 70 | 2.861778319712988,8.226111917133471 71 | -9.153925969205368,-6.267818036087968 72 | 2.034770937022713,8.202364269228461 73 | 0.7566010798331562,5.007325851028015 74 | -8.840394937952547,-5.355493538916571 75 | -3.0265061016377603,3.9006659171442584 76 | -8.880378749720537,-6.131847170585052 77 | 5.207377772873533,6.425159956768066 78 | 3.1920774543813217,10.440907721281974 79 | 0.03541003145821631,2.287807464781545 80 | -6.947608297904781,10.30234401986977 81 | -3.3047302852183824,2.7455714400637876 82 | -0.6954738951572903,3.946560583692485 83 | -8.334572345194765,-6.053915497168932 84 | 5.512840700362673,8.535385800741372 85 | -6.276889509621905,-5.317582771315536 86 | 0.6676241110575267,0.04738203618395631 87 | -1.0316130579700813,0.7897984310294152 88 | -1.4813638970123557,0.07813026895873043 89 | -5.356766768413614,6.983167226676111 90 | 1.8523007514136582,3.9331972865556173 91 | -10.38896241637856,-2.7576575878570435 92 | -8.374190338711035,-9.487992961315992 93 | -8.210952265425913,-6.5225770109171215 94 | -9.800941607333067,-2.080384541144239 95 | -0.6224938287628201,5.509124998759611 96 | 0.27188368736134383,4.905229897149512 97 | -8.72228610215847,-7.704478814901352 98 | 5.36248494416059,9.106384797597466 99 | -3.952840761291541,7.081831152047123 100 | -8.262049526833126,-5.923473929822828 101 | 7.603297644569072,4.39690493623951 102 | -1.556230613808373,3.740327975835628 103 | -10.818906958965206,-6.3707075354633576 104 | 1.3337574856464438,3.2580102383697835 105 | -3.222716632447967,-0.1470413261921928 106 | 0.010926374761938806,6.377974243915935 107 | -1.211380319351645,4.188934471819014 108 | -9.492492416990011,-5.330431711547613 109 | 8.718557035893745,9.420688076906224 110 | -9.283773426460455,-7.316910884542021 111 | -9.512733133972375,-6.547209093038412 112 | 5.018713657673227,2.643667731332841 113 | -2.699437321469415,7.336514835632759 114 | -4.212940443664667,6.698446560311712 115 | 2.326865499612258,8.410075758992072 116 | -9.333924846186468,-10.376770451380217 117 | 4.091161182507633,6.245019346273455 118 | -3.443779108455547,8.152002998951398 119 | -6.562549829675934,9.777304059413726 120 | 1.20080532394272,6.943412900635993 121 | -1.1431309866149753,8.186691364945935 122 | 1.0228271158533162,5.164585091972927 123 | -4.415924691281315,6.356541899712182 124 | -1.4599017459031358,1.7675908463472074 125 | -6.011134400207432,7.610845261393715 126 | -0.3497610613997072,1.8279571558291279 127 | 5.330626180565914,5.709700770208754 128 | -6.167052134935019,10.17037820395393 129 | -2.7429821212742165,-0.6730632106243783 130 | -9.883929983362638,-7.610183341063092 131 | -2.3061136739076984,6.564128411241139 132 | -4.18810224799099,6.786437755150974 133 | -3.6337212820711096,8.711141055877512 134 | 0.6284008990159868,1.745455084070832 135 | -8.834957353630825,-8.483054884010935 136 | -14.357105742602176,-3.828955076295465 137 | -4.105138122902295,6.593060993350241 138 | 3.4681085877354354,4.274772130386426 139 | -3.836340668520651,3.9905838192963263 140 | 3.868797373087188,9.057024876587262 141 | 1.5273473317045894,0.4445294114314893 142 | -10.120380107048879,-7.30634014660335 143 | 5.305795225553987,3.3672676987082184 144 | -9.743817244697167,-5.165315388378961 145 | -0.5217347136407913,8.776312199701227 146 | -1.327735688792567,7.982009050266212 147 | 2.2604219252510864,6.221674363715593 148 | -1.3386011118089096,4.7665071866519115 149 | -8.11827275259426,-8.123131159817444 150 | -3.8002129199959978,7.475887311023454 151 | -5.331106850999683,8.092377480107322 152 | -2.5003396541903378,11.03688073374203 153 | -2.168459118576072,9.215459787452087 154 | 0.08525925695810083,2.1163018542835292 155 | 3.4260432830584997,4.8541268302202845 156 | 1.625390231814605,-0.7881959308655411 157 | -8.455464069075617,7.814793039923617 158 | 1.9499108038388557,4.779206177088395 159 | 2.660850264140058,8.854186364950888 160 | 3.309752846791799,7.204968488243087 161 | 1.4832224746499312,-0.2158280858959949 162 | 4.18471183654675,7.420581543293821 163 | 1.7818431997128086,1.544679152933465 164 | -2.161283622559638,4.0818436303130055 165 | -6.739182790238104,4.148356151181785 166 | -12.451426054831899,-5.968415293371462 167 | -6.081979130939487,6.1703202694406345 168 | -1.3701589718045535,2.2859047022897347 169 | 5.518723071864155,7.271547827108432 170 | -3.0338580836220714,8.926184423290207 171 | 4.206696151915972,0.3148857968818608 172 | 4.119696313184632,7.791521640533477 173 | 1.4777891783477135,2.0067150752109395 174 | -4.751527053290693,8.00144754206778 175 | -0.10746698689777379,7.346982604418306 176 | 0.11778058440818909,4.836510368831718 177 | -7.251531303365402,5.50680567986087 178 | 3.9200005662677,7.876223507807277 179 | 1.147830577204136,7.256924506133553 180 | -5.777335937582219,-8.453011970157958 181 | 1.759526735281733,6.677298322761328 182 | -3.307993021554919,8.826130069414324 183 | -7.8750186896608945,-9.379243480483336 184 | -8.020546578979301,-7.845683603319405 185 | -0.8564560019574232,10.536527461355664 186 | -9.139309331605174,-5.070114091982673 187 | -10.11470177413051,-9.568473396925103 188 | -9.074972296091707,-2.424189797866309 189 | -9.656200912938479,-8.27162550001944 190 | -11.406362911954897,-10.003982753716919 191 | 0.5926207424323455,0.5503452670888226 192 | -9.933633856580512,-4.656688126444006 193 | 5.485330755087407,7.602836164985755 194 | 4.439195243560652,8.132054190735412 195 | -3.65443002879871,7.208984099162566 196 | -8.812144934632851,-6.21627130651903 197 | 0.6714023343180112,4.975114920765885 198 | 6.56000194317516,8.351321365866514 199 | 5.134970945588994,9.12541881230554 200 | -9.261985097922695,-4.336104171800573 201 | 2.174744027795753,1.131475509642618 202 | -------------------------------------------------------------------------------- /data_falcon9.csv: -------------------------------------------------------------------------------- 1 | FlightNumber,Date,BoosterVersion,PayloadMass,Orbit,LaunchSite,Outcome,Flights,GridFins,Reused,Legs,LandingPad,Block,ReusedCount,Serial,Longitude,Latitude 2 | 1,2010-06-04,Falcon 9,,LEO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B0003,-80.577366,28.5618571 3 | 2,2012-05-22,Falcon 9,525.0,LEO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B0005,-80.577366,28.5618571 4 | 3,2013-03-01,Falcon 9,677.0,ISS,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B0007,-80.577366,28.5618571 5 | 4,2013-09-29,Falcon 9,500.0,PO,VAFB SLC 4E,False Ocean,1,False,False,False,,1.0,0,B1003,-120.610829,34.632093 6 | 5,2013-12-03,Falcon 9,3170.0,GTO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B1004,-80.577366,28.5618571 7 | 6,2014-01-06,Falcon 9,3325.0,GTO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B1005,-80.577366,28.5618571 8 | 7,2014-04-18,Falcon 9,2296.0,ISS,CCSFS SLC 40,True Ocean,1,False,False,True,,1.0,0,B1006,-80.577366,28.5618571 9 | 8,2014-07-14,Falcon 9,1316.0,LEO,CCSFS SLC 40,True Ocean,1,False,False,True,,1.0,0,B1007,-80.577366,28.5618571 10 | 9,2014-08-05,Falcon 9,4535.0,GTO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B1008,-80.577366,28.5618571 11 | 10,2014-09-07,Falcon 9,4428.0,GTO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B1011,-80.577366,28.5618571 12 | 11,2014-09-21,Falcon 9,2216.0,ISS,CCSFS SLC 40,False Ocean,1,False,False,False,,1.0,0,B1010,-80.577366,28.5618571 13 | 12,2015-01-10,Falcon 9,2395.0,ISS,CCSFS SLC 40,False ASDS,1,True,False,True,5e9e3032383ecb761634e7cb,1.0,0,B1012,-80.577366,28.5618571 14 | 13,2015-02-11,Falcon 9,570.0,ES-L1,CCSFS SLC 40,True Ocean,1,True,False,True,,1.0,0,B1013,-80.577366,28.5618571 15 | 14,2015-04-14,Falcon 9,1898.0,ISS,CCSFS SLC 40,False ASDS,1,True,False,True,5e9e3032383ecb761634e7cb,1.0,0,B1015,-80.577366,28.5618571 16 | 15,2015-04-27,Falcon 9,4707.0,GTO,CCSFS SLC 40,None None,1,False,False,False,,1.0,0,B1016,-80.577366,28.5618571 17 | 16,2015-06-28,Falcon 9,2477.0,ISS,CCSFS SLC 40,None ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,1.0,0,B1018,-80.577366,28.5618571 18 | 17,2015-12-22,Falcon 9,2034.0,LEO,CCSFS SLC 40,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,1.0,0,B1019,-80.577366,28.5618571 19 | 18,2016-01-17,Falcon 9,553.0,PO,VAFB SLC 4E,False ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,1.0,0,B1017,-120.610829,34.632093 20 | 19,2016-03-04,Falcon 9,5271.0,GTO,CCSFS SLC 40,False ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,1.0,0,B1020,-80.577366,28.5618571 21 | 20,2016-04-08,Falcon 9,3136.0,ISS,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,1,B1021,-80.577366,28.5618571 22 | 21,2016-05-06,Falcon 9,4696.0,GTO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,0,B1022,-80.577366,28.5618571 23 | 22,2016-05-27,Falcon 9,3100.0,GTO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,1,B1023,-80.577366,28.5618571 24 | 23,2016-07-18,Falcon 9,2257.0,ISS,CCSFS SLC 40,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,2.0,1,B1025,-80.577366,28.5618571 25 | 24,2016-08-14,Falcon 9,4600.0,GTO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,0,B1026,-80.577366,28.5618571 26 | 25,2016-09-01,Falcon 9,5500.0,GTO,CCSFS SLC 40,None ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,3.0,0,B1028,-80.577366,28.5618571 27 | 26,2017-01-14,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,3.0,1,B1029,-120.610829,34.632093 28 | 27,2017-02-19,Falcon 9,2490.0,ISS,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,3.0,1,B1031,-80.6039558,28.6080585 29 | 28,2017-03-16,Falcon 9,5600.0,GTO,KSC LC 39A,None None,1,False,False,False,,3.0,0,B1030,-80.6039558,28.6080585 30 | 29,2017-03-30,Falcon 9,5300.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,2.0,1,B1021,-80.6039558,28.6080585 31 | 30,2017-05-01,Falcon 9,,LEO,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,3.0,1,B1032,-80.6039558,28.6080585 32 | 31,2017-05-15,Falcon 9,6070.0,GTO,KSC LC 39A,None None,1,False,False,False,,3.0,0,B1034,-80.6039558,28.6080585 33 | 32,2017-06-03,Falcon 9,2708.0,ISS,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,3.0,1,B1035,-80.6039558,28.6080585 34 | 33,2017-06-23,Falcon 9,3669.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,3.0,1,B1029,-80.6039558,28.6080585 35 | 34,2017-06-25,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,3.0,1,B1036,-120.610829,34.632093 36 | 35,2017-07-05,Falcon 9,6761.0,GTO,KSC LC 39A,None None,1,False,False,False,,3.0,0,B1037,-80.6039558,28.6080585 37 | 36,2017-08-14,Falcon 9,2910.0,ISS,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,4.0,1,B1039,-80.6039558,28.6080585 38 | 37,2017-08-24,Falcon 9,475.0,SSO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,3.0,1,B1038,-120.610829,34.632093 39 | 38,2017-09-07,Falcon 9,4990.0,LEO,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,4.0,1,B1040,-80.6039558,28.6080585 40 | 39,2017-10-09,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,4.0,1,B1041,-120.610829,34.632093 41 | 40,2017-10-11,Falcon 9,5200.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,3.0,1,B1031,-80.6039558,28.6080585 42 | 41,2017-10-30,Falcon 9,3700.0,GTO,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,4.0,0,B1042,-80.6039558,28.6080585 43 | 42,2017-12-15,Falcon 9,2205.0,ISS,CCSFS SLC 40,True RTLS,2,True,True,True,5e9e3032383ecb267a34e7c7,3.0,1,B1035,-80.577366,28.5618571 44 | 43,2017-12-23,Falcon 9,9600.0,PO,VAFB SLC 4E,True Ocean,2,True,True,False,,3.0,1,B1036,-120.610829,34.632093 45 | 44,2018-01-08,Falcon 9,,LEO,CCSFS SLC 40,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,4.0,1,B1043,-80.577366,28.5618571 46 | 45,2018-01-31,Falcon 9,4230.0,GTO,CCSFS SLC 40,True Ocean,2,True,True,True,,3.0,1,B1032,-80.577366,28.5618571 47 | 46,2018-03-06,Falcon 9,6092.0,GTO,CCSFS SLC 40,None None,1,True,False,True,,4.0,0,B1044,-80.577366,28.5618571 48 | 47,2018-03-30,Falcon 9,9600.0,PO,VAFB SLC 4E,None None,2,True,True,True,,4.0,1,B1041,-120.610829,34.632093 49 | 48,2018-04-02,Falcon 9,2760.0,ISS,CCSFS SLC 40,None None,2,True,True,True,,4.0,1,B1039,-80.577366,28.5618571 50 | 49,2018-04-18,Falcon 9,350.0,HEO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,4.0,1,B1045,-80.577366,28.5618571 51 | 50,2018-05-11,Falcon 9,3750.0,GTO,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1046,-80.6039558,28.6080585 52 | 51,2018-06-04,Falcon 9,5383.85,GTO,CCSFS SLC 40,None None,2,False,True,False,,4.0,1,B1040,-80.577366,28.5618571 53 | 52,2018-06-29,Falcon 9,2410.0,ISS,CCSFS SLC 40,None None,2,False,True,False,,4.0,1,B1045,-80.577366,28.5618571 54 | 53,2018-07-22,Falcon 9,7076.0,GTO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1047,-80.577366,28.5618571 55 | 54,2018-07-25,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,5.0,4,B1048,-120.610829,34.632093 56 | 55,2018-08-07,Falcon 9,5800.0,GTO,CCSFS SLC 40,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1046,-80.577366,28.5618571 57 | 56,2018-09-10,Falcon 9,7060.0,GTO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,9,B1049,-80.577366,28.5618571 58 | 57,2018-10-08,Falcon 9,2800.0,SSO,VAFB SLC 4E,True RTLS,2,True,True,True,5e9e3032383ecb554034e7c9,5.0,4,B1048,-120.610829,34.632093 59 | 58,2018-11-15,Falcon 9,3000.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1047,-80.6039558,28.6080585 60 | 59,2018-12-03,Falcon 9,4000.0,SSO,VAFB SLC 4E,True ASDS,3,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,3,B1046,-120.610829,34.632093 61 | 60,2018-12-05,Falcon 9,2573.0,ISS,CCSFS SLC 40,False RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,5.0,0,B1050,-80.577366,28.5618571 62 | 61,2018-12-23,Falcon 9,4400.0,MEO,CCSFS SLC 40,None None,1,False,False,False,,5.0,0,B1054,-80.577366,28.5618571 63 | 62,2019-01-11,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,2,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,9,B1049,-120.610829,34.632093 64 | 63,2019-03-02,Falcon 9,12259.0,ISS,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,12,B1051,-80.6039558,28.6080585 65 | 64,2019-05-04,Falcon 9,2482.0,ISS,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1056,-80.577366,28.5618571 66 | 65,2019-05-24,Falcon 9,13200.0,VLEO,CCSFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,9,B1049,-80.577366,28.5618571 67 | 66,2019-06-12,Falcon 9,1425.0,SSO,VAFB SLC 4E,True RTLS,2,True,True,True,5e9e3032383ecb554034e7c9,5.0,12,B1051,-120.610829,34.632093 68 | 67,2019-07-25,Falcon 9,2227.7,ISS,CCSFS SLC 40,True RTLS,2,True,True,True,5e9e3032383ecb267a34e7c7,5.0,3,B1056,-80.577366,28.5618571 69 | 68,2019-08-06,Falcon 9,6500.0,GTO,CCSFS SLC 40,None None,3,False,True,False,,5.0,2,B1047,-80.577366,28.5618571 70 | 69,2019-11-11,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,4,B1048,-80.577366,28.5618571 71 | 70,2019-12-05,Falcon 9,5000.0,ISS,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1059,-80.577366,28.5618571 72 | 71,2019-12-17,Falcon 9,6800.0,GTO,CCSFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1056,-80.577366,28.5618571 73 | 72,2020-01-07,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,9,B1049,-80.577366,28.5618571 74 | 73,2020-01-19,Falcon 9,,SO,KSC LC 39A,None None,4,False,True,False,,5.0,3,B1046,-80.6039558,28.6080585 75 | 74,2020-01-29,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,12,B1051,-80.577366,28.5618571 76 | 75,2020-02-17,Falcon 9,15600.0,VLEO,CCSFS SLC 40,False ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1056,-80.577366,28.5618571 77 | 76,2020-03-07,Falcon 9,1977.0,ISS,CCSFS SLC 40,True RTLS,2,True,True,True,5e9e3032383ecb267a34e7c7,5.0,5,B1059,-80.577366,28.5618571 78 | 77,2020-03-18,Falcon 9,15600.0,VLEO,KSC LC 39A,False ASDS,5,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,4,B1048,-80.6039558,28.6080585 79 | 78,2020-04-22,Falcon 9,15600.0,VLEO,KSC LC 39A,True ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,12,B1051,-80.6039558,28.6080585 80 | 79,2020-05-30,Falcon 9,9525.0,ISS,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,13,B1058,-80.6039558,28.6080585 81 | 80,2020-06-04,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,5,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,9,B1049,-80.577366,28.5618571 82 | 81,2020-06-13,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1059,-80.577366,28.5618571 83 | 82,2020-06-30,Falcon 9,3880.0,MEO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,5.0,12,B1060,-80.577366,28.5618571 84 | 83,2020-07-20,Falcon 9,,GEO,CCSFS SLC 40,True ASDS,2,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,13,B1058,-80.577366,28.5618571 85 | 84,2020-08-18,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,6,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,9,B1049,-80.577366,28.5618571 86 | 85,2020-08-30,Falcon 9,1600.0,SSO,CCSFS SLC 40,True RTLS,4,True,True,True,5e9e3032383ecb267a34e7c7,5.0,5,B1059,-80.577366,28.5618571 87 | 86,2020-09-03,Falcon 9,15600.0,VLEO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,12,B1060,-80.6039558,28.6080585 88 | 87,2020-10-06,Falcon 9,15600.0,VLEO,KSC LC 39A,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,13,B1058,-80.6039558,28.6080585 89 | 88,2020-10-18,Falcon 9,15600.0,VLEO,KSC LC 39A,True ASDS,6,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,12,B1051,-80.6039558,28.6080585 90 | 89,2020-10-24,Falcon 9,15600.0,VLEO,CCSFS SLC 40,True ASDS,3,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,12,B1060,-80.577366,28.5618571 91 | 90,2020-11-05,Falcon 9,3681.0,MEO,CCSFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,8,B1062,-80.577366,28.5618571 92 | -------------------------------------------------------------------------------- /dataset_falcon9.csv: -------------------------------------------------------------------------------- 1 | FlightNumber,Date,BoosterVersion,PayloadMass,Orbit,LaunchSite,Outcome,Flights,GridFins,Reused,Legs,LandingPad,Block,ReusedCount,Serial,Longitude,Latitude,Class 2 | 1,2010-06-04,Falcon 9,6104.959411764706,LEO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B0003,-80.577366,28.5618571,0 3 | 2,2012-05-22,Falcon 9,525.0,LEO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B0005,-80.577366,28.5618571,0 4 | 3,2013-03-01,Falcon 9,677.0,ISS,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B0007,-80.577366,28.5618571,0 5 | 4,2013-09-29,Falcon 9,500.0,PO,VAFB SLC 4E,False Ocean,1,False,False,False,,1.0,0,B1003,-120.61082900000001,34.632093,0 6 | 5,2013-12-03,Falcon 9,3170.0,GTO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B1004,-80.577366,28.5618571,0 7 | 6,2014-01-06,Falcon 9,3325.0,GTO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B1005,-80.577366,28.5618571,0 8 | 7,2014-04-18,Falcon 9,2296.0,ISS,CCAFS SLC 40,True Ocean,1,False,False,True,,1.0,0,B1006,-80.577366,28.5618571,1 9 | 8,2014-07-14,Falcon 9,1316.0,LEO,CCAFS SLC 40,True Ocean,1,False,False,True,,1.0,0,B1007,-80.577366,28.5618571,1 10 | 9,2014-08-05,Falcon 9,4535.0,GTO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B1008,-80.577366,28.5618571,0 11 | 10,2014-09-07,Falcon 9,4428.0,GTO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B1011,-80.577366,28.5618571,0 12 | 11,2014-09-21,Falcon 9,2216.0,ISS,CCAFS SLC 40,False Ocean,1,False,False,False,,1.0,0,B1010,-80.577366,28.5618571,0 13 | 12,2015-01-10,Falcon 9,2395.0,ISS,CCAFS SLC 40,False ASDS,1,True,False,True,5e9e3032383ecb761634e7cb,1.0,0,B1012,-80.577366,28.5618571,0 14 | 13,2015-02-11,Falcon 9,570.0,ES-L1,CCAFS SLC 40,True Ocean,1,True,False,True,,1.0,0,B1013,-80.577366,28.5618571,1 15 | 14,2015-04-14,Falcon 9,1898.0,ISS,CCAFS SLC 40,False ASDS,1,True,False,True,5e9e3032383ecb761634e7cb,1.0,0,B1015,-80.577366,28.5618571,0 16 | 15,2015-04-27,Falcon 9,4707.0,GTO,CCAFS SLC 40,None None,1,False,False,False,,1.0,0,B1016,-80.577366,28.5618571,0 17 | 16,2015-06-28,Falcon 9,2477.0,ISS,CCAFS SLC 40,None ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,1.0,0,B1018,-80.577366,28.5618571,0 18 | 17,2015-12-22,Falcon 9,2034.0,LEO,CCAFS SLC 40,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,1.0,0,B1019,-80.577366,28.5618571,1 19 | 18,2016-01-17,Falcon 9,553.0,PO,VAFB SLC 4E,False ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,1.0,0,B1017,-120.61082900000001,34.632093,0 20 | 19,2016-03-04,Falcon 9,5271.0,GTO,CCAFS SLC 40,False ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,1.0,0,B1020,-80.577366,28.5618571,0 21 | 20,2016-04-08,Falcon 9,3136.0,ISS,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,1,B1021,-80.577366,28.5618571,1 22 | 21,2016-05-06,Falcon 9,4696.0,GTO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,0,B1022,-80.577366,28.5618571,1 23 | 22,2016-05-27,Falcon 9,3100.0,GTO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,1,B1023,-80.577366,28.5618571,1 24 | 23,2016-07-18,Falcon 9,2257.0,ISS,CCAFS SLC 40,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,2.0,1,B1025,-80.577366,28.5618571,1 25 | 24,2016-08-14,Falcon 9,4600.0,GTO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,2.0,0,B1026,-80.577366,28.5618571,1 26 | 25,2016-09-01,Falcon 9,5500.0,GTO,CCAFS SLC 40,None ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,3.0,0,B1028,-80.577366,28.5618571,0 27 | 26,2017-01-14,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,3.0,1,B1029,-120.61082900000001,34.632093,1 28 | 27,2017-02-19,Falcon 9,2490.0,ISS,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,3.0,1,B1031,-80.6039558,28.608058500000002,1 29 | 28,2017-03-16,Falcon 9,5600.0,GTO,KSC LC 39A,None None,1,False,False,False,,3.0,0,B1030,-80.6039558,28.608058500000002,0 30 | 29,2017-03-30,Falcon 9,5300.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,2.0,1,B1021,-80.6039558,28.608058500000002,1 31 | 30,2017-05-01,Falcon 9,6104.959411764706,LEO,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,3.0,1,B1032,-80.6039558,28.608058500000002,1 32 | 31,2017-05-15,Falcon 9,6070.0,GTO,KSC LC 39A,None None,1,False,False,False,,3.0,0,B1034,-80.6039558,28.608058500000002,0 33 | 32,2017-06-03,Falcon 9,2708.0,ISS,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,3.0,1,B1035,-80.6039558,28.608058500000002,1 34 | 33,2017-06-23,Falcon 9,3669.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,3.0,1,B1029,-80.6039558,28.608058500000002,1 35 | 34,2017-06-25,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,3.0,1,B1036,-120.61082900000001,34.632093,1 36 | 35,2017-07-05,Falcon 9,6761.0,GTO,KSC LC 39A,None None,1,False,False,False,,3.0,0,B1037,-80.6039558,28.608058500000002,0 37 | 36,2017-08-14,Falcon 9,2910.0,ISS,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,4.0,1,B1039,-80.6039558,28.608058500000002,1 38 | 37,2017-08-24,Falcon 9,475.0,SSO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,3.0,1,B1038,-120.61082900000001,34.632093,1 39 | 38,2017-09-07,Falcon 9,4990.0,LEO,KSC LC 39A,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,4.0,1,B1040,-80.6039558,28.608058500000002,1 40 | 39,2017-10-09,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,4.0,1,B1041,-120.61082900000001,34.632093,1 41 | 40,2017-10-11,Falcon 9,5200.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,3.0,1,B1031,-80.6039558,28.608058500000002,1 42 | 41,2017-10-30,Falcon 9,3700.0,GTO,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,4.0,0,B1042,-80.6039558,28.608058500000002,1 43 | 42,2017-12-15,Falcon 9,2205.0,ISS,CCAFS SLC 40,True RTLS,2,True,True,True,5e9e3032383ecb267a34e7c7,3.0,1,B1035,-80.577366,28.5618571,1 44 | 43,2017-12-23,Falcon 9,9600.0,PO,VAFB SLC 4E,True Ocean,2,True,True,False,,3.0,1,B1036,-120.61082900000001,34.632093,1 45 | 44,2018-01-08,Falcon 9,6104.959411764706,LEO,CCAFS SLC 40,True RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,4.0,1,B1043,-80.577366,28.5618571,1 46 | 45,2018-01-31,Falcon 9,4230.0,GTO,CCAFS SLC 40,True Ocean,2,True,True,True,,3.0,1,B1032,-80.577366,28.5618571,1 47 | 46,2018-03-06,Falcon 9,6092.0,GTO,CCAFS SLC 40,None None,1,True,False,True,,4.0,0,B1044,-80.577366,28.5618571,0 48 | 47,2018-03-30,Falcon 9,9600.0,PO,VAFB SLC 4E,None None,2,True,True,True,,4.0,1,B1041,-120.61082900000001,34.632093,0 49 | 48,2018-04-02,Falcon 9,2760.0,ISS,CCAFS SLC 40,None None,2,True,True,True,,4.0,1,B1039,-80.577366,28.5618571,0 50 | 49,2018-04-18,Falcon 9,350.0,HEO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,4.0,1,B1045,-80.577366,28.5618571,1 51 | 50,2018-05-11,Falcon 9,3750.0,GTO,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1046,-80.6039558,28.608058500000002,1 52 | 51,2018-06-04,Falcon 9,5383.85,GTO,CCAFS SLC 40,None None,2,False,True,False,,4.0,1,B1040,-80.577366,28.5618571,0 53 | 52,2018-06-29,Falcon 9,2410.0,ISS,CCAFS SLC 40,None None,2,False,True,False,,4.0,1,B1045,-80.577366,28.5618571,0 54 | 53,2018-07-22,Falcon 9,7076.0,GTO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1047,-80.577366,28.5618571,1 55 | 54,2018-07-25,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,5.0,4,B1048,-120.61082900000001,34.632093,1 56 | 55,2018-08-07,Falcon 9,5800.0,GTO,CCAFS SLC 40,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1046,-80.577366,28.5618571,1 57 | 56,2018-09-10,Falcon 9,7060.0,GTO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1049,-80.577366,28.5618571,1 58 | 57,2018-10-08,Falcon 9,2800.0,SSO,VAFB SLC 4E,True RTLS,2,True,True,True,5e9e3032383ecb554034e7c9,5.0,4,B1048,-120.61082900000001,34.632093,1 59 | 58,2018-11-15,Falcon 9,3000.0,GTO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1047,-80.6039558,28.608058500000002,1 60 | 59,2018-12-03,Falcon 9,4000.0,SSO,VAFB SLC 4E,True ASDS,3,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,3,B1046,-120.61082900000001,34.632093,1 61 | 60,2018-12-05,Falcon 9,2573.0,ISS,CCAFS SLC 40,False RTLS,1,True,False,True,5e9e3032383ecb267a34e7c7,5.0,0,B1050,-80.577366,28.5618571,0 62 | 61,2018-12-23,Falcon 9,4400.0,MEO,CCAFS SLC 40,None None,1,False,False,False,,5.0,0,B1054,-80.577366,28.5618571,0 63 | 62,2019-01-11,Falcon 9,9600.0,PO,VAFB SLC 4E,True ASDS,2,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,5,B1049,-120.61082900000001,34.632093,1 64 | 63,2019-03-02,Falcon 9,12259.0,ISS,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1051,-80.6039558,28.608058500000002,1 65 | 64,2019-05-04,Falcon 9,2482.0,ISS,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1056,-80.577366,28.5618571,1 66 | 65,2019-05-24,Falcon 9,13620.0,VLEO,CCAFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1049,-80.577366,28.5618571,1 67 | 66,2019-06-12,Falcon 9,1425.0,SSO,VAFB SLC 4E,True RTLS,2,True,True,True,5e9e3032383ecb554034e7c9,5.0,5,B1051,-120.61082900000001,34.632093,1 68 | 67,2019-07-25,Falcon 9,2227.7,ISS,CCAFS SLC 40,True RTLS,2,True,True,True,5e9e3032383ecb267a34e7c7,5.0,3,B1056,-80.577366,28.5618571,1 69 | 68,2019-08-06,Falcon 9,6500.0,GTO,CCAFS SLC 40,None None,3,False,True,False,,5.0,2,B1047,-80.577366,28.5618571,0 70 | 69,2019-11-11,Falcon 9,15600.0,VLEO,CCAFS SLC 40,True ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,4,B1048,-80.577366,28.5618571,1 71 | 70,2019-12-05,Falcon 9,5000.0,ISS,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1059,-80.577366,28.5618571,1 72 | 71,2019-12-17,Falcon 9,6800.0,GTO,CCAFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1056,-80.577366,28.5618571,1 73 | 72,2020-01-07,Falcon 9,15400.0,VLEO,CCAFS SLC 40,True ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1049,-80.577366,28.5618571,1 74 | 73,2020-01-19,Falcon 9,6104.959411764706,SO,KSC LC 39A,None None,4,False,True,False,,5.0,3,B1046,-80.6039558,28.608058500000002,0 75 | 74,2020-01-29,Falcon 9,15600.0,VLEO,CCAFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1051,-80.577366,28.5618571,1 76 | 75,2020-02-17,Falcon 9,15400.0,VLEO,CCAFS SLC 40,False ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1056,-80.577366,28.5618571,0 77 | 76,2020-03-07,Falcon 9,1977.0,ISS,CCAFS SLC 40,True RTLS,2,True,True,True,5e9e3032383ecb267a34e7c7,5.0,3,B1059,-80.577366,28.5618571,1 78 | 77,2020-03-18,Falcon 9,15600.0,VLEO,KSC LC 39A,False ASDS,5,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,4,B1048,-80.6039558,28.608058500000002,0 79 | 78,2020-04-22,Falcon 9,15400.0,VLEO,KSC LC 39A,True ASDS,4,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1051,-80.6039558,28.608058500000002,1 80 | 79,2020-05-30,Falcon 9,9525.0,ISS,KSC LC 39A,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1058,-80.6039558,28.608058500000002,1 81 | 80,2020-06-04,Falcon 9,15400.0,VLEO,CCAFS SLC 40,True ASDS,5,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,5,B1049,-80.577366,28.5618571,1 82 | 81,2020-06-13,Falcon 9,15400.0,VLEO,CCAFS SLC 40,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,3,B1059,-80.577366,28.5618571,1 83 | 82,2020-06-30,Falcon 9,3880.0,MEO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3033383ecbb9e534e7cc,5.0,2,B1060,-80.577366,28.5618571,1 84 | 83,2020-07-20,Falcon 9,6104.959411764706,GEO,CCAFS SLC 40,True ASDS,2,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,2,B1058,-80.577366,28.5618571,1 85 | 84,2020-08-18,Falcon 9,15400.0,VLEO,CCAFS SLC 40,True ASDS,6,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1049,-80.577366,28.5618571,1 86 | 85,2020-08-30,Falcon 9,1600.0,SSO,CCAFS SLC 40,True RTLS,4,True,True,True,5e9e3032383ecb267a34e7c7,5.0,3,B1059,-80.577366,28.5618571,1 87 | 86,2020-09-03,Falcon 9,15400.0,VLEO,KSC LC 39A,True ASDS,2,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1060,-80.6039558,28.608058500000002,1 88 | 87,2020-10-06,Falcon 9,15400.0,VLEO,KSC LC 39A,True ASDS,3,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,2,B1058,-80.6039558,28.608058500000002,1 89 | 88,2020-10-18,Falcon 9,15400.0,VLEO,KSC LC 39A,True ASDS,6,True,True,True,5e9e3032383ecb6bb234e7ca,5.0,5,B1051,-80.6039558,28.608058500000002,1 90 | 89,2020-10-24,Falcon 9,15400.0,VLEO,CCAFS SLC 40,True ASDS,3,True,True,True,5e9e3033383ecbb9e534e7cc,5.0,2,B1060,-80.577366,28.5618571,1 91 | 90,2020-11-05,Falcon 9,3681.0,MEO,CCAFS SLC 40,True ASDS,1,True,False,True,5e9e3032383ecb6bb234e7ca,5.0,0,B1062,-80.577366,28.5618571,1 92 | -------------------------------------------------------------------------------- /week1-notebook1-monogram2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "# dataroadmap, monogram_2, Week_1\n", 9 | "# تمرین هفته اول -آشنایی با پایتون \n", 10 | "\n", 11 | "\n", 12 | "* Data types\n", 13 | " * Numbers\n", 14 | " * Strings\n", 15 | " * Printing\n", 16 | " * Lists" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "## Data types\n", 24 | "\n", 25 | "### Numbers\n", 26 | "\n", 27 | "### دستورات زیر را با فشردن همزمان کلید شیفت اینتر اجرا کنید" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "a=3" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "print(a)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "1 + 1" 55 | ] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": null, 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [ 63 | "1 * 3" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": null, 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [ 72 | "1 / 2" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [ 81 | "2 ** 4" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": null, 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [ 90 | "a=30" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": null, 96 | "metadata": {}, 97 | "outputs": [], 98 | "source": [ 99 | "a" 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [ 108 | "4 % 2" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": null, 114 | "metadata": {}, 115 | "outputs": [], 116 | "source": [ 117 | "5 % 2" 118 | ] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": {}, 123 | "source": [ 124 | "# :سوال \n", 125 | "# 5%2 = 1???" 126 | ] 127 | }, 128 | { 129 | "cell_type": "markdown", 130 | "metadata": {}, 131 | "source": [ 132 | "جواب را در این قسمت وارد کنید" 133 | ] 134 | }, 135 | { 136 | "cell_type": "markdown", 137 | "metadata": {}, 138 | "source": [ 139 | "# ***" 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "execution_count": null, 145 | "metadata": {}, 146 | "outputs": [], 147 | "source": [ 148 | "(2 + 3) * (5 + 5)" 149 | ] 150 | }, 151 | { 152 | "cell_type": "markdown", 153 | "metadata": {}, 154 | "source": [ 155 | "### Variable Assignment" 156 | ] 157 | }, 158 | { 159 | "cell_type": "markdown", 160 | "metadata": {}, 161 | "source": [ 162 | "Python Variable Names:\n", 163 | "A variable name must start with a letter or the underscore character.\n", 164 | "A variable name cannot start with a number.\n", 165 | "A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )\n", 166 | "Variable names are case-sensitive (age, Age and AGE are three different variables)" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": null, 172 | "metadata": {}, 173 | "outputs": [], 174 | "source": [ 175 | "# Can not start with number or special characters\n", 176 | "name_of_var = 2" 177 | ] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "execution_count": null, 182 | "metadata": {}, 183 | "outputs": [], 184 | "source": [ 185 | "x = 2\n", 186 | "y = 3" 187 | ] 188 | }, 189 | { 190 | "cell_type": "code", 191 | "execution_count": null, 192 | "metadata": {}, 193 | "outputs": [], 194 | "source": [ 195 | "z = x + y" 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "execution_count": null, 201 | "metadata": {}, 202 | "outputs": [], 203 | "source": [ 204 | "z" 205 | ] 206 | }, 207 | { 208 | "cell_type": "markdown", 209 | "metadata": {}, 210 | "source": [ 211 | "### Strings\n", 212 | "رشته‌ها در پایتون را می‌توان با قرار دادن کاراکترها در\n", 213 | " میان جفت نقل قول تک انگلیسی (”) یا جفت نقل قول\n", 214 | " جفت انگلیسی (“”) ساخت " 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": null, 220 | "metadata": {}, 221 | "outputs": [], 222 | "source": [ 223 | "'single quotes'" 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": null, 229 | "metadata": {}, 230 | "outputs": [], 231 | "source": [ 232 | "\"double quotes\"" 233 | ] 234 | }, 235 | { 236 | "cell_type": "code", 237 | "execution_count": null, 238 | "metadata": {}, 239 | "outputs": [], 240 | "source": [ 241 | "\" wrap lot's of other quotes\"" 242 | ] 243 | }, 244 | { 245 | "cell_type": "markdown", 246 | "metadata": {}, 247 | "source": [ 248 | "# تمرین:\n", 249 | "یک رشته با شش کاراکتر ساخته و به یک متغییر دلخواه نسبت دهید؟ " 250 | ] 251 | }, 252 | { 253 | "cell_type": "code", 254 | "execution_count": null, 255 | "metadata": {}, 256 | "outputs": [], 257 | "source": [] 258 | }, 259 | { 260 | "cell_type": "markdown", 261 | "metadata": {}, 262 | "source": [ 263 | "# مثال:" 264 | ] 265 | }, 266 | { 267 | "cell_type": "code", 268 | "execution_count": null, 269 | "metadata": {}, 270 | "outputs": [], 271 | "source": [ 272 | "a=\"dataro\"\n", 273 | "a[3]" 274 | ] 275 | }, 276 | { 277 | "cell_type": "code", 278 | "execution_count": null, 279 | "metadata": {}, 280 | "outputs": [], 281 | "source": [ 282 | "a[-5]" 283 | ] 284 | }, 285 | { 286 | "cell_type": "code", 287 | "execution_count": null, 288 | "metadata": {}, 289 | "outputs": [], 290 | "source": [ 291 | "a[:4]" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": null, 297 | "metadata": {}, 298 | "outputs": [], 299 | "source": [ 300 | "date=\"1400-0105\"" 301 | ] 302 | }, 303 | { 304 | "cell_type": "code", 305 | "execution_count": null, 306 | "metadata": {}, 307 | "outputs": [], 308 | "source": [ 309 | "date[-2:]" 310 | ] 311 | }, 312 | { 313 | "cell_type": "code", 314 | "execution_count": null, 315 | "metadata": {}, 316 | "outputs": [], 317 | "source": [ 318 | "date[6:]" 319 | ] 320 | }, 321 | { 322 | "cell_type": "code", 323 | "execution_count": null, 324 | "metadata": {}, 325 | "outputs": [], 326 | "source": [ 327 | "a[2:]" 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "execution_count": null, 333 | "metadata": {}, 334 | "outputs": [], 335 | "source": [ 336 | "a[:-2]" 337 | ] 338 | }, 339 | { 340 | "cell_type": "markdown", 341 | "metadata": {}, 342 | "source": [ 343 | "\n", 344 | "# شما هم با متغییری که ساخته اید مثل بالا عمل کنید و اعداد مختلفی امتحان کنید و خروجی بگیرید \n", 345 | "چه نتیجه ای میگیرید؟\n" 346 | ] 347 | }, 348 | { 349 | "cell_type": "markdown", 350 | "metadata": {}, 351 | "source": [ 352 | "# ***" 353 | ] 354 | }, 355 | { 356 | "cell_type": "markdown", 357 | "metadata": {}, 358 | "source": [ 359 | "### Printing" 360 | ] 361 | }, 362 | { 363 | "cell_type": "code", 364 | "execution_count": null, 365 | "metadata": {}, 366 | "outputs": [], 367 | "source": [ 368 | "x = 'hello'" 369 | ] 370 | }, 371 | { 372 | "cell_type": "code", 373 | "execution_count": null, 374 | "metadata": {}, 375 | "outputs": [], 376 | "source": [ 377 | "x" 378 | ] 379 | }, 380 | { 381 | "cell_type": "code", 382 | "execution_count": null, 383 | "metadata": {}, 384 | "outputs": [], 385 | "source": [ 386 | "print(x)" 387 | ] 388 | }, 389 | { 390 | "cell_type": "code", 391 | "execution_count": null, 392 | "metadata": {}, 393 | "outputs": [], 394 | "source": [ 395 | "num = 10\n", 396 | "name = 'dataroadmap'\n", 397 | "new = 'monogram'" 398 | ] 399 | }, 400 | { 401 | "cell_type": "code", 402 | "execution_count": null, 403 | "metadata": {}, 404 | "outputs": [], 405 | "source": [ 406 | "print('My number is this is monogram 1: {}, and my name is: {} , and my name is: {}'.format(num,name,new))" 407 | ] 408 | }, 409 | { 410 | "cell_type": "markdown", 411 | "metadata": {}, 412 | "source": [ 413 | "### Lists" 414 | ] 415 | }, 416 | { 417 | "cell_type": "markdown", 418 | "metadata": {}, 419 | "source": [ 420 | "# کدهای زیر را اجرا کرده و در مورد نتایج بدست آمده فکر کنید" 421 | ] 422 | }, 423 | { 424 | "cell_type": "code", 425 | "execution_count": null, 426 | "metadata": {}, 427 | "outputs": [], 428 | "source": [ 429 | "lst=[1,2,3]" 430 | ] 431 | }, 432 | { 433 | "cell_type": "code", 434 | "execution_count": null, 435 | "metadata": {}, 436 | "outputs": [], 437 | "source": [ 438 | "lst[0]" 439 | ] 440 | }, 441 | { 442 | "cell_type": "code", 443 | "execution_count": null, 444 | "metadata": {}, 445 | "outputs": [], 446 | "source": [ 447 | "len(lst)" 448 | ] 449 | }, 450 | { 451 | "cell_type": "code", 452 | "execution_count": null, 453 | "metadata": {}, 454 | "outputs": [], 455 | "source": [ 456 | "lst.append(20)" 457 | ] 458 | }, 459 | { 460 | "cell_type": "code", 461 | "execution_count": null, 462 | "metadata": {}, 463 | "outputs": [], 464 | "source": [ 465 | "lst" 466 | ] 467 | }, 468 | { 469 | "cell_type": "code", 470 | "execution_count": null, 471 | "metadata": {}, 472 | "outputs": [], 473 | "source": [ 474 | "len(lst)" 475 | ] 476 | }, 477 | { 478 | "cell_type": "code", 479 | "execution_count": null, 480 | "metadata": {}, 481 | "outputs": [], 482 | "source": [ 483 | "['hi',1,[1,2]]" 484 | ] 485 | }, 486 | { 487 | "cell_type": "code", 488 | "execution_count": null, 489 | "metadata": {}, 490 | "outputs": [], 491 | "source": [ 492 | "my_list = ['a','b','c']" 493 | ] 494 | }, 495 | { 496 | "cell_type": "code", 497 | "execution_count": null, 498 | "metadata": {}, 499 | "outputs": [], 500 | "source": [ 501 | "my_list.append('d')" 502 | ] 503 | }, 504 | { 505 | "cell_type": "code", 506 | "execution_count": null, 507 | "metadata": {}, 508 | "outputs": [], 509 | "source": [ 510 | "my_list" 511 | ] 512 | }, 513 | { 514 | "cell_type": "code", 515 | "execution_count": null, 516 | "metadata": {}, 517 | "outputs": [], 518 | "source": [ 519 | "my_list[-1]" 520 | ] 521 | }, 522 | { 523 | "cell_type": "code", 524 | "execution_count": null, 525 | "metadata": {}, 526 | "outputs": [], 527 | "source": [ 528 | "my_list[1]" 529 | ] 530 | }, 531 | { 532 | "cell_type": "code", 533 | "execution_count": null, 534 | "metadata": {}, 535 | "outputs": [], 536 | "source": [ 537 | "my_list[1:]" 538 | ] 539 | }, 540 | { 541 | "cell_type": "code", 542 | "execution_count": null, 543 | "metadata": {}, 544 | "outputs": [], 545 | "source": [ 546 | "my_list[:1]" 547 | ] 548 | }, 549 | { 550 | "cell_type": "code", 551 | "execution_count": null, 552 | "metadata": {}, 553 | "outputs": [], 554 | "source": [ 555 | "my_list[2] = 'NEW'" 556 | ] 557 | }, 558 | { 559 | "cell_type": "code", 560 | "execution_count": null, 561 | "metadata": {}, 562 | "outputs": [], 563 | "source": [ 564 | "my_list" 565 | ] 566 | }, 567 | { 568 | "cell_type": "code", 569 | "execution_count": null, 570 | "metadata": {}, 571 | "outputs": [], 572 | "source": [ 573 | "nest = [1,2,3,[4,5,['target']]]" 574 | ] 575 | }, 576 | { 577 | "cell_type": "code", 578 | "execution_count": null, 579 | "metadata": {}, 580 | "outputs": [], 581 | "source": [ 582 | "list_new=[2,4,6,8,10]" 583 | ] 584 | }, 585 | { 586 | "cell_type": "code", 587 | "execution_count": null, 588 | "metadata": {}, 589 | "outputs": [], 590 | "source": [ 591 | "list_new[0]='new'\n", 592 | "list_new" 593 | ] 594 | }, 595 | { 596 | "cell_type": "code", 597 | "execution_count": null, 598 | "metadata": {}, 599 | "outputs": [], 600 | "source": [ 601 | "list_new.insert(3, \"orange\")\n", 602 | "list_new" 603 | ] 604 | }, 605 | { 606 | "cell_type": "code", 607 | "execution_count": null, 608 | "metadata": {}, 609 | "outputs": [], 610 | "source": [ 611 | "list_1=[1,2,3,4,5,6]" 612 | ] 613 | }, 614 | { 615 | "cell_type": "code", 616 | "execution_count": null, 617 | "metadata": {}, 618 | "outputs": [], 619 | "source": [ 620 | "string='dataroadmap'" 621 | ] 622 | }, 623 | { 624 | "cell_type": "code", 625 | "execution_count": null, 626 | "metadata": {}, 627 | "outputs": [], 628 | "source": [ 629 | "nest[3]" 630 | ] 631 | }, 632 | { 633 | "cell_type": "code", 634 | "execution_count": null, 635 | "metadata": {}, 636 | "outputs": [], 637 | "source": [ 638 | "nest" 639 | ] 640 | }, 641 | { 642 | "cell_type": "code", 643 | "execution_count": null, 644 | "metadata": {}, 645 | "outputs": [], 646 | "source": [ 647 | "nest[3]" 648 | ] 649 | }, 650 | { 651 | "cell_type": "code", 652 | "execution_count": null, 653 | "metadata": {}, 654 | "outputs": [], 655 | "source": [ 656 | "nest[3][2][0][2]" 657 | ] 658 | }, 659 | { 660 | "cell_type": "markdown", 661 | "metadata": {}, 662 | "source": [ 663 | "# !موفق باشید" 664 | ] 665 | } 666 | ], 667 | "metadata": { 668 | "kernelspec": { 669 | "display_name": "Python 3 (ipykernel)", 670 | "language": "python", 671 | "name": "python3" 672 | }, 673 | "language_info": { 674 | "codemirror_mode": { 675 | "name": "ipython", 676 | "version": 3 677 | }, 678 | "file_extension": ".py", 679 | "mimetype": "text/x-python", 680 | "name": "python", 681 | "nbconvert_exporter": "python", 682 | "pygments_lexer": "ipython3", 683 | "version": "3.8.3" 684 | } 685 | }, 686 | "nbformat": 4, 687 | "nbformat_minor": 1 688 | } 689 | -------------------------------------------------------------------------------- /week2-notebook1-monogram2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "# dataroadmap, monogram_2, Week_2\n", 9 | "# تمرین هفته دوم -آشنایی با پایتون \n", 10 | "\n", 11 | "\n", 12 | "* Data types\n", 13 | " * Numbers\n", 14 | " * Strings\n", 15 | " * Printing\n", 16 | " * Lists" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "## Data types\n", 24 | "\n", 25 | "### Numbers\n", 26 | "\n", 27 | "### دستورات زیر را با فشردن همزمان کلید شیفت اینتر اجرا کنید" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "a=3" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "print(a)" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "1 + 1" 55 | ] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": null, 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [ 63 | "1 * 3" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": null, 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [ 72 | "1 / 2" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [ 81 | "2 ** 4" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": null, 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [ 90 | "a=30" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": null, 96 | "metadata": {}, 97 | "outputs": [], 98 | "source": [ 99 | "a" 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [ 108 | "4 % 2" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": null, 114 | "metadata": {}, 115 | "outputs": [], 116 | "source": [ 117 | "5 / 2" 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": null, 123 | "metadata": {}, 124 | "outputs": [], 125 | "source": [ 126 | "5 % 2" 127 | ] 128 | }, 129 | { 130 | "cell_type": "code", 131 | "execution_count": null, 132 | "metadata": {}, 133 | "outputs": [], 134 | "source": [ 135 | "5 // 2 " 136 | ] 137 | }, 138 | { 139 | "cell_type": "markdown", 140 | "metadata": {}, 141 | "source": [ 142 | "# :سوال \n", 143 | "# 5%2 = 1???" 144 | ] 145 | }, 146 | { 147 | "cell_type": "markdown", 148 | "metadata": {}, 149 | "source": [ 150 | "جواب را در این قسمت وارد کنید" 151 | ] 152 | }, 153 | { 154 | "cell_type": "markdown", 155 | "metadata": {}, 156 | "source": [ 157 | "# ***" 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": null, 163 | "metadata": {}, 164 | "outputs": [], 165 | "source": [ 166 | "(2 + 3) * (5 + 5)" 167 | ] 168 | }, 169 | { 170 | "cell_type": "markdown", 171 | "metadata": {}, 172 | "source": [ 173 | "### Variable Assignment" 174 | ] 175 | }, 176 | { 177 | "cell_type": "markdown", 178 | "metadata": {}, 179 | "source": [ 180 | "Python Variable Names:\n", 181 | "A variable name must start with a letter or the underscore character.\n", 182 | "A variable name cannot start with a number.\n", 183 | "A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )\n", 184 | "Variable names are case-sensitive (age, Age and AGE are three different variables)" 185 | ] 186 | }, 187 | { 188 | "cell_type": "code", 189 | "execution_count": null, 190 | "metadata": {}, 191 | "outputs": [], 192 | "source": [ 193 | "# Can not start with number or special characters\n", 194 | "name_of_var = 2" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": null, 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [ 203 | "x = 2\n", 204 | "y = 3" 205 | ] 206 | }, 207 | { 208 | "cell_type": "code", 209 | "execution_count": null, 210 | "metadata": {}, 211 | "outputs": [], 212 | "source": [ 213 | "z = x + y" 214 | ] 215 | }, 216 | { 217 | "cell_type": "code", 218 | "execution_count": null, 219 | "metadata": {}, 220 | "outputs": [], 221 | "source": [ 222 | "z" 223 | ] 224 | }, 225 | { 226 | "cell_type": "markdown", 227 | "metadata": {}, 228 | "source": [ 229 | "### Strings\n", 230 | "رشته‌ها در پایتون را می‌توان با قرار دادن کاراکترها در\n", 231 | " میان جفت نقل قول تک انگلیسی (”) یا جفت نقل قول\n", 232 | " جفت انگلیسی (“”) ساخت " 233 | ] 234 | }, 235 | { 236 | "cell_type": "code", 237 | "execution_count": null, 238 | "metadata": {}, 239 | "outputs": [], 240 | "source": [ 241 | "'single quotes'" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": null, 247 | "metadata": {}, 248 | "outputs": [], 249 | "source": [ 250 | "\"double quotes\"" 251 | ] 252 | }, 253 | { 254 | "cell_type": "code", 255 | "execution_count": null, 256 | "metadata": {}, 257 | "outputs": [], 258 | "source": [ 259 | "\" wrap lot's of other quotes\"" 260 | ] 261 | }, 262 | { 263 | "cell_type": "markdown", 264 | "metadata": {}, 265 | "source": [ 266 | "# تمرین:\n", 267 | "یک رشته با شش کاراکتر ساخته و به یک متغییر دلخواه نسبت دهید؟ " 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "execution_count": null, 273 | "metadata": {}, 274 | "outputs": [], 275 | "source": [] 276 | }, 277 | { 278 | "cell_type": "markdown", 279 | "metadata": {}, 280 | "source": [ 281 | "# مثال:" 282 | ] 283 | }, 284 | { 285 | "cell_type": "code", 286 | "execution_count": null, 287 | "metadata": {}, 288 | "outputs": [], 289 | "source": [ 290 | "a=\"dataro\"\n", 291 | "a[3]" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": null, 297 | "metadata": {}, 298 | "outputs": [], 299 | "source": [ 300 | "a[-5]" 301 | ] 302 | }, 303 | { 304 | "cell_type": "code", 305 | "execution_count": null, 306 | "metadata": {}, 307 | "outputs": [], 308 | "source": [ 309 | "a[:4]" 310 | ] 311 | }, 312 | { 313 | "cell_type": "code", 314 | "execution_count": null, 315 | "metadata": {}, 316 | "outputs": [], 317 | "source": [ 318 | "date=\"1400-0105\"" 319 | ] 320 | }, 321 | { 322 | "cell_type": "code", 323 | "execution_count": null, 324 | "metadata": {}, 325 | "outputs": [], 326 | "source": [ 327 | "date[-2:]" 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "execution_count": null, 333 | "metadata": {}, 334 | "outputs": [], 335 | "source": [ 336 | "date[6:]" 337 | ] 338 | }, 339 | { 340 | "cell_type": "code", 341 | "execution_count": null, 342 | "metadata": {}, 343 | "outputs": [], 344 | "source": [ 345 | "a[2:]" 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": null, 351 | "metadata": {}, 352 | "outputs": [], 353 | "source": [ 354 | "a[:-2]" 355 | ] 356 | }, 357 | { 358 | "cell_type": "markdown", 359 | "metadata": {}, 360 | "source": [ 361 | "\n", 362 | "# شما هم با متغییری که ساخته اید مثل بالا عمل کنید و اعداد مختلفی امتحان کنید و خروجی بگیرید \n", 363 | "چه نتیجه ای میگیرید؟\n" 364 | ] 365 | }, 366 | { 367 | "cell_type": "markdown", 368 | "metadata": {}, 369 | "source": [ 370 | "# ***" 371 | ] 372 | }, 373 | { 374 | "cell_type": "markdown", 375 | "metadata": {}, 376 | "source": [ 377 | "### Printing" 378 | ] 379 | }, 380 | { 381 | "cell_type": "code", 382 | "execution_count": null, 383 | "metadata": {}, 384 | "outputs": [], 385 | "source": [ 386 | "x = 'hello'" 387 | ] 388 | }, 389 | { 390 | "cell_type": "code", 391 | "execution_count": null, 392 | "metadata": {}, 393 | "outputs": [], 394 | "source": [ 395 | "x" 396 | ] 397 | }, 398 | { 399 | "cell_type": "code", 400 | "execution_count": null, 401 | "metadata": {}, 402 | "outputs": [], 403 | "source": [ 404 | "print(x)" 405 | ] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "execution_count": null, 410 | "metadata": {}, 411 | "outputs": [], 412 | "source": [ 413 | "name = \"Sarah\"\n", 414 | "sender = 'dataroadmap'\n", 415 | "class_number = 'monogram-2'" 416 | ] 417 | }, 418 | { 419 | "cell_type": "code", 420 | "execution_count": null, 421 | "metadata": {}, 422 | "outputs": [], 423 | "source": [ 424 | "print('Hello {}, this email is from {} , and your class is {}'.format(name,sender,class_number))" 425 | ] 426 | }, 427 | { 428 | "cell_type": "markdown", 429 | "metadata": {}, 430 | "source": [ 431 | "### Lists" 432 | ] 433 | }, 434 | { 435 | "cell_type": "markdown", 436 | "metadata": {}, 437 | "source": [ 438 | "# کدهای زیر را اجرا کرده و در مورد نتایج بدست آمده فکر کنید" 439 | ] 440 | }, 441 | { 442 | "cell_type": "markdown", 443 | "metadata": {}, 444 | "source": [ 445 | "# تمرین-1" 446 | ] 447 | }, 448 | { 449 | "cell_type": "code", 450 | "execution_count": null, 451 | "metadata": {}, 452 | "outputs": [], 453 | "source": [ 454 | "lst_1=[1,2,3]" 455 | ] 456 | }, 457 | { 458 | "cell_type": "code", 459 | "execution_count": null, 460 | "metadata": {}, 461 | "outputs": [], 462 | "source": [ 463 | "lst_1[0]" 464 | ] 465 | }, 466 | { 467 | "cell_type": "code", 468 | "execution_count": null, 469 | "metadata": {}, 470 | "outputs": [], 471 | "source": [ 472 | "len(lst_1)" 473 | ] 474 | }, 475 | { 476 | "cell_type": "code", 477 | "execution_count": null, 478 | "metadata": {}, 479 | "outputs": [], 480 | "source": [ 481 | "lst_1.append(20)" 482 | ] 483 | }, 484 | { 485 | "cell_type": "code", 486 | "execution_count": null, 487 | "metadata": {}, 488 | "outputs": [], 489 | "source": [ 490 | "lst_1" 491 | ] 492 | }, 493 | { 494 | "cell_type": "code", 495 | "execution_count": null, 496 | "metadata": {}, 497 | "outputs": [], 498 | "source": [ 499 | "len(lst_1)" 500 | ] 501 | }, 502 | { 503 | "cell_type": "markdown", 504 | "metadata": {}, 505 | "source": [ 506 | "# تمرین-2" 507 | ] 508 | }, 509 | { 510 | "cell_type": "code", 511 | "execution_count": null, 512 | "metadata": {}, 513 | "outputs": [], 514 | "source": [ 515 | "lst_2=['hi',1,[1,2]]" 516 | ] 517 | }, 518 | { 519 | "cell_type": "code", 520 | "execution_count": null, 521 | "metadata": {}, 522 | "outputs": [], 523 | "source": [ 524 | "lst_3=lst_2[2]\n", 525 | "lst_3" 526 | ] 527 | }, 528 | { 529 | "cell_type": "code", 530 | "execution_count": null, 531 | "metadata": {}, 532 | "outputs": [], 533 | "source": [ 534 | "lst_3[1]" 535 | ] 536 | }, 537 | { 538 | "cell_type": "code", 539 | "execution_count": null, 540 | "metadata": {}, 541 | "outputs": [], 542 | "source": [ 543 | "lst_2[2][1]" 544 | ] 545 | }, 546 | { 547 | "cell_type": "markdown", 548 | "metadata": {}, 549 | "source": [ 550 | "# تمرین-3" 551 | ] 552 | }, 553 | { 554 | "cell_type": "code", 555 | "execution_count": null, 556 | "metadata": {}, 557 | "outputs": [], 558 | "source": [ 559 | "lst_4 = ['a','b','c']" 560 | ] 561 | }, 562 | { 563 | "cell_type": "code", 564 | "execution_count": null, 565 | "metadata": {}, 566 | "outputs": [], 567 | "source": [ 568 | "lst_4.append('d')" 569 | ] 570 | }, 571 | { 572 | "cell_type": "code", 573 | "execution_count": null, 574 | "metadata": {}, 575 | "outputs": [], 576 | "source": [ 577 | "lst_4" 578 | ] 579 | }, 580 | { 581 | "cell_type": "code", 582 | "execution_count": null, 583 | "metadata": {}, 584 | "outputs": [], 585 | "source": [ 586 | "lst_4[2] = 'NEW'" 587 | ] 588 | }, 589 | { 590 | "cell_type": "code", 591 | "execution_count": null, 592 | "metadata": {}, 593 | "outputs": [], 594 | "source": [ 595 | "lst_4" 596 | ] 597 | }, 598 | { 599 | "cell_type": "code", 600 | "execution_count": null, 601 | "metadata": {}, 602 | "outputs": [], 603 | "source": [ 604 | "lst_4=[2,4,6,8,10]" 605 | ] 606 | }, 607 | { 608 | "cell_type": "code", 609 | "execution_count": null, 610 | "metadata": {}, 611 | "outputs": [], 612 | "source": [ 613 | "lst_4[0]='new'\n", 614 | "lst_4" 615 | ] 616 | }, 617 | { 618 | "cell_type": "code", 619 | "execution_count": null, 620 | "metadata": {}, 621 | "outputs": [], 622 | "source": [ 623 | "lst_4.insert(3, \"orange\")\n", 624 | "lst_4" 625 | ] 626 | }, 627 | { 628 | "cell_type": "markdown", 629 | "metadata": {}, 630 | "source": [ 631 | "# تمرین-4\n" 632 | ] 633 | }, 634 | { 635 | "cell_type": "code", 636 | "execution_count": null, 637 | "metadata": {}, 638 | "outputs": [], 639 | "source": [ 640 | "nest = [1,2,3,[4,5,['target']]]" 641 | ] 642 | }, 643 | { 644 | "cell_type": "code", 645 | "execution_count": null, 646 | "metadata": {}, 647 | "outputs": [], 648 | "source": [ 649 | "nest[3]" 650 | ] 651 | }, 652 | { 653 | "cell_type": "code", 654 | "execution_count": null, 655 | "metadata": {}, 656 | "outputs": [], 657 | "source": [ 658 | "nest[3][2]" 659 | ] 660 | }, 661 | { 662 | "cell_type": "code", 663 | "execution_count": null, 664 | "metadata": {}, 665 | "outputs": [], 666 | "source": [ 667 | "nest[3][2][0]" 668 | ] 669 | }, 670 | { 671 | "cell_type": "code", 672 | "execution_count": null, 673 | "metadata": {}, 674 | "outputs": [], 675 | "source": [ 676 | "nest[3][2][0][5]" 677 | ] 678 | }, 679 | { 680 | "cell_type": "code", 681 | "execution_count": null, 682 | "metadata": {}, 683 | "outputs": [], 684 | "source": [ 685 | "lst_1." 686 | ] 687 | }, 688 | { 689 | "cell_type": "markdown", 690 | "metadata": {}, 691 | "source": [ 692 | "# !موفق باشید" 693 | ] 694 | } 695 | ], 696 | "metadata": { 697 | "kernelspec": { 698 | "display_name": "Python 3 (ipykernel)", 699 | "language": "python", 700 | "name": "python3" 701 | }, 702 | "language_info": { 703 | "codemirror_mode": { 704 | "name": "ipython", 705 | "version": 3 706 | }, 707 | "file_extension": ".py", 708 | "mimetype": "text/x-python", 709 | "name": "python", 710 | "nbconvert_exporter": "python", 711 | "pygments_lexer": "ipython3", 712 | "version": "3.8.3" 713 | } 714 | }, 715 | "nbformat": 4, 716 | "nbformat_minor": 1 717 | } 718 | -------------------------------------------------------------------------------- /preprocessed_dataset.csv: -------------------------------------------------------------------------------- 1 | ,PayloadMass,Flights,GridFins,Reused,Legs,Block,ReusedCount,Class,Orbit_ES-L1,Orbit_GEO,Orbit_GTO,Orbit_HEO,Orbit_ISS,Orbit_LEO,Orbit_MEO,Orbit_PO,Orbit_SO,Orbit_SSO,Orbit_VLEO,LaunchSite_CCAFS SLC 40,LaunchSite_KSC LC 39A,LaunchSite_VAFB SLC 4E,Outcome_False ASDS,Outcome_False Ocean,Outcome_False RTLS,Outcome_None ASDS,Outcome_None None,Outcome_True ASDS,Outcome_True Ocean,Outcome_True RTLS,LandingPad_5e9e3032383ecb267a34e7c7,LandingPad_5e9e3032383ecb554034e7c9,LandingPad_5e9e3032383ecb6bb234e7ca,LandingPad_5e9e3032383ecb761634e7cb,LandingPad_5e9e3033383ecbb9e534e7cc,Serial_B0003,Serial_B0005,Serial_B0007,Serial_B1003,Serial_B1004,Serial_B1005,Serial_B1006,Serial_B1007,Serial_B1008,Serial_B1010,Serial_B1011,Serial_B1012,Serial_B1013,Serial_B1015,Serial_B1016,Serial_B1017,Serial_B1018,Serial_B1019,Serial_B1020,Serial_B1021,Serial_B1022,Serial_B1023,Serial_B1025,Serial_B1026,Serial_B1028,Serial_B1029,Serial_B1030,Serial_B1031,Serial_B1032,Serial_B1034,Serial_B1035,Serial_B1036,Serial_B1037,Serial_B1038,Serial_B1039,Serial_B1040,Serial_B1041,Serial_B1042,Serial_B1043,Serial_B1044,Serial_B1045,Serial_B1046,Serial_B1047,Serial_B1048,Serial_B1049,Serial_B1050,Serial_B1051,Serial_B1054,Serial_B1056,Serial_B1058,Serial_B1059,Serial_B1060,Serial_B1062 2 | 0,6104.959411764706,1,0,0,0,1.0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,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,3,1,1,1,5.0,2,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,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,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,0,1,0 91 | 89,3681.0,1,1,0,1,5.0,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,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,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,0,0,0,0,1 92 | -------------------------------------------------------------------------------- /week7-notebook1-KNN-monogram2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Monogram2-week7-notebook1\n", 8 | "\n", 9 | "# K Nearest Neighbor\n", 10 | "\n", 11 | "\n", 12 | "## Import Libraries\n", 13 | "Let's import some libraries to get started!" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 1, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "import pandas as pd" 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "## The Data\n", 30 | "\n" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 2, 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "df = pd.read_csv('preprocessed_dataset.csv')" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 3, 45 | "metadata": {}, 46 | "outputs": [ 47 | { 48 | "data": { 49 | "text/html": [ 50 | "
\n", 51 | "\n", 64 | "\n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | "
Unnamed: 0PayloadMassFlightsGridFinsReusedLegsBlockReusedCountClassOrbit_ES-L1...Serial_B1048Serial_B1049Serial_B1050Serial_B1051Serial_B1054Serial_B1056Serial_B1058Serial_B1059Serial_B1060Serial_B1062
006104.95941210001.0000...0000000000
11525.00000010001.0000...0000000000
22677.00000010001.0000...0000000000
33500.00000010001.0000...0000000000
443170.00000010001.0000...0000000000
\n", 214 | "

5 rows × 89 columns

\n", 215 | "
" 216 | ], 217 | "text/plain": [ 218 | " Unnamed: 0 PayloadMass Flights GridFins Reused Legs Block \\\n", 219 | "0 0 6104.959412 1 0 0 0 1.0 \n", 220 | "1 1 525.000000 1 0 0 0 1.0 \n", 221 | "2 2 677.000000 1 0 0 0 1.0 \n", 222 | "3 3 500.000000 1 0 0 0 1.0 \n", 223 | "4 4 3170.000000 1 0 0 0 1.0 \n", 224 | "\n", 225 | " ReusedCount Class Orbit_ES-L1 ... Serial_B1048 Serial_B1049 \\\n", 226 | "0 0 0 0 ... 0 0 \n", 227 | "1 0 0 0 ... 0 0 \n", 228 | "2 0 0 0 ... 0 0 \n", 229 | "3 0 0 0 ... 0 0 \n", 230 | "4 0 0 0 ... 0 0 \n", 231 | "\n", 232 | " Serial_B1050 Serial_B1051 Serial_B1054 Serial_B1056 Serial_B1058 \\\n", 233 | "0 0 0 0 0 0 \n", 234 | "1 0 0 0 0 0 \n", 235 | "2 0 0 0 0 0 \n", 236 | "3 0 0 0 0 0 \n", 237 | "4 0 0 0 0 0 \n", 238 | "\n", 239 | " Serial_B1059 Serial_B1060 Serial_B1062 \n", 240 | "0 0 0 0 \n", 241 | "1 0 0 0 \n", 242 | "2 0 0 0 \n", 243 | "3 0 0 0 \n", 244 | "4 0 0 0 \n", 245 | "\n", 246 | "[5 rows x 89 columns]" 247 | ] 248 | }, 249 | "execution_count": 3, 250 | "metadata": {}, 251 | "output_type": "execute_result" 252 | } 253 | ], 254 | "source": [ 255 | "df.head()" 256 | ] 257 | }, 258 | { 259 | "cell_type": "markdown", 260 | "metadata": {}, 261 | "source": [ 262 | "# Exploratory Data Analysis\n", 263 | "\n", 264 | "Let's begin some exploratory data analysis! We'll start by checking out missing data!\n", 265 | "\n", 266 | "## Missing Data\n", 267 | "\n" 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "execution_count": 4, 273 | "metadata": { 274 | "scrolled": true 275 | }, 276 | "outputs": [ 277 | { 278 | "name": "stdout", 279 | "output_type": "stream", 280 | "text": [ 281 | "\n", 282 | "RangeIndex: 90 entries, 0 to 89\n", 283 | "Data columns (total 89 columns):\n", 284 | " # Column Non-Null Count Dtype \n", 285 | "--- ------ -------------- ----- \n", 286 | " 0 Unnamed: 0 90 non-null int64 \n", 287 | " 1 PayloadMass 90 non-null float64\n", 288 | " 2 Flights 90 non-null int64 \n", 289 | " 3 GridFins 90 non-null int64 \n", 290 | " 4 Reused 90 non-null int64 \n", 291 | " 5 Legs 90 non-null int64 \n", 292 | " 6 Block 90 non-null float64\n", 293 | " 7 ReusedCount 90 non-null int64 \n", 294 | " 8 Class 90 non-null int64 \n", 295 | " 9 Orbit_ES-L1 90 non-null int64 \n", 296 | " 10 Orbit_GEO 90 non-null int64 \n", 297 | " 11 Orbit_GTO 90 non-null int64 \n", 298 | " 12 Orbit_HEO 90 non-null int64 \n", 299 | " 13 Orbit_ISS 90 non-null int64 \n", 300 | " 14 Orbit_LEO 90 non-null int64 \n", 301 | " 15 Orbit_MEO 90 non-null int64 \n", 302 | " 16 Orbit_PO 90 non-null int64 \n", 303 | " 17 Orbit_SO 90 non-null int64 \n", 304 | " 18 Orbit_SSO 90 non-null int64 \n", 305 | " 19 Orbit_VLEO 90 non-null int64 \n", 306 | " 20 LaunchSite_CCAFS SLC 40 90 non-null int64 \n", 307 | " 21 LaunchSite_KSC LC 39A 90 non-null int64 \n", 308 | " 22 LaunchSite_VAFB SLC 4E 90 non-null int64 \n", 309 | " 23 Outcome_False ASDS 90 non-null int64 \n", 310 | " 24 Outcome_False Ocean 90 non-null int64 \n", 311 | " 25 Outcome_False RTLS 90 non-null int64 \n", 312 | " 26 Outcome_None ASDS 90 non-null int64 \n", 313 | " 27 Outcome_None None 90 non-null int64 \n", 314 | " 28 Outcome_True ASDS 90 non-null int64 \n", 315 | " 29 Outcome_True Ocean 90 non-null int64 \n", 316 | " 30 Outcome_True RTLS 90 non-null int64 \n", 317 | " 31 LandingPad_5e9e3032383ecb267a34e7c7 90 non-null int64 \n", 318 | " 32 LandingPad_5e9e3032383ecb554034e7c9 90 non-null int64 \n", 319 | " 33 LandingPad_5e9e3032383ecb6bb234e7ca 90 non-null int64 \n", 320 | " 34 LandingPad_5e9e3032383ecb761634e7cb 90 non-null int64 \n", 321 | " 35 LandingPad_5e9e3033383ecbb9e534e7cc 90 non-null int64 \n", 322 | " 36 Serial_B0003 90 non-null int64 \n", 323 | " 37 Serial_B0005 90 non-null int64 \n", 324 | " 38 Serial_B0007 90 non-null int64 \n", 325 | " 39 Serial_B1003 90 non-null int64 \n", 326 | " 40 Serial_B1004 90 non-null int64 \n", 327 | " 41 Serial_B1005 90 non-null int64 \n", 328 | " 42 Serial_B1006 90 non-null int64 \n", 329 | " 43 Serial_B1007 90 non-null int64 \n", 330 | " 44 Serial_B1008 90 non-null int64 \n", 331 | " 45 Serial_B1010 90 non-null int64 \n", 332 | " 46 Serial_B1011 90 non-null int64 \n", 333 | " 47 Serial_B1012 90 non-null int64 \n", 334 | " 48 Serial_B1013 90 non-null int64 \n", 335 | " 49 Serial_B1015 90 non-null int64 \n", 336 | " 50 Serial_B1016 90 non-null int64 \n", 337 | " 51 Serial_B1017 90 non-null int64 \n", 338 | " 52 Serial_B1018 90 non-null int64 \n", 339 | " 53 Serial_B1019 90 non-null int64 \n", 340 | " 54 Serial_B1020 90 non-null int64 \n", 341 | " 55 Serial_B1021 90 non-null int64 \n", 342 | " 56 Serial_B1022 90 non-null int64 \n", 343 | " 57 Serial_B1023 90 non-null int64 \n", 344 | " 58 Serial_B1025 90 non-null int64 \n", 345 | " 59 Serial_B1026 90 non-null int64 \n", 346 | " 60 Serial_B1028 90 non-null int64 \n", 347 | " 61 Serial_B1029 90 non-null int64 \n", 348 | " 62 Serial_B1030 90 non-null int64 \n", 349 | " 63 Serial_B1031 90 non-null int64 \n", 350 | " 64 Serial_B1032 90 non-null int64 \n", 351 | " 65 Serial_B1034 90 non-null int64 \n", 352 | " 66 Serial_B1035 90 non-null int64 \n", 353 | " 67 Serial_B1036 90 non-null int64 \n", 354 | " 68 Serial_B1037 90 non-null int64 \n", 355 | " 69 Serial_B1038 90 non-null int64 \n", 356 | " 70 Serial_B1039 90 non-null int64 \n", 357 | " 71 Serial_B1040 90 non-null int64 \n", 358 | " 72 Serial_B1041 90 non-null int64 \n", 359 | " 73 Serial_B1042 90 non-null int64 \n", 360 | " 74 Serial_B1043 90 non-null int64 \n", 361 | " 75 Serial_B1044 90 non-null int64 \n", 362 | " 76 Serial_B1045 90 non-null int64 \n", 363 | " 77 Serial_B1046 90 non-null int64 \n", 364 | " 78 Serial_B1047 90 non-null int64 \n", 365 | " 79 Serial_B1048 90 non-null int64 \n", 366 | " 80 Serial_B1049 90 non-null int64 \n", 367 | " 81 Serial_B1050 90 non-null int64 \n", 368 | " 82 Serial_B1051 90 non-null int64 \n", 369 | " 83 Serial_B1054 90 non-null int64 \n", 370 | " 84 Serial_B1056 90 non-null int64 \n", 371 | " 85 Serial_B1058 90 non-null int64 \n", 372 | " 86 Serial_B1059 90 non-null int64 \n", 373 | " 87 Serial_B1060 90 non-null int64 \n", 374 | " 88 Serial_B1062 90 non-null int64 \n", 375 | "dtypes: float64(2), int64(87)\n", 376 | "memory usage: 62.7 KB\n" 377 | ] 378 | } 379 | ], 380 | "source": [ 381 | "df.info()" 382 | ] 383 | }, 384 | { 385 | "cell_type": "markdown", 386 | "metadata": {}, 387 | "source": [ 388 | "# Define X , y" 389 | ] 390 | }, 391 | { 392 | "cell_type": "code", 393 | "execution_count": 5, 394 | "metadata": {}, 395 | "outputs": [], 396 | "source": [ 397 | "X=df.drop('Class',axis=1)\n", 398 | "y=df['Class']" 399 | ] 400 | }, 401 | { 402 | "cell_type": "markdown", 403 | "metadata": {}, 404 | "source": [ 405 | "Great! Our data is ready for our model!\n", 406 | "\n", 407 | "# Building a k nearest neighbor\n", 408 | "\n", 409 | "Let's start by splitting our data into a training set and test set.\n", 410 | "## Train Test Split" 411 | ] 412 | }, 413 | { 414 | "cell_type": "code", 415 | "execution_count": 6, 416 | "metadata": {}, 417 | "outputs": [], 418 | "source": [ 419 | "from sklearn.model_selection import train_test_split" 420 | ] 421 | }, 422 | { 423 | "cell_type": "code", 424 | "execution_count": 7, 425 | "metadata": {}, 426 | "outputs": [], 427 | "source": [ 428 | "X_train, X_test, y_train, y_test = train_test_split(X, \n", 429 | " y, test_size=0.20, \n", 430 | " random_state=101)" 431 | ] 432 | }, 433 | { 434 | "cell_type": "markdown", 435 | "metadata": {}, 436 | "source": [ 437 | "## Training and Predicting" 438 | ] 439 | }, 440 | { 441 | "cell_type": "code", 442 | "execution_count": 8, 443 | "metadata": {}, 444 | "outputs": [], 445 | "source": [ 446 | "# K Nearest Neighbors classification algorithm\n", 447 | "from sklearn.neighbors import KNeighborsClassifier" 448 | ] 449 | }, 450 | { 451 | "cell_type": "code", 452 | "execution_count": 49, 453 | "metadata": {}, 454 | "outputs": [], 455 | "source": [ 456 | "knn = KNeighborsClassifier(n_neighbors=10)" 457 | ] 458 | }, 459 | { 460 | "cell_type": "code", 461 | "execution_count": 50, 462 | "metadata": {}, 463 | "outputs": [ 464 | { 465 | "data": { 466 | "text/plain": [ 467 | "KNeighborsClassifier(n_neighbors=10)" 468 | ] 469 | }, 470 | "execution_count": 50, 471 | "metadata": {}, 472 | "output_type": "execute_result" 473 | } 474 | ], 475 | "source": [ 476 | "knn.fit(X_train,y_train)" 477 | ] 478 | }, 479 | { 480 | "cell_type": "code", 481 | "execution_count": 51, 482 | "metadata": {}, 483 | "outputs": [], 484 | "source": [ 485 | "predictions = knn.predict(X_test)" 486 | ] 487 | }, 488 | { 489 | "cell_type": "code", 490 | "execution_count": 52, 491 | "metadata": { 492 | "scrolled": true 493 | }, 494 | "outputs": [ 495 | { 496 | "data": { 497 | "text/plain": [ 498 | "array([0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1], dtype=int64)" 499 | ] 500 | }, 501 | "execution_count": 52, 502 | "metadata": {}, 503 | "output_type": "execute_result" 504 | } 505 | ], 506 | "source": [ 507 | "predictions" 508 | ] 509 | }, 510 | { 511 | "cell_type": "code", 512 | "execution_count": 43, 513 | "metadata": { 514 | "scrolled": true 515 | }, 516 | "outputs": [ 517 | { 518 | "data": { 519 | "text/plain": [ 520 | "50 0\n", 521 | "6 1\n", 522 | "51 0\n", 523 | "54 1\n", 524 | "53 1\n", 525 | "69 1\n", 526 | "32 1\n", 527 | "31 1\n", 528 | "21 1\n", 529 | "88 1\n", 530 | "43 1\n", 531 | "47 0\n", 532 | "3 0\n", 533 | "1 0\n", 534 | "74 0\n", 535 | "16 1\n", 536 | "45 0\n", 537 | "25 1\n", 538 | "Name: Class, dtype: int64" 539 | ] 540 | }, 541 | "execution_count": 43, 542 | "metadata": {}, 543 | "output_type": "execute_result" 544 | } 545 | ], 546 | "source": [ 547 | "y_test" 548 | ] 549 | }, 550 | { 551 | "cell_type": "markdown", 552 | "metadata": {}, 553 | "source": [ 554 | "Let's move on to evaluate our model!" 555 | ] 556 | }, 557 | { 558 | "cell_type": "markdown", 559 | "metadata": {}, 560 | "source": [ 561 | "## Evaluation" 562 | ] 563 | }, 564 | { 565 | "cell_type": "markdown", 566 | "metadata": {}, 567 | "source": [ 568 | "Let's bring Confusion Matrix!" 569 | ] 570 | }, 571 | { 572 | "cell_type": "code", 573 | "execution_count": 44, 574 | "metadata": {}, 575 | "outputs": [], 576 | "source": [ 577 | "from sklearn.metrics import confusion_matrix" 578 | ] 579 | }, 580 | { 581 | "cell_type": "code", 582 | "execution_count": 45, 583 | "metadata": { 584 | "scrolled": true 585 | }, 586 | "outputs": [ 587 | { 588 | "data": { 589 | "text/plain": [ 590 | "array([[2, 5],\n", 591 | " [2, 9]], dtype=int64)" 592 | ] 593 | }, 594 | "execution_count": 45, 595 | "metadata": {}, 596 | "output_type": "execute_result" 597 | } 598 | ], 599 | "source": [ 600 | "confusion_matrix(y_test,predictions)" 601 | ] 602 | }, 603 | { 604 | "cell_type": "markdown", 605 | "metadata": {}, 606 | "source": [ 607 | "We can check precision,recall,f1-score using classification report!" 608 | ] 609 | }, 610 | { 611 | "cell_type": "code", 612 | "execution_count": 46, 613 | "metadata": {}, 614 | "outputs": [], 615 | "source": [ 616 | "from sklearn.metrics import accuracy_score" 617 | ] 618 | }, 619 | { 620 | "cell_type": "code", 621 | "execution_count": 47, 622 | "metadata": {}, 623 | "outputs": [ 624 | { 625 | "data": { 626 | "text/plain": [ 627 | "11" 628 | ] 629 | }, 630 | "execution_count": 47, 631 | "metadata": {}, 632 | "output_type": "execute_result" 633 | } 634 | ], 635 | "source": [ 636 | "accuracy_score(y_test,predictions, normalize=False)" 637 | ] 638 | }, 639 | { 640 | "cell_type": "code", 641 | "execution_count": 48, 642 | "metadata": {}, 643 | "outputs": [ 644 | { 645 | "data": { 646 | "text/plain": [ 647 | "0.6111111111111112" 648 | ] 649 | }, 650 | "execution_count": 48, 651 | "metadata": {}, 652 | "output_type": "execute_result" 653 | } 654 | ], 655 | "source": [ 656 | "accuracy_score(y_test,predictions, normalize=True)" 657 | ] 658 | }, 659 | { 660 | "cell_type": "code", 661 | "execution_count": 19, 662 | "metadata": {}, 663 | "outputs": [], 664 | "source": [ 665 | "from sklearn.metrics import classification_report" 666 | ] 667 | }, 668 | { 669 | "cell_type": "code", 670 | "execution_count": 20, 671 | "metadata": {}, 672 | "outputs": [ 673 | { 674 | "name": "stdout", 675 | "output_type": "stream", 676 | "text": [ 677 | " precision recall f1-score support\n", 678 | "\n", 679 | " 0 0.40 0.29 0.33 7\n", 680 | " 1 0.62 0.73 0.67 11\n", 681 | "\n", 682 | " accuracy 0.56 18\n", 683 | " macro avg 0.51 0.51 0.50 18\n", 684 | "weighted avg 0.53 0.56 0.54 18\n", 685 | "\n" 686 | ] 687 | } 688 | ], 689 | "source": [ 690 | "print(classification_report(y_test,predictions))" 691 | ] 692 | }, 693 | { 694 | "cell_type": "markdown", 695 | "metadata": {}, 696 | "source": [ 697 | "\n", 698 | "## Grid Search!" 699 | ] 700 | }, 701 | { 702 | "cell_type": "code", 703 | "execution_count": 21, 704 | "metadata": {}, 705 | "outputs": [], 706 | "source": [ 707 | "knn_1 = KNeighborsClassifier()" 708 | ] 709 | }, 710 | { 711 | "cell_type": "code", 712 | "execution_count": 22, 713 | "metadata": {}, 714 | "outputs": [], 715 | "source": [ 716 | "# Allows us to test parameters of classification algorithms and find the best one\n", 717 | "from sklearn.model_selection import GridSearchCV" 718 | ] 719 | }, 720 | { 721 | "cell_type": "code", 722 | "execution_count": 23, 723 | "metadata": {}, 724 | "outputs": [], 725 | "source": [ 726 | "parameters = {'n_neighbors': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}" 727 | ] 728 | }, 729 | { 730 | "cell_type": "code", 731 | "execution_count": 24, 732 | "metadata": {}, 733 | "outputs": [ 734 | { 735 | "data": { 736 | "text/plain": [ 737 | "GridSearchCV(estimator=KNeighborsClassifier(),\n", 738 | " param_grid={'n_neighbors': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})" 739 | ] 740 | }, 741 | "execution_count": 24, 742 | "metadata": {}, 743 | "output_type": "execute_result" 744 | } 745 | ], 746 | "source": [ 747 | "knn_cv = GridSearchCV(knn_1, parameters)\n", 748 | "knn_cv.fit(X_train, y_train)" 749 | ] 750 | }, 751 | { 752 | "cell_type": "code", 753 | "execution_count": 32, 754 | "metadata": {}, 755 | "outputs": [ 756 | { 757 | "name": "stdout", 758 | "output_type": "stream", 759 | "text": [ 760 | "tuned hpyerparameters :(best parameters) {'n_neighbors': 9}\n" 761 | ] 762 | } 763 | ], 764 | "source": [ 765 | "print(\"tuned hpyerparameters :(best parameters) \",knn_cv.best_params_)" 766 | ] 767 | }, 768 | { 769 | "cell_type": "code", 770 | "execution_count": 33, 771 | "metadata": {}, 772 | "outputs": [], 773 | "source": [ 774 | "knn_1 = KNeighborsClassifier(n_neighbors=9)" 775 | ] 776 | }, 777 | { 778 | "cell_type": "code", 779 | "execution_count": 34, 780 | "metadata": {}, 781 | "outputs": [ 782 | { 783 | "data": { 784 | "text/plain": [ 785 | "KNeighborsClassifier(n_neighbors=9)" 786 | ] 787 | }, 788 | "execution_count": 34, 789 | "metadata": {}, 790 | "output_type": "execute_result" 791 | } 792 | ], 793 | "source": [ 794 | "knn_1.fit(X_train,y_train)" 795 | ] 796 | }, 797 | { 798 | "cell_type": "code", 799 | "execution_count": 35, 800 | "metadata": {}, 801 | "outputs": [], 802 | "source": [ 803 | "predictions_1 = knn_1.predict(X_test)" 804 | ] 805 | }, 806 | { 807 | "cell_type": "code", 808 | "execution_count": 36, 809 | "metadata": {}, 810 | "outputs": [ 811 | { 812 | "data": { 813 | "text/plain": [ 814 | "array([[2, 5],\n", 815 | " [2, 9]], dtype=int64)" 816 | ] 817 | }, 818 | "execution_count": 36, 819 | "metadata": {}, 820 | "output_type": "execute_result" 821 | } 822 | ], 823 | "source": [ 824 | "confusion_matrix(y_test,predictions_1)" 825 | ] 826 | }, 827 | { 828 | "cell_type": "code", 829 | "execution_count": 37, 830 | "metadata": {}, 831 | "outputs": [ 832 | { 833 | "data": { 834 | "text/plain": [ 835 | "11" 836 | ] 837 | }, 838 | "execution_count": 37, 839 | "metadata": {}, 840 | "output_type": "execute_result" 841 | } 842 | ], 843 | "source": [ 844 | "accuracy_score(y_test,predictions_1, normalize=False)" 845 | ] 846 | }, 847 | { 848 | "cell_type": "code", 849 | "execution_count": 38, 850 | "metadata": {}, 851 | "outputs": [ 852 | { 853 | "data": { 854 | "text/plain": [ 855 | "0.6111111111111112" 856 | ] 857 | }, 858 | "execution_count": 38, 859 | "metadata": {}, 860 | "output_type": "execute_result" 861 | } 862 | ], 863 | "source": [ 864 | "accuracy_score(y_test,predictions_1, normalize=True)" 865 | ] 866 | }, 867 | { 868 | "cell_type": "markdown", 869 | "metadata": {}, 870 | "source": [ 871 | "# Good Job!" 872 | ] 873 | } 874 | ], 875 | "metadata": { 876 | "kernelspec": { 877 | "display_name": "Python 3 (ipykernel)", 878 | "language": "python", 879 | "name": "python3" 880 | }, 881 | "language_info": { 882 | "codemirror_mode": { 883 | "name": "ipython", 884 | "version": 3 885 | }, 886 | "file_extension": ".py", 887 | "mimetype": "text/x-python", 888 | "name": "python", 889 | "nbconvert_exporter": "python", 890 | "pygments_lexer": "ipython3", 891 | "version": "3.8.3" 892 | } 893 | }, 894 | "nbformat": 4, 895 | "nbformat_minor": 1 896 | } 897 | -------------------------------------------------------------------------------- /week8-notebook1-DecisionTree-RandomForest-monogram2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Monogram2-week8-notebook1\n", 8 | "\n", 9 | "# Decision Trees and Random Forest\n", 10 | "\n", 11 | "\n", 12 | "## Import Libraries\n", 13 | "Let's import some libraries to get started!" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 30, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "import pandas as pd" 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "## The Data\n", 30 | "\n" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 31, 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "df = pd.read_csv('preprocessed_dataset.csv')" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 32, 45 | "metadata": {}, 46 | "outputs": [ 47 | { 48 | "data": { 49 | "text/html": [ 50 | "
\n", 51 | "\n", 64 | "\n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | "
Unnamed: 0PayloadMassFlightsGridFinsReusedLegsBlockReusedCountClassOrbit_ES-L1...Serial_B1048Serial_B1049Serial_B1050Serial_B1051Serial_B1054Serial_B1056Serial_B1058Serial_B1059Serial_B1060Serial_B1062
006104.95941210001.0000...0000000000
11525.00000010001.0000...0000000000
22677.00000010001.0000...0000000000
33500.00000010001.0000...0000000000
443170.00000010001.0000...0000000000
\n", 214 | "

5 rows × 89 columns

\n", 215 | "
" 216 | ], 217 | "text/plain": [ 218 | " Unnamed: 0 PayloadMass Flights GridFins Reused Legs Block \\\n", 219 | "0 0 6104.959412 1 0 0 0 1.0 \n", 220 | "1 1 525.000000 1 0 0 0 1.0 \n", 221 | "2 2 677.000000 1 0 0 0 1.0 \n", 222 | "3 3 500.000000 1 0 0 0 1.0 \n", 223 | "4 4 3170.000000 1 0 0 0 1.0 \n", 224 | "\n", 225 | " ReusedCount Class Orbit_ES-L1 ... Serial_B1048 Serial_B1049 \\\n", 226 | "0 0 0 0 ... 0 0 \n", 227 | "1 0 0 0 ... 0 0 \n", 228 | "2 0 0 0 ... 0 0 \n", 229 | "3 0 0 0 ... 0 0 \n", 230 | "4 0 0 0 ... 0 0 \n", 231 | "\n", 232 | " Serial_B1050 Serial_B1051 Serial_B1054 Serial_B1056 Serial_B1058 \\\n", 233 | "0 0 0 0 0 0 \n", 234 | "1 0 0 0 0 0 \n", 235 | "2 0 0 0 0 0 \n", 236 | "3 0 0 0 0 0 \n", 237 | "4 0 0 0 0 0 \n", 238 | "\n", 239 | " Serial_B1059 Serial_B1060 Serial_B1062 \n", 240 | "0 0 0 0 \n", 241 | "1 0 0 0 \n", 242 | "2 0 0 0 \n", 243 | "3 0 0 0 \n", 244 | "4 0 0 0 \n", 245 | "\n", 246 | "[5 rows x 89 columns]" 247 | ] 248 | }, 249 | "execution_count": 32, 250 | "metadata": {}, 251 | "output_type": "execute_result" 252 | } 253 | ], 254 | "source": [ 255 | "df.head()" 256 | ] 257 | }, 258 | { 259 | "cell_type": "markdown", 260 | "metadata": {}, 261 | "source": [ 262 | "# Exploratory Data Analysis\n", 263 | "\n", 264 | "Let's begin some exploratory data analysis! We'll start by checking out missing data!\n", 265 | "\n", 266 | "## Missing Data\n", 267 | "\n" 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "execution_count": 4, 273 | "metadata": { 274 | "scrolled": true 275 | }, 276 | "outputs": [ 277 | { 278 | "name": "stdout", 279 | "output_type": "stream", 280 | "text": [ 281 | "\n", 282 | "RangeIndex: 90 entries, 0 to 89\n", 283 | "Data columns (total 89 columns):\n", 284 | " # Column Non-Null Count Dtype \n", 285 | "--- ------ -------------- ----- \n", 286 | " 0 Unnamed: 0 90 non-null int64 \n", 287 | " 1 PayloadMass 90 non-null float64\n", 288 | " 2 Flights 90 non-null int64 \n", 289 | " 3 GridFins 90 non-null int64 \n", 290 | " 4 Reused 90 non-null int64 \n", 291 | " 5 Legs 90 non-null int64 \n", 292 | " 6 Block 90 non-null float64\n", 293 | " 7 ReusedCount 90 non-null int64 \n", 294 | " 8 Class 90 non-null int64 \n", 295 | " 9 Orbit_ES-L1 90 non-null int64 \n", 296 | " 10 Orbit_GEO 90 non-null int64 \n", 297 | " 11 Orbit_GTO 90 non-null int64 \n", 298 | " 12 Orbit_HEO 90 non-null int64 \n", 299 | " 13 Orbit_ISS 90 non-null int64 \n", 300 | " 14 Orbit_LEO 90 non-null int64 \n", 301 | " 15 Orbit_MEO 90 non-null int64 \n", 302 | " 16 Orbit_PO 90 non-null int64 \n", 303 | " 17 Orbit_SO 90 non-null int64 \n", 304 | " 18 Orbit_SSO 90 non-null int64 \n", 305 | " 19 Orbit_VLEO 90 non-null int64 \n", 306 | " 20 LaunchSite_CCAFS SLC 40 90 non-null int64 \n", 307 | " 21 LaunchSite_KSC LC 39A 90 non-null int64 \n", 308 | " 22 LaunchSite_VAFB SLC 4E 90 non-null int64 \n", 309 | " 23 Outcome_False ASDS 90 non-null int64 \n", 310 | " 24 Outcome_False Ocean 90 non-null int64 \n", 311 | " 25 Outcome_False RTLS 90 non-null int64 \n", 312 | " 26 Outcome_None ASDS 90 non-null int64 \n", 313 | " 27 Outcome_None None 90 non-null int64 \n", 314 | " 28 Outcome_True ASDS 90 non-null int64 \n", 315 | " 29 Outcome_True Ocean 90 non-null int64 \n", 316 | " 30 Outcome_True RTLS 90 non-null int64 \n", 317 | " 31 LandingPad_5e9e3032383ecb267a34e7c7 90 non-null int64 \n", 318 | " 32 LandingPad_5e9e3032383ecb554034e7c9 90 non-null int64 \n", 319 | " 33 LandingPad_5e9e3032383ecb6bb234e7ca 90 non-null int64 \n", 320 | " 34 LandingPad_5e9e3032383ecb761634e7cb 90 non-null int64 \n", 321 | " 35 LandingPad_5e9e3033383ecbb9e534e7cc 90 non-null int64 \n", 322 | " 36 Serial_B0003 90 non-null int64 \n", 323 | " 37 Serial_B0005 90 non-null int64 \n", 324 | " 38 Serial_B0007 90 non-null int64 \n", 325 | " 39 Serial_B1003 90 non-null int64 \n", 326 | " 40 Serial_B1004 90 non-null int64 \n", 327 | " 41 Serial_B1005 90 non-null int64 \n", 328 | " 42 Serial_B1006 90 non-null int64 \n", 329 | " 43 Serial_B1007 90 non-null int64 \n", 330 | " 44 Serial_B1008 90 non-null int64 \n", 331 | " 45 Serial_B1010 90 non-null int64 \n", 332 | " 46 Serial_B1011 90 non-null int64 \n", 333 | " 47 Serial_B1012 90 non-null int64 \n", 334 | " 48 Serial_B1013 90 non-null int64 \n", 335 | " 49 Serial_B1015 90 non-null int64 \n", 336 | " 50 Serial_B1016 90 non-null int64 \n", 337 | " 51 Serial_B1017 90 non-null int64 \n", 338 | " 52 Serial_B1018 90 non-null int64 \n", 339 | " 53 Serial_B1019 90 non-null int64 \n", 340 | " 54 Serial_B1020 90 non-null int64 \n", 341 | " 55 Serial_B1021 90 non-null int64 \n", 342 | " 56 Serial_B1022 90 non-null int64 \n", 343 | " 57 Serial_B1023 90 non-null int64 \n", 344 | " 58 Serial_B1025 90 non-null int64 \n", 345 | " 59 Serial_B1026 90 non-null int64 \n", 346 | " 60 Serial_B1028 90 non-null int64 \n", 347 | " 61 Serial_B1029 90 non-null int64 \n", 348 | " 62 Serial_B1030 90 non-null int64 \n", 349 | " 63 Serial_B1031 90 non-null int64 \n", 350 | " 64 Serial_B1032 90 non-null int64 \n", 351 | " 65 Serial_B1034 90 non-null int64 \n", 352 | " 66 Serial_B1035 90 non-null int64 \n", 353 | " 67 Serial_B1036 90 non-null int64 \n", 354 | " 68 Serial_B1037 90 non-null int64 \n", 355 | " 69 Serial_B1038 90 non-null int64 \n", 356 | " 70 Serial_B1039 90 non-null int64 \n", 357 | " 71 Serial_B1040 90 non-null int64 \n", 358 | " 72 Serial_B1041 90 non-null int64 \n", 359 | " 73 Serial_B1042 90 non-null int64 \n", 360 | " 74 Serial_B1043 90 non-null int64 \n", 361 | " 75 Serial_B1044 90 non-null int64 \n", 362 | " 76 Serial_B1045 90 non-null int64 \n", 363 | " 77 Serial_B1046 90 non-null int64 \n", 364 | " 78 Serial_B1047 90 non-null int64 \n", 365 | " 79 Serial_B1048 90 non-null int64 \n", 366 | " 80 Serial_B1049 90 non-null int64 \n", 367 | " 81 Serial_B1050 90 non-null int64 \n", 368 | " 82 Serial_B1051 90 non-null int64 \n", 369 | " 83 Serial_B1054 90 non-null int64 \n", 370 | " 84 Serial_B1056 90 non-null int64 \n", 371 | " 85 Serial_B1058 90 non-null int64 \n", 372 | " 86 Serial_B1059 90 non-null int64 \n", 373 | " 87 Serial_B1060 90 non-null int64 \n", 374 | " 88 Serial_B1062 90 non-null int64 \n", 375 | "dtypes: float64(2), int64(87)\n", 376 | "memory usage: 62.7 KB\n" 377 | ] 378 | } 379 | ], 380 | "source": [ 381 | "df.info()" 382 | ] 383 | }, 384 | { 385 | "cell_type": "markdown", 386 | "metadata": {}, 387 | "source": [ 388 | "# Define X , y" 389 | ] 390 | }, 391 | { 392 | "cell_type": "code", 393 | "execution_count": 5, 394 | "metadata": {}, 395 | "outputs": [], 396 | "source": [ 397 | "X=df.drop('Class',axis=1)\n", 398 | "y=df['Class']" 399 | ] 400 | }, 401 | { 402 | "cell_type": "markdown", 403 | "metadata": {}, 404 | "source": [ 405 | "Great! Our data is ready for our model!\n", 406 | "\n", 407 | "# Building a Decision tree Model\n", 408 | "\n", 409 | "Let's start by splitting our data into a training set and test set\n", 410 | "\n", 411 | "## Train Test Split" 412 | ] 413 | }, 414 | { 415 | "cell_type": "code", 416 | "execution_count": 6, 417 | "metadata": {}, 418 | "outputs": [], 419 | "source": [ 420 | "from sklearn.model_selection import train_test_split" 421 | ] 422 | }, 423 | { 424 | "cell_type": "code", 425 | "execution_count": 7, 426 | "metadata": {}, 427 | "outputs": [], 428 | "source": [ 429 | "X_train, X_test, y_train, y_test = train_test_split(X, \n", 430 | " y, test_size=0.3, \n", 431 | " random_state=101)" 432 | ] 433 | }, 434 | { 435 | "cell_type": "markdown", 436 | "metadata": {}, 437 | "source": [ 438 | "## Training and Predicting" 439 | ] 440 | }, 441 | { 442 | "cell_type": "code", 443 | "execution_count": 8, 444 | "metadata": {}, 445 | "outputs": [], 446 | "source": [ 447 | "# Decision Tree classification algorithm\n", 448 | "from sklearn.tree import DecisionTreeClassifier" 449 | ] 450 | }, 451 | { 452 | "cell_type": "code", 453 | "execution_count": 9, 454 | "metadata": {}, 455 | "outputs": [], 456 | "source": [ 457 | "tree = DecisionTreeClassifier()" 458 | ] 459 | }, 460 | { 461 | "cell_type": "code", 462 | "execution_count": 10, 463 | "metadata": {}, 464 | "outputs": [ 465 | { 466 | "data": { 467 | "text/plain": [ 468 | "DecisionTreeClassifier()" 469 | ] 470 | }, 471 | "execution_count": 10, 472 | "metadata": {}, 473 | "output_type": "execute_result" 474 | } 475 | ], 476 | "source": [ 477 | "tree.fit(X_train,y_train)" 478 | ] 479 | }, 480 | { 481 | "cell_type": "code", 482 | "execution_count": 11, 483 | "metadata": {}, 484 | "outputs": [], 485 | "source": [ 486 | "predictions = tree.predict(X_test)" 487 | ] 488 | }, 489 | { 490 | "cell_type": "code", 491 | "execution_count": 12, 492 | "metadata": { 493 | "scrolled": true 494 | }, 495 | "outputs": [ 496 | { 497 | "data": { 498 | "text/plain": [ 499 | "array([0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1,\n", 500 | " 1, 1, 0, 1, 1], dtype=int64)" 501 | ] 502 | }, 503 | "execution_count": 12, 504 | "metadata": {}, 505 | "output_type": "execute_result" 506 | } 507 | ], 508 | "source": [ 509 | "predictions" 510 | ] 511 | }, 512 | { 513 | "cell_type": "code", 514 | "execution_count": 13, 515 | "metadata": { 516 | "scrolled": true 517 | }, 518 | "outputs": [ 519 | { 520 | "data": { 521 | "text/plain": [ 522 | "50 0\n", 523 | "6 1\n", 524 | "51 0\n", 525 | "54 1\n", 526 | "53 1\n", 527 | "69 1\n", 528 | "32 1\n", 529 | "31 1\n", 530 | "21 1\n", 531 | "88 1\n", 532 | "43 1\n", 533 | "47 0\n", 534 | "3 0\n", 535 | "1 0\n", 536 | "74 0\n", 537 | "16 1\n", 538 | "45 0\n", 539 | "25 1\n", 540 | "2 0\n", 541 | "13 0\n", 542 | "56 1\n", 543 | "76 0\n", 544 | "73 1\n", 545 | "41 1\n", 546 | "14 0\n", 547 | "23 1\n", 548 | "37 1\n", 549 | "Name: Class, dtype: int64" 550 | ] 551 | }, 552 | "execution_count": 13, 553 | "metadata": {}, 554 | "output_type": "execute_result" 555 | } 556 | ], 557 | "source": [ 558 | "y_test" 559 | ] 560 | }, 561 | { 562 | "cell_type": "markdown", 563 | "metadata": {}, 564 | "source": [ 565 | "Let's move on to evaluate our model!" 566 | ] 567 | }, 568 | { 569 | "cell_type": "markdown", 570 | "metadata": {}, 571 | "source": [ 572 | "## Evaluation" 573 | ] 574 | }, 575 | { 576 | "cell_type": "markdown", 577 | "metadata": {}, 578 | "source": [ 579 | "Let's bring Confusion Matrix!" 580 | ] 581 | }, 582 | { 583 | "cell_type": "code", 584 | "execution_count": 14, 585 | "metadata": {}, 586 | "outputs": [], 587 | "source": [ 588 | "from sklearn.metrics import confusion_matrix" 589 | ] 590 | }, 591 | { 592 | "cell_type": "code", 593 | "execution_count": 15, 594 | "metadata": { 595 | "scrolled": true 596 | }, 597 | "outputs": [ 598 | { 599 | "data": { 600 | "text/plain": [ 601 | "array([[ 9, 2],\n", 602 | " [ 1, 15]], dtype=int64)" 603 | ] 604 | }, 605 | "execution_count": 15, 606 | "metadata": {}, 607 | "output_type": "execute_result" 608 | } 609 | ], 610 | "source": [ 611 | "confusion_matrix(y_test,predictions)" 612 | ] 613 | }, 614 | { 615 | "cell_type": "markdown", 616 | "metadata": {}, 617 | "source": [ 618 | "We can check precision,recall,f1-score using classification report!" 619 | ] 620 | }, 621 | { 622 | "cell_type": "code", 623 | "execution_count": 16, 624 | "metadata": {}, 625 | "outputs": [], 626 | "source": [ 627 | "from sklearn.metrics import accuracy_score" 628 | ] 629 | }, 630 | { 631 | "cell_type": "code", 632 | "execution_count": 17, 633 | "metadata": {}, 634 | "outputs": [ 635 | { 636 | "data": { 637 | "text/plain": [ 638 | "24" 639 | ] 640 | }, 641 | "execution_count": 17, 642 | "metadata": {}, 643 | "output_type": "execute_result" 644 | } 645 | ], 646 | "source": [ 647 | "accuracy_score(y_test,predictions, normalize=False)" 648 | ] 649 | }, 650 | { 651 | "cell_type": "code", 652 | "execution_count": 18, 653 | "metadata": {}, 654 | "outputs": [ 655 | { 656 | "data": { 657 | "text/plain": [ 658 | "0.8888888888888888" 659 | ] 660 | }, 661 | "execution_count": 18, 662 | "metadata": {}, 663 | "output_type": "execute_result" 664 | } 665 | ], 666 | "source": [ 667 | "accuracy_score(y_test,predictions, normalize=True)" 668 | ] 669 | }, 670 | { 671 | "cell_type": "code", 672 | "execution_count": 19, 673 | "metadata": {}, 674 | "outputs": [], 675 | "source": [ 676 | "from sklearn.metrics import classification_report" 677 | ] 678 | }, 679 | { 680 | "cell_type": "code", 681 | "execution_count": 20, 682 | "metadata": {}, 683 | "outputs": [ 684 | { 685 | "name": "stdout", 686 | "output_type": "stream", 687 | "text": [ 688 | " precision recall f1-score support\n", 689 | "\n", 690 | " 0 0.90 0.82 0.86 11\n", 691 | " 1 0.88 0.94 0.91 16\n", 692 | "\n", 693 | " accuracy 0.89 27\n", 694 | " macro avg 0.89 0.88 0.88 27\n", 695 | "weighted avg 0.89 0.89 0.89 27\n", 696 | "\n" 697 | ] 698 | } 699 | ], 700 | "source": [ 701 | "print(classification_report(y_test,predictions))" 702 | ] 703 | }, 704 | { 705 | "cell_type": "markdown", 706 | "metadata": {}, 707 | "source": [ 708 | "\n", 709 | "## Grid Search for Decision Tree!" 710 | ] 711 | }, 712 | { 713 | "cell_type": "code", 714 | "execution_count": 21, 715 | "metadata": {}, 716 | "outputs": [], 717 | "source": [ 718 | "# Allows us to test parameters of classification algorithms and find the best one\n", 719 | "from sklearn.model_selection import GridSearchCV" 720 | ] 721 | }, 722 | { 723 | "cell_type": "code", 724 | "execution_count": 22, 725 | "metadata": {}, 726 | "outputs": [], 727 | "source": [ 728 | "tree_1 = DecisionTreeClassifier()" 729 | ] 730 | }, 731 | { 732 | "cell_type": "code", 733 | "execution_count": 23, 734 | "metadata": {}, 735 | "outputs": [], 736 | "source": [ 737 | "parameters = {'min_samples_leaf': [1, 2, 4],\n", 738 | " 'min_samples_split': [2, 5]}" 739 | ] 740 | }, 741 | { 742 | "cell_type": "code", 743 | "execution_count": 24, 744 | "metadata": {}, 745 | "outputs": [ 746 | { 747 | "data": { 748 | "text/plain": [ 749 | "GridSearchCV(estimator=DecisionTreeClassifier(),\n", 750 | " param_grid={'min_samples_leaf': [1, 2, 4],\n", 751 | " 'min_samples_split': [2, 5]})" 752 | ] 753 | }, 754 | "execution_count": 24, 755 | "metadata": {}, 756 | "output_type": "execute_result" 757 | } 758 | ], 759 | "source": [ 760 | "tree_cv = GridSearchCV(tree_1, parameters)\n", 761 | "tree_cv.fit(X_train, y_train)" 762 | ] 763 | }, 764 | { 765 | "cell_type": "code", 766 | "execution_count": 25, 767 | "metadata": {}, 768 | "outputs": [ 769 | { 770 | "name": "stdout", 771 | "output_type": "stream", 772 | "text": [ 773 | "tuned hpyerparameters :(best parameters) {'min_samples_leaf': 1, 'min_samples_split': 5}\n" 774 | ] 775 | } 776 | ], 777 | "source": [ 778 | "print(\"tuned hpyerparameters :(best parameters) \",tree_cv.best_params_)" 779 | ] 780 | }, 781 | { 782 | "cell_type": "code", 783 | "execution_count": 26, 784 | "metadata": {}, 785 | "outputs": [], 786 | "source": [ 787 | "tree_1 = DecisionTreeClassifier(min_samples_leaf= 1, min_samples_split= 5)" 788 | ] 789 | }, 790 | { 791 | "cell_type": "code", 792 | "execution_count": 27, 793 | "metadata": {}, 794 | "outputs": [ 795 | { 796 | "data": { 797 | "text/plain": [ 798 | "DecisionTreeClassifier(min_samples_split=5)" 799 | ] 800 | }, 801 | "execution_count": 27, 802 | "metadata": {}, 803 | "output_type": "execute_result" 804 | } 805 | ], 806 | "source": [ 807 | "tree_1.fit(X_train,y_train)" 808 | ] 809 | }, 810 | { 811 | "cell_type": "code", 812 | "execution_count": 28, 813 | "metadata": {}, 814 | "outputs": [], 815 | "source": [ 816 | "predictions_1 = tree_1.predict(X_test)" 817 | ] 818 | }, 819 | { 820 | "cell_type": "code", 821 | "execution_count": 29, 822 | "metadata": {}, 823 | "outputs": [ 824 | { 825 | "data": { 826 | "text/plain": [ 827 | "array([[ 9, 2],\n", 828 | " [ 1, 15]], dtype=int64)" 829 | ] 830 | }, 831 | "execution_count": 29, 832 | "metadata": {}, 833 | "output_type": "execute_result" 834 | } 835 | ], 836 | "source": [ 837 | "confusion_matrix(y_test,predictions_1)" 838 | ] 839 | }, 840 | { 841 | "cell_type": "code", 842 | "execution_count": 30, 843 | "metadata": {}, 844 | "outputs": [ 845 | { 846 | "data": { 847 | "text/plain": [ 848 | "24" 849 | ] 850 | }, 851 | "execution_count": 30, 852 | "metadata": {}, 853 | "output_type": "execute_result" 854 | } 855 | ], 856 | "source": [ 857 | "accuracy_score(y_test,predictions_1, normalize=False)" 858 | ] 859 | }, 860 | { 861 | "cell_type": "code", 862 | "execution_count": 31, 863 | "metadata": {}, 864 | "outputs": [ 865 | { 866 | "data": { 867 | "text/plain": [ 868 | "0.8888888888888888" 869 | ] 870 | }, 871 | "execution_count": 31, 872 | "metadata": {}, 873 | "output_type": "execute_result" 874 | } 875 | ], 876 | "source": [ 877 | "accuracy_score(y_test,predictions_1, normalize=True)" 878 | ] 879 | }, 880 | { 881 | "cell_type": "markdown", 882 | "metadata": {}, 883 | "source": [ 884 | "# Building a Random Forest Model" 885 | ] 886 | }, 887 | { 888 | "cell_type": "code", 889 | "execution_count": 32, 890 | "metadata": {}, 891 | "outputs": [ 892 | { 893 | "data": { 894 | "text/plain": [ 895 | "RandomForestClassifier()" 896 | ] 897 | }, 898 | "execution_count": 32, 899 | "metadata": {}, 900 | "output_type": "execute_result" 901 | } 902 | ], 903 | "source": [ 904 | "from sklearn.ensemble import RandomForestClassifier\n", 905 | "rfc = RandomForestClassifier()\n", 906 | "rfc.fit(X_train, y_train)" 907 | ] 908 | }, 909 | { 910 | "cell_type": "code", 911 | "execution_count": 33, 912 | "metadata": {}, 913 | "outputs": [], 914 | "source": [ 915 | "rfc_pred = rfc.predict(X_test)" 916 | ] 917 | }, 918 | { 919 | "cell_type": "code", 920 | "execution_count": 34, 921 | "metadata": {}, 922 | "outputs": [ 923 | { 924 | "name": "stdout", 925 | "output_type": "stream", 926 | "text": [ 927 | "[[ 8 3]\n", 928 | " [ 0 16]]\n" 929 | ] 930 | } 931 | ], 932 | "source": [ 933 | "print(confusion_matrix(y_test,rfc_pred))" 934 | ] 935 | }, 936 | { 937 | "cell_type": "code", 938 | "execution_count": 35, 939 | "metadata": {}, 940 | "outputs": [ 941 | { 942 | "data": { 943 | "text/plain": [ 944 | "24" 945 | ] 946 | }, 947 | "execution_count": 35, 948 | "metadata": {}, 949 | "output_type": "execute_result" 950 | } 951 | ], 952 | "source": [ 953 | "accuracy_score(y_test,predictions, normalize=False)" 954 | ] 955 | }, 956 | { 957 | "cell_type": "code", 958 | "execution_count": 36, 959 | "metadata": {}, 960 | "outputs": [ 961 | { 962 | "data": { 963 | "text/plain": [ 964 | "0.8888888888888888" 965 | ] 966 | }, 967 | "execution_count": 36, 968 | "metadata": {}, 969 | "output_type": "execute_result" 970 | } 971 | ], 972 | "source": [ 973 | "accuracy_score(y_test,predictions, normalize=True)" 974 | ] 975 | }, 976 | { 977 | "cell_type": "code", 978 | "execution_count": 37, 979 | "metadata": {}, 980 | "outputs": [ 981 | { 982 | "name": "stdout", 983 | "output_type": "stream", 984 | "text": [ 985 | " precision recall f1-score support\n", 986 | "\n", 987 | " 0 1.00 0.73 0.84 11\n", 988 | " 1 0.84 1.00 0.91 16\n", 989 | "\n", 990 | " accuracy 0.89 27\n", 991 | " macro avg 0.92 0.86 0.88 27\n", 992 | "weighted avg 0.91 0.89 0.88 27\n", 993 | "\n" 994 | ] 995 | } 996 | ], 997 | "source": [ 998 | "print(classification_report(y_test,rfc_pred))" 999 | ] 1000 | }, 1001 | { 1002 | "cell_type": "markdown", 1003 | "metadata": {}, 1004 | "source": [ 1005 | "## Grid Search for Random Forest!" 1006 | ] 1007 | }, 1008 | { 1009 | "cell_type": "code", 1010 | "execution_count": 38, 1011 | "metadata": {}, 1012 | "outputs": [], 1013 | "source": [ 1014 | "rfc_1 = RandomForestClassifier()" 1015 | ] 1016 | }, 1017 | { 1018 | "cell_type": "code", 1019 | "execution_count": 39, 1020 | "metadata": { 1021 | "scrolled": true 1022 | }, 1023 | "outputs": [], 1024 | "source": [ 1025 | "parameters = {'min_samples_leaf': [1, 2, 4],\n", 1026 | " 'min_samples_split': [2, 5, 10], 'n_estimators': [10,20,30] }" 1027 | ] 1028 | }, 1029 | { 1030 | "cell_type": "code", 1031 | "execution_count": 40, 1032 | "metadata": {}, 1033 | "outputs": [ 1034 | { 1035 | "data": { 1036 | "text/plain": [ 1037 | "GridSearchCV(estimator=RandomForestClassifier(),\n", 1038 | " param_grid={'min_samples_leaf': [1, 2, 4],\n", 1039 | " 'min_samples_split': [2, 5, 10],\n", 1040 | " 'n_estimators': [10, 20, 30]})" 1041 | ] 1042 | }, 1043 | "execution_count": 40, 1044 | "metadata": {}, 1045 | "output_type": "execute_result" 1046 | } 1047 | ], 1048 | "source": [ 1049 | "rfc_cv = GridSearchCV(rfc_1, parameters)\n", 1050 | "rfc_cv.fit(X_train, y_train)" 1051 | ] 1052 | }, 1053 | { 1054 | "cell_type": "code", 1055 | "execution_count": 41, 1056 | "metadata": {}, 1057 | "outputs": [ 1058 | { 1059 | "name": "stdout", 1060 | "output_type": "stream", 1061 | "text": [ 1062 | "tuned hpyerparameters :(best parameters) {'min_samples_leaf': 1, 'min_samples_split': 5, 'n_estimators': 10}\n" 1063 | ] 1064 | } 1065 | ], 1066 | "source": [ 1067 | "print(\"tuned hpyerparameters :(best parameters) \",rfc_cv.best_params_)" 1068 | ] 1069 | }, 1070 | { 1071 | "cell_type": "code", 1072 | "execution_count": 42, 1073 | "metadata": {}, 1074 | "outputs": [], 1075 | "source": [ 1076 | "rfc_1 = RandomForestClassifier( n_estimators= 10, min_samples_leaf= 1, min_samples_split= 2)" 1077 | ] 1078 | }, 1079 | { 1080 | "cell_type": "code", 1081 | "execution_count": 43, 1082 | "metadata": {}, 1083 | "outputs": [ 1084 | { 1085 | "data": { 1086 | "text/plain": [ 1087 | "RandomForestClassifier(n_estimators=10)" 1088 | ] 1089 | }, 1090 | "execution_count": 43, 1091 | "metadata": {}, 1092 | "output_type": "execute_result" 1093 | } 1094 | ], 1095 | "source": [ 1096 | "rfc_1.fit(X_train,y_train)" 1097 | ] 1098 | }, 1099 | { 1100 | "cell_type": "code", 1101 | "execution_count": 44, 1102 | "metadata": {}, 1103 | "outputs": [], 1104 | "source": [ 1105 | "predictions_1 = rfc_1.predict(X_test)" 1106 | ] 1107 | }, 1108 | { 1109 | "cell_type": "code", 1110 | "execution_count": 45, 1111 | "metadata": {}, 1112 | "outputs": [ 1113 | { 1114 | "data": { 1115 | "text/plain": [ 1116 | "array([[11, 0],\n", 1117 | " [ 1, 15]], dtype=int64)" 1118 | ] 1119 | }, 1120 | "execution_count": 45, 1121 | "metadata": {}, 1122 | "output_type": "execute_result" 1123 | } 1124 | ], 1125 | "source": [ 1126 | "confusion_matrix(y_test,predictions_1)" 1127 | ] 1128 | }, 1129 | { 1130 | "cell_type": "code", 1131 | "execution_count": 46, 1132 | "metadata": {}, 1133 | "outputs": [ 1134 | { 1135 | "data": { 1136 | "text/plain": [ 1137 | "26" 1138 | ] 1139 | }, 1140 | "execution_count": 46, 1141 | "metadata": {}, 1142 | "output_type": "execute_result" 1143 | } 1144 | ], 1145 | "source": [ 1146 | "accuracy_score(y_test,predictions_1, normalize=False)" 1147 | ] 1148 | }, 1149 | { 1150 | "cell_type": "code", 1151 | "execution_count": 47, 1152 | "metadata": {}, 1153 | "outputs": [ 1154 | { 1155 | "data": { 1156 | "text/plain": [ 1157 | "0.9629629629629629" 1158 | ] 1159 | }, 1160 | "execution_count": 47, 1161 | "metadata": {}, 1162 | "output_type": "execute_result" 1163 | } 1164 | ], 1165 | "source": [ 1166 | "accuracy_score(y_test,predictions_1, normalize=True)" 1167 | ] 1168 | }, 1169 | { 1170 | "cell_type": "markdown", 1171 | "metadata": {}, 1172 | "source": [ 1173 | "# Good Job!" 1174 | ] 1175 | } 1176 | ], 1177 | "metadata": { 1178 | "kernelspec": { 1179 | "display_name": "Python 3 (ipykernel)", 1180 | "language": "python", 1181 | "name": "python3" 1182 | }, 1183 | "language_info": { 1184 | "codemirror_mode": { 1185 | "name": "ipython", 1186 | "version": 3 1187 | }, 1188 | "file_extension": ".py", 1189 | "mimetype": "text/x-python", 1190 | "name": "python", 1191 | "nbconvert_exporter": "python", 1192 | "pygments_lexer": "ipython3", 1193 | "version": "3.8.3" 1194 | } 1195 | }, 1196 | "nbformat": 4, 1197 | "nbformat_minor": 1 1198 | } 1199 | -------------------------------------------------------------------------------- /week6-notebook1-Logistic-Regression-monogram2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Monogram2-week6-notebook1\n", 8 | "\n", 9 | "# Logistic Regression with Python\n", 10 | "\n", 11 | "\n", 12 | "## Import Libraries\n", 13 | "Let's import some libraries to get started!" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 14, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "import pandas as pd" 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "## The Data\n", 30 | "\n" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 15, 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "df = pd.read_csv('preprocessed_dataset.csv')" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 16, 45 | "metadata": {}, 46 | "outputs": [ 47 | { 48 | "data": { 49 | "text/html": [ 50 | "
\n", 51 | "\n", 64 | "\n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | "
Unnamed: 0PayloadMassFlightsGridFinsReusedLegsBlockReusedCountClassOrbit_ES-L1...Serial_B1048Serial_B1049Serial_B1050Serial_B1051Serial_B1054Serial_B1056Serial_B1058Serial_B1059Serial_B1060Serial_B1062
006104.95941210001.0000...0000000000
11525.00000010001.0000...0000000000
22677.00000010001.0000...0000000000
33500.00000010001.0000...0000000000
443170.00000010001.0000...0000000000
\n", 214 | "

5 rows × 89 columns

\n", 215 | "
" 216 | ], 217 | "text/plain": [ 218 | " Unnamed: 0 PayloadMass Flights GridFins Reused Legs Block \\\n", 219 | "0 0 6104.959412 1 0 0 0 1.0 \n", 220 | "1 1 525.000000 1 0 0 0 1.0 \n", 221 | "2 2 677.000000 1 0 0 0 1.0 \n", 222 | "3 3 500.000000 1 0 0 0 1.0 \n", 223 | "4 4 3170.000000 1 0 0 0 1.0 \n", 224 | "\n", 225 | " ReusedCount Class Orbit_ES-L1 ... Serial_B1048 Serial_B1049 \\\n", 226 | "0 0 0 0 ... 0 0 \n", 227 | "1 0 0 0 ... 0 0 \n", 228 | "2 0 0 0 ... 0 0 \n", 229 | "3 0 0 0 ... 0 0 \n", 230 | "4 0 0 0 ... 0 0 \n", 231 | "\n", 232 | " Serial_B1050 Serial_B1051 Serial_B1054 Serial_B1056 Serial_B1058 \\\n", 233 | "0 0 0 0 0 0 \n", 234 | "1 0 0 0 0 0 \n", 235 | "2 0 0 0 0 0 \n", 236 | "3 0 0 0 0 0 \n", 237 | "4 0 0 0 0 0 \n", 238 | "\n", 239 | " Serial_B1059 Serial_B1060 Serial_B1062 \n", 240 | "0 0 0 0 \n", 241 | "1 0 0 0 \n", 242 | "2 0 0 0 \n", 243 | "3 0 0 0 \n", 244 | "4 0 0 0 \n", 245 | "\n", 246 | "[5 rows x 89 columns]" 247 | ] 248 | }, 249 | "execution_count": 16, 250 | "metadata": {}, 251 | "output_type": "execute_result" 252 | } 253 | ], 254 | "source": [ 255 | "df.head()" 256 | ] 257 | }, 258 | { 259 | "cell_type": "code", 260 | "execution_count": 17, 261 | "metadata": {}, 262 | "outputs": [], 263 | "source": [ 264 | "def cost(a):\n", 265 | " if a>10000:\n", 266 | " return 1\n", 267 | " else:\n", 268 | " return 0\n", 269 | " " 270 | ] 271 | }, 272 | { 273 | "cell_type": "code", 274 | "execution_count": 18, 275 | "metadata": {}, 276 | "outputs": [], 277 | "source": [ 278 | "df['new']=df['PayloadMass'].apply(cost)" 279 | ] 280 | }, 281 | { 282 | "cell_type": "code", 283 | "execution_count": 19, 284 | "metadata": {}, 285 | "outputs": [ 286 | { 287 | "data": { 288 | "text/plain": [ 289 | "0 0\n", 290 | "1 0\n", 291 | "2 0\n", 292 | "3 0\n", 293 | "4 0\n", 294 | " ..\n", 295 | "85 1\n", 296 | "86 1\n", 297 | "87 1\n", 298 | "88 1\n", 299 | "89 0\n", 300 | "Name: new, Length: 90, dtype: int64" 301 | ] 302 | }, 303 | "execution_count": 19, 304 | "metadata": {}, 305 | "output_type": "execute_result" 306 | } 307 | ], 308 | "source": [ 309 | "df['new']" 310 | ] 311 | }, 312 | { 313 | "cell_type": "markdown", 314 | "metadata": {}, 315 | "source": [ 316 | "# Exploratory Data Analysis\n", 317 | "\n", 318 | "Let's begin some exploratory data analysis! We'll start by checking out missing data!\n", 319 | "\n", 320 | "## Missing Data\n", 321 | "\n" 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": 21, 327 | "metadata": { 328 | "scrolled": true 329 | }, 330 | "outputs": [ 331 | { 332 | "name": "stdout", 333 | "output_type": "stream", 334 | "text": [ 335 | "\n", 336 | "RangeIndex: 90 entries, 0 to 89\n", 337 | "Data columns (total 90 columns):\n", 338 | " # Column Non-Null Count Dtype \n", 339 | "--- ------ -------------- ----- \n", 340 | " 0 Unnamed: 0 90 non-null int64 \n", 341 | " 1 PayloadMass 90 non-null float64\n", 342 | " 2 Flights 90 non-null int64 \n", 343 | " 3 GridFins 90 non-null int64 \n", 344 | " 4 Reused 90 non-null int64 \n", 345 | " 5 Legs 90 non-null int64 \n", 346 | " 6 Block 90 non-null float64\n", 347 | " 7 ReusedCount 90 non-null int64 \n", 348 | " 8 Class 90 non-null int64 \n", 349 | " 9 Orbit_ES-L1 90 non-null int64 \n", 350 | " 10 Orbit_GEO 90 non-null int64 \n", 351 | " 11 Orbit_GTO 90 non-null int64 \n", 352 | " 12 Orbit_HEO 90 non-null int64 \n", 353 | " 13 Orbit_ISS 90 non-null int64 \n", 354 | " 14 Orbit_LEO 90 non-null int64 \n", 355 | " 15 Orbit_MEO 90 non-null int64 \n", 356 | " 16 Orbit_PO 90 non-null int64 \n", 357 | " 17 Orbit_SO 90 non-null int64 \n", 358 | " 18 Orbit_SSO 90 non-null int64 \n", 359 | " 19 Orbit_VLEO 90 non-null int64 \n", 360 | " 20 LaunchSite_CCAFS SLC 40 90 non-null int64 \n", 361 | " 21 LaunchSite_KSC LC 39A 90 non-null int64 \n", 362 | " 22 LaunchSite_VAFB SLC 4E 90 non-null int64 \n", 363 | " 23 Outcome_False ASDS 90 non-null int64 \n", 364 | " 24 Outcome_False Ocean 90 non-null int64 \n", 365 | " 25 Outcome_False RTLS 90 non-null int64 \n", 366 | " 26 Outcome_None ASDS 90 non-null int64 \n", 367 | " 27 Outcome_None None 90 non-null int64 \n", 368 | " 28 Outcome_True ASDS 90 non-null int64 \n", 369 | " 29 Outcome_True Ocean 90 non-null int64 \n", 370 | " 30 Outcome_True RTLS 90 non-null int64 \n", 371 | " 31 LandingPad_5e9e3032383ecb267a34e7c7 90 non-null int64 \n", 372 | " 32 LandingPad_5e9e3032383ecb554034e7c9 90 non-null int64 \n", 373 | " 33 LandingPad_5e9e3032383ecb6bb234e7ca 90 non-null int64 \n", 374 | " 34 LandingPad_5e9e3032383ecb761634e7cb 90 non-null int64 \n", 375 | " 35 LandingPad_5e9e3033383ecbb9e534e7cc 90 non-null int64 \n", 376 | " 36 Serial_B0003 90 non-null int64 \n", 377 | " 37 Serial_B0005 90 non-null int64 \n", 378 | " 38 Serial_B0007 90 non-null int64 \n", 379 | " 39 Serial_B1003 90 non-null int64 \n", 380 | " 40 Serial_B1004 90 non-null int64 \n", 381 | " 41 Serial_B1005 90 non-null int64 \n", 382 | " 42 Serial_B1006 90 non-null int64 \n", 383 | " 43 Serial_B1007 90 non-null int64 \n", 384 | " 44 Serial_B1008 90 non-null int64 \n", 385 | " 45 Serial_B1010 90 non-null int64 \n", 386 | " 46 Serial_B1011 90 non-null int64 \n", 387 | " 47 Serial_B1012 90 non-null int64 \n", 388 | " 48 Serial_B1013 90 non-null int64 \n", 389 | " 49 Serial_B1015 90 non-null int64 \n", 390 | " 50 Serial_B1016 90 non-null int64 \n", 391 | " 51 Serial_B1017 90 non-null int64 \n", 392 | " 52 Serial_B1018 90 non-null int64 \n", 393 | " 53 Serial_B1019 90 non-null int64 \n", 394 | " 54 Serial_B1020 90 non-null int64 \n", 395 | " 55 Serial_B1021 90 non-null int64 \n", 396 | " 56 Serial_B1022 90 non-null int64 \n", 397 | " 57 Serial_B1023 90 non-null int64 \n", 398 | " 58 Serial_B1025 90 non-null int64 \n", 399 | " 59 Serial_B1026 90 non-null int64 \n", 400 | " 60 Serial_B1028 90 non-null int64 \n", 401 | " 61 Serial_B1029 90 non-null int64 \n", 402 | " 62 Serial_B1030 90 non-null int64 \n", 403 | " 63 Serial_B1031 90 non-null int64 \n", 404 | " 64 Serial_B1032 90 non-null int64 \n", 405 | " 65 Serial_B1034 90 non-null int64 \n", 406 | " 66 Serial_B1035 90 non-null int64 \n", 407 | " 67 Serial_B1036 90 non-null int64 \n", 408 | " 68 Serial_B1037 90 non-null int64 \n", 409 | " 69 Serial_B1038 90 non-null int64 \n", 410 | " 70 Serial_B1039 90 non-null int64 \n", 411 | " 71 Serial_B1040 90 non-null int64 \n", 412 | " 72 Serial_B1041 90 non-null int64 \n", 413 | " 73 Serial_B1042 90 non-null int64 \n", 414 | " 74 Serial_B1043 90 non-null int64 \n", 415 | " 75 Serial_B1044 90 non-null int64 \n", 416 | " 76 Serial_B1045 90 non-null int64 \n", 417 | " 77 Serial_B1046 90 non-null int64 \n", 418 | " 78 Serial_B1047 90 non-null int64 \n", 419 | " 79 Serial_B1048 90 non-null int64 \n", 420 | " 80 Serial_B1049 90 non-null int64 \n", 421 | " 81 Serial_B1050 90 non-null int64 \n", 422 | " 82 Serial_B1051 90 non-null int64 \n", 423 | " 83 Serial_B1054 90 non-null int64 \n", 424 | " 84 Serial_B1056 90 non-null int64 \n", 425 | " 85 Serial_B1058 90 non-null int64 \n", 426 | " 86 Serial_B1059 90 non-null int64 \n", 427 | " 87 Serial_B1060 90 non-null int64 \n", 428 | " 88 Serial_B1062 90 non-null int64 \n", 429 | " 89 new 90 non-null int64 \n", 430 | "dtypes: float64(2), int64(88)\n", 431 | "memory usage: 63.4 KB\n" 432 | ] 433 | } 434 | ], 435 | "source": [ 436 | "df.info()" 437 | ] 438 | }, 439 | { 440 | "cell_type": "code", 441 | "execution_count": 23, 442 | "metadata": {}, 443 | "outputs": [ 444 | { 445 | "data": { 446 | "text/html": [ 447 | "
\n", 448 | "\n", 461 | "\n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | " \n", 589 | " \n", 590 | " \n", 591 | " \n", 592 | " \n", 593 | " \n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | " \n", 619 | " \n", 620 | " \n", 621 | " \n", 622 | " \n", 623 | " \n", 624 | " \n", 625 | " \n", 626 | " \n", 627 | " \n", 628 | " \n", 629 | " \n", 630 | " \n", 631 | " \n", 632 | " \n", 633 | " \n", 634 | " \n", 635 | " \n", 636 | " \n", 637 | " \n", 638 | " \n", 639 | " \n", 640 | " \n", 641 | " \n", 642 | " \n", 643 | " \n", 644 | " \n", 645 | " \n", 646 | " \n", 647 | " \n", 648 | " \n", 649 | " \n", 650 | " \n", 651 | " \n", 652 | " \n", 653 | " \n", 654 | " \n", 655 | " \n", 656 | " \n", 657 | " \n", 658 | " \n", 659 | " \n", 660 | " \n", 661 | " \n", 662 | " \n", 663 | " \n", 664 | " \n", 665 | " \n", 666 | " \n", 667 | " \n", 668 | " \n", 669 | " \n", 670 | " \n", 671 | " \n", 672 | " \n", 673 | " \n", 674 | " \n", 675 | " \n", 676 | " \n", 677 | " \n", 678 | " \n", 679 | " \n", 680 | " \n", 681 | " \n", 682 | " \n", 683 | " \n", 684 | " \n", 685 | " \n", 686 | " \n", 687 | " \n", 688 | " \n", 689 | " \n", 690 | " \n", 691 | " \n", 692 | " \n", 693 | " \n", 694 | " \n", 695 | " \n", 696 | " \n", 697 | " \n", 698 | " \n", 699 | " \n", 700 | " \n", 701 | " \n", 702 | " \n", 703 | " \n", 704 | " \n", 705 | " \n", 706 | " \n", 707 | " \n", 708 | " \n", 709 | " \n", 710 | " \n", 711 | " \n", 712 | " \n", 713 | " \n", 714 | " \n", 715 | " \n", 716 | " \n", 717 | " \n", 718 | " \n", 719 | " \n", 720 | " \n", 721 | " \n", 722 | " \n", 723 | " \n", 724 | " \n", 725 | " \n", 726 | " \n", 727 | " \n", 728 | " \n", 729 | " \n", 730 | " \n", 731 | " \n", 732 | " \n", 733 | " \n", 734 | " \n", 735 | " \n", 736 | " \n", 737 | " \n", 738 | " \n", 739 | " \n", 740 | " \n", 741 | " \n", 742 | " \n", 743 | " \n", 744 | " \n", 745 | " \n", 746 | " \n", 747 | " \n", 748 | " \n", 749 | " \n", 750 | " \n", 751 | " \n", 752 | " \n", 753 | " \n", 754 | "
Unnamed: 0PayloadMassFlightsGridFinsReusedLegsBlockReusedCountClassOrbit_ES-L1...Serial_B1049Serial_B1050Serial_B1051Serial_B1054Serial_B1056Serial_B1058Serial_B1059Serial_B1060Serial_B1062new
0FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
1FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
2FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
3FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
4FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
..................................................................
85FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
86FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
87FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
88FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
89FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse...FalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
\n", 755 | "

90 rows × 90 columns

\n", 756 | "
" 757 | ], 758 | "text/plain": [ 759 | " Unnamed: 0 PayloadMass Flights GridFins Reused Legs Block \\\n", 760 | "0 False False False False False False False \n", 761 | "1 False False False False False False False \n", 762 | "2 False False False False False False False \n", 763 | "3 False False False False False False False \n", 764 | "4 False False False False False False False \n", 765 | ".. ... ... ... ... ... ... ... \n", 766 | "85 False False False False False False False \n", 767 | "86 False False False False False False False \n", 768 | "87 False False False False False False False \n", 769 | "88 False False False False False False False \n", 770 | "89 False False False False False False False \n", 771 | "\n", 772 | " ReusedCount Class Orbit_ES-L1 ... Serial_B1049 Serial_B1050 \\\n", 773 | "0 False False False ... False False \n", 774 | "1 False False False ... False False \n", 775 | "2 False False False ... False False \n", 776 | "3 False False False ... False False \n", 777 | "4 False False False ... False False \n", 778 | ".. ... ... ... ... ... ... \n", 779 | "85 False False False ... False False \n", 780 | "86 False False False ... False False \n", 781 | "87 False False False ... False False \n", 782 | "88 False False False ... False False \n", 783 | "89 False False False ... False False \n", 784 | "\n", 785 | " Serial_B1051 Serial_B1054 Serial_B1056 Serial_B1058 Serial_B1059 \\\n", 786 | "0 False False False False False \n", 787 | "1 False False False False False \n", 788 | "2 False False False False False \n", 789 | "3 False False False False False \n", 790 | "4 False False False False False \n", 791 | ".. ... ... ... ... ... \n", 792 | "85 False False False False False \n", 793 | "86 False False False False False \n", 794 | "87 False False False False False \n", 795 | "88 False False False False False \n", 796 | "89 False False False False False \n", 797 | "\n", 798 | " Serial_B1060 Serial_B1062 new \n", 799 | "0 False False False \n", 800 | "1 False False False \n", 801 | "2 False False False \n", 802 | "3 False False False \n", 803 | "4 False False False \n", 804 | ".. ... ... ... \n", 805 | "85 False False False \n", 806 | "86 False False False \n", 807 | "87 False False False \n", 808 | "88 False False False \n", 809 | "89 False False False \n", 810 | "\n", 811 | "[90 rows x 90 columns]" 812 | ] 813 | }, 814 | "execution_count": 23, 815 | "metadata": {}, 816 | "output_type": "execute_result" 817 | } 818 | ], 819 | "source": [ 820 | "df.isnull()" 821 | ] 822 | }, 823 | { 824 | "cell_type": "code", 825 | "execution_count": 25, 826 | "metadata": { 827 | "scrolled": true 828 | }, 829 | "outputs": [ 830 | { 831 | "data": { 832 | "text/plain": [ 833 | "Unnamed: 0 0\n", 834 | "PayloadMass 0\n", 835 | "Flights 0\n", 836 | "GridFins 0\n", 837 | "Reused 0\n", 838 | " ..\n", 839 | "Serial_B1058 0\n", 840 | "Serial_B1059 0\n", 841 | "Serial_B1060 0\n", 842 | "Serial_B1062 0\n", 843 | "new 0\n", 844 | "Length: 90, dtype: int64" 845 | ] 846 | }, 847 | "execution_count": 25, 848 | "metadata": {}, 849 | "output_type": "execute_result" 850 | } 851 | ], 852 | "source": [ 853 | "df.isnull().sum()" 854 | ] 855 | }, 856 | { 857 | "cell_type": "markdown", 858 | "metadata": {}, 859 | "source": [ 860 | "# Define X , y" 861 | ] 862 | }, 863 | { 864 | "cell_type": "code", 865 | "execution_count": 26, 866 | "metadata": {}, 867 | "outputs": [], 868 | "source": [ 869 | "X=df.drop('Class',axis=1)\n", 870 | "y=df['Class']" 871 | ] 872 | }, 873 | { 874 | "cell_type": "markdown", 875 | "metadata": {}, 876 | "source": [ 877 | "Great! Our data is ready for our model!\n", 878 | "\n", 879 | "# Building a Logistic Regression model\n", 880 | "\n", 881 | "Let's start by splitting our data into a training set and test set.\n", 882 | "## Train Test Split" 883 | ] 884 | }, 885 | { 886 | "cell_type": "code", 887 | "execution_count": 27, 888 | "metadata": {}, 889 | "outputs": [ 890 | { 891 | "name": "stdout", 892 | "output_type": "stream", 893 | "text": [ 894 | "Defaulting to user installation because normal site-packages is not writeable\n", 895 | "Requirement already satisfied: sklearn in c:\\users\\monah\\appdata\\roaming\\python\\python38\\site-packages (0.0)\n", 896 | "Requirement already satisfied: scikit-learn in c:\\users\\monah\\appdata\\roaming\\python\\python38\\site-packages (from sklearn) (1.0.1)\n", 897 | "Requirement already satisfied: joblib>=0.11 in c:\\users\\monah\\appdata\\roaming\\python\\python38\\site-packages (from scikit-learn->sklearn) (1.1.0)\n", 898 | "Requirement already satisfied: numpy>=1.14.6 in c:\\program files\\python38\\lib\\site-packages (from scikit-learn->sklearn) (1.20.0)\n", 899 | "Requirement already satisfied: scipy>=1.1.0 in c:\\program files\\python38\\lib\\site-packages (from scikit-learn->sklearn) (1.6.0)\n", 900 | "Requirement already satisfied: threadpoolctl>=2.0.0 in c:\\users\\monah\\appdata\\roaming\\python\\python38\\site-packages (from scikit-learn->sklearn) (3.0.0)\n" 901 | ] 902 | }, 903 | { 904 | "name": "stderr", 905 | "output_type": "stream", 906 | "text": [ 907 | "WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.\n", 908 | "You should consider upgrading via the 'c:\\program files\\python38\\python.exe -m pip install --upgrade pip' command.\n" 909 | ] 910 | } 911 | ], 912 | "source": [ 913 | "! pip install sklearn" 914 | ] 915 | }, 916 | { 917 | "cell_type": "code", 918 | "execution_count": 28, 919 | "metadata": {}, 920 | "outputs": [], 921 | "source": [ 922 | "from sklearn.model_selection import train_test_split" 923 | ] 924 | }, 925 | { 926 | "cell_type": "code", 927 | "execution_count": 29, 928 | "metadata": {}, 929 | "outputs": [], 930 | "source": [ 931 | "X_train, X_test, y_train, y_test = train_test_split(X, \n", 932 | " y, test_size=0.20, \n", 933 | " random_state=101)" 934 | ] 935 | }, 936 | { 937 | "cell_type": "markdown", 938 | "metadata": {}, 939 | "source": [ 940 | "## Training and Predicting" 941 | ] 942 | }, 943 | { 944 | "cell_type": "code", 945 | "execution_count": 30, 946 | "metadata": {}, 947 | "outputs": [], 948 | "source": [ 949 | "from sklearn.linear_model import LogisticRegression" 950 | ] 951 | }, 952 | { 953 | "cell_type": "code", 954 | "execution_count": 31, 955 | "metadata": {}, 956 | "outputs": [ 957 | { 958 | "name": "stderr", 959 | "output_type": "stream", 960 | "text": [ 961 | "C:\\Users\\monah\\AppData\\Roaming\\Python\\Python38\\site-packages\\sklearn\\linear_model\\_logistic.py:814: ConvergenceWarning: lbfgs failed to converge (status=1):\n", 962 | "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.\n", 963 | "\n", 964 | "Increase the number of iterations (max_iter) or scale the data as shown in:\n", 965 | " https://scikit-learn.org/stable/modules/preprocessing.html\n", 966 | "Please also refer to the documentation for alternative solver options:\n", 967 | " https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression\n", 968 | " n_iter_i = _check_optimize_result(\n" 969 | ] 970 | }, 971 | { 972 | "data": { 973 | "text/plain": [ 974 | "LogisticRegression()" 975 | ] 976 | }, 977 | "execution_count": 31, 978 | "metadata": {}, 979 | "output_type": "execute_result" 980 | } 981 | ], 982 | "source": [ 983 | "logmodel = LogisticRegression()\n", 984 | "logmodel.fit(X_train,y_train)" 985 | ] 986 | }, 987 | { 988 | "cell_type": "code", 989 | "execution_count": 32, 990 | "metadata": {}, 991 | "outputs": [], 992 | "source": [ 993 | "predictions = logmodel.predict(X_test)" 994 | ] 995 | }, 996 | { 997 | "cell_type": "code", 998 | "execution_count": 33, 999 | "metadata": { 1000 | "scrolled": true 1001 | }, 1002 | "outputs": [ 1003 | { 1004 | "data": { 1005 | "text/plain": [ 1006 | "array([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1], dtype=int64)" 1007 | ] 1008 | }, 1009 | "execution_count": 33, 1010 | "metadata": {}, 1011 | "output_type": "execute_result" 1012 | } 1013 | ], 1014 | "source": [ 1015 | "predictions" 1016 | ] 1017 | }, 1018 | { 1019 | "cell_type": "code", 1020 | "execution_count": 34, 1021 | "metadata": { 1022 | "scrolled": true 1023 | }, 1024 | "outputs": [ 1025 | { 1026 | "data": { 1027 | "text/plain": [ 1028 | "50 0\n", 1029 | "6 1\n", 1030 | "51 0\n", 1031 | "54 1\n", 1032 | "53 1\n", 1033 | "69 1\n", 1034 | "32 1\n", 1035 | "31 1\n", 1036 | "21 1\n", 1037 | "88 1\n", 1038 | "43 1\n", 1039 | "47 0\n", 1040 | "3 0\n", 1041 | "1 0\n", 1042 | "74 0\n", 1043 | "16 1\n", 1044 | "45 0\n", 1045 | "25 1\n", 1046 | "Name: Class, dtype: int64" 1047 | ] 1048 | }, 1049 | "execution_count": 34, 1050 | "metadata": {}, 1051 | "output_type": "execute_result" 1052 | } 1053 | ], 1054 | "source": [ 1055 | "y_test" 1056 | ] 1057 | }, 1058 | { 1059 | "cell_type": "markdown", 1060 | "metadata": {}, 1061 | "source": [ 1062 | "Let's move on to evaluate our model!" 1063 | ] 1064 | }, 1065 | { 1066 | "cell_type": "markdown", 1067 | "metadata": {}, 1068 | "source": [ 1069 | "## Evaluation" 1070 | ] 1071 | }, 1072 | { 1073 | "cell_type": "markdown", 1074 | "metadata": {}, 1075 | "source": [ 1076 | "Let's bring Confusion Matrix!" 1077 | ] 1078 | }, 1079 | { 1080 | "cell_type": "code", 1081 | "execution_count": 35, 1082 | "metadata": {}, 1083 | "outputs": [], 1084 | "source": [ 1085 | "from sklearn.metrics import confusion_matrix" 1086 | ] 1087 | }, 1088 | { 1089 | "cell_type": "code", 1090 | "execution_count": 36, 1091 | "metadata": {}, 1092 | "outputs": [ 1093 | { 1094 | "data": { 1095 | "text/plain": [ 1096 | "array([[ 7, 0],\n", 1097 | " [ 1, 10]], dtype=int64)" 1098 | ] 1099 | }, 1100 | "execution_count": 36, 1101 | "metadata": {}, 1102 | "output_type": "execute_result" 1103 | } 1104 | ], 1105 | "source": [ 1106 | "confusion_matrix(y_test,predictions)" 1107 | ] 1108 | }, 1109 | { 1110 | "cell_type": "markdown", 1111 | "metadata": {}, 1112 | "source": [ 1113 | "We can check precision,recall,f1-score using classification report!" 1114 | ] 1115 | }, 1116 | { 1117 | "cell_type": "code", 1118 | "execution_count": 37, 1119 | "metadata": {}, 1120 | "outputs": [], 1121 | "source": [ 1122 | "from sklearn.metrics import accuracy_score" 1123 | ] 1124 | }, 1125 | { 1126 | "cell_type": "code", 1127 | "execution_count": 38, 1128 | "metadata": {}, 1129 | "outputs": [ 1130 | { 1131 | "data": { 1132 | "text/plain": [ 1133 | "17" 1134 | ] 1135 | }, 1136 | "execution_count": 38, 1137 | "metadata": {}, 1138 | "output_type": "execute_result" 1139 | } 1140 | ], 1141 | "source": [ 1142 | "accuracy_score(y_test,predictions, normalize=False)" 1143 | ] 1144 | }, 1145 | { 1146 | "cell_type": "code", 1147 | "execution_count": 39, 1148 | "metadata": {}, 1149 | "outputs": [ 1150 | { 1151 | "data": { 1152 | "text/plain": [ 1153 | "0.9444444444444444" 1154 | ] 1155 | }, 1156 | "execution_count": 39, 1157 | "metadata": {}, 1158 | "output_type": "execute_result" 1159 | } 1160 | ], 1161 | "source": [ 1162 | "accuracy_score(y_test,predictions, normalize=True)" 1163 | ] 1164 | }, 1165 | { 1166 | "cell_type": "code", 1167 | "execution_count": 40, 1168 | "metadata": {}, 1169 | "outputs": [], 1170 | "source": [ 1171 | "from sklearn.metrics import classification_report" 1172 | ] 1173 | }, 1174 | { 1175 | "cell_type": "code", 1176 | "execution_count": 41, 1177 | "metadata": {}, 1178 | "outputs": [ 1179 | { 1180 | "name": "stdout", 1181 | "output_type": "stream", 1182 | "text": [ 1183 | " precision recall f1-score support\n", 1184 | "\n", 1185 | " 0 0.88 1.00 0.93 7\n", 1186 | " 1 1.00 0.91 0.95 11\n", 1187 | "\n", 1188 | " accuracy 0.94 18\n", 1189 | " macro avg 0.94 0.95 0.94 18\n", 1190 | "weighted avg 0.95 0.94 0.94 18\n", 1191 | "\n" 1192 | ] 1193 | } 1194 | ], 1195 | "source": [ 1196 | "print(classification_report(y_test,predictions))" 1197 | ] 1198 | }, 1199 | { 1200 | "cell_type": "markdown", 1201 | "metadata": {}, 1202 | "source": [ 1203 | "\n", 1204 | "## Great Job!" 1205 | ] 1206 | } 1207 | ], 1208 | "metadata": { 1209 | "kernelspec": { 1210 | "display_name": "Python 3 (ipykernel)", 1211 | "language": "python", 1212 | "name": "python3" 1213 | }, 1214 | "language_info": { 1215 | "codemirror_mode": { 1216 | "name": "ipython", 1217 | "version": 3 1218 | }, 1219 | "file_extension": ".py", 1220 | "mimetype": "text/x-python", 1221 | "name": "python", 1222 | "nbconvert_exporter": "python", 1223 | "pygments_lexer": "ipython3", 1224 | "version": "3.8.3" 1225 | } 1226 | }, 1227 | "nbformat": 4, 1228 | "nbformat_minor": 1 1229 | } 1230 | --------------------------------------------------------------------------------