programming assignment
Title: Predicting Disaster Tweets Using Natural Language Processing and Logistic Regression The project assignment again comes from the Kaggle site. This assignment is a logistic regression analysis to classify tweets as Natural Disaster tweets. As with previous assignments, much of the code you will need can be found using URL links below. Your main responsibility is to provide complete end to end assessment of your model results, explain for the reader what is occurring, how do different models compare in terms of outcome, why are some models potentially better for this application than others. Most importantly, this interpretation must be understandable for someone less familiar with machine learning. This assignment will introduce some new libraries. Any library you encounter that you have not previously installed, you will need to install with install.packages(). You will also encounter some Natural Language Processing (NLP) terminology. Consider using the URL below to assist in gaining some understanding that you can convey for the reader. URL links below provide... · Overview of the original Kaggle competition, https://www.kaggle.com/c/nlp-getting-started/overview/description (Links to an external site.) https://www.kaggle.com/c/digit-recognizer/overview/description (Links to an external site.) · Overview of the test and train data sets, https://www.kaggle.com/c/nlp-getting-started/data (Links to an external site.) (Links to an external site.) · Tutorials related to the competition, https://www.kaggle.com/wrrosa/nlp-getting-started-tutorial-in-r (Links to an external site.) (Links to an external site.) · Basic understanding of NLP terminology and R, http://rstudio-pubs-static.s3.amazonaws.com/256588_57b585da6c054349825cba46685d8464.html (Links to an external site.) Considerations for this assignment · Classify tweets as Disaster or not using a variety of features · Use ROC curves and confusion matrix results to compare multiple models · Explain your results including critical metrics like accuracy, precision, recall · Compare your test results to training results; does it indicate concerns for overfitting? · You can and likely should consider creating new features from existing features · Explain how and why you derived any new features; what did you see or theorize that led to your decision Expectations · Your work must be reproducible. This means every step you take along the way from importing data sets, to creating train and test, to creating or modifying features, to generating the models; everything must be in the RMD so that an independent researcher could recreate your work. · Explain data preparation steps taken. · Your work must be done with R through RMD and knitted to a pdf. · I would like you to build all models using the caret library and train() function. · Use kfold cross validation through caret with k of your choice; it is fine to rely on k=10; just be consistent. · Interpret the results. · It is critical that you provide the client feedback for each model as to how the model will perform out of sample, with your test set. · The Kaggle site has already divided the data into train and test. Do not divide them further. Train the models using train.csv, and use test.csv to predict and evaluate out of sample metrics · You are encouraged but not required to create a Kaggle account and participate in the Getting Started competition for the housing data. The reference material has all the code you will need. 2 test (2) idkeywordlocationtext 0Just happened a terrible car crash 2Heard about #earthquake is different cities, stay safe everyone. 3there is a forest fire at spot pond, geese are fleeing across the street, I cannot save them all 9Apocalypse lighting. #Spokane #wildfires 11Typhoon Soudelor kills 28 in China and Taiwan 12We're shaking...It's an earthquake 21They'd probably still show more life than Arsenal did yesterday, eh? EH? 22Hey! How are you? 27What a nice hat? 29Fuck off! 30No I don't like cold! 35NOOOOOOOOO! Don't do that! 42No don't tell me that! 43What if?! 45Awesome! 46ablazeLondonBirmingham Wholesale Market is ablaze BBC News - Fire breaks out at Birmingham's Wholesale Market http://t.co/irWqCEZWEU 47ablazeNiall's place | SAF 12 SQUAD |@sunkxssedharry will you wear shorts for race ablaze ? 51ablazeNIGERIA#PreviouslyOnDoyinTv: Toke Makinwa‰Ûªs marriage crisis sets Nigerian Twitter ablaze... http://t.co/CMghxBa2XI 58ablazeLive On WebcamCheck these out: http://t.co/rOI2NSmEJJ http://t.co/3Tj8ZjiN21 http://t.co/YDUiXEfIpE http://t.co/LxTjc87KLS #nsfw 60ablazeLos Angeles, CalifnordiaPSA: I‰Ûªm splitting my personalities. ?? techies follow @ablaze_co ?? Burners follow @ablaze 69ablazethreeonefive. beware world ablaze sierra leone & guap. 70ablazeWashington StateBurning Man Ablaze! by Turban Diva http://t.co/hodWosAmWS via @Etsy 72ablazeWhoop Ass, GeorgiaNot a diss song. People will take 1 thing and run with it. Smh it's an eye opener though. He is about 2 set the game ablaze @CyhiThePrynce 75ablazeIndiaRape victim dies as she sets herself ablaze: A 16-year-old girl died of burn injuries as she set herself ablaze‰Û_ http://t.co/UK8hNrbOob 84ablazeSETTING MYSELF ABLAZE http://t.co/6vMe7P5XhC 87ablazescarborough, ontario@CTVToronto the bins in front of the field by my house wer set ablaze the other day flames went rite up the hydro pole wonder if it was him 88ablaze#nowplaying Alfons - Ablaze 2015 on Puls Radio #pulsradio http://t.co/aA5BJgWfDv 90ablaze121 N La Salle St, Suite 500'Burning Rahm': Let's hope City Hall builds a giant wooden mayoral effigy 100 feet tall & sets it ablaze. http://t.co/kFo2mksn6Y @John_Kass 94ablazeWandering@PhilippaEilhart @DhuBlath hurt but her eyes ablaze with insulted anger. 99accidentHomewood, PAAccident cleared in #PaTurnpike on PATP EB between PA-18 and Cranberry slow back to #traffic http://t.co/SL0Oqn0Vyr 101accidentJust got to love burning your self on a damn curling wand... I swear someone needs to take it away from me cuase I'm just accident prone. 103accidentI hate badging shit in accident 106accidentUSA#3: Car Recorder ZeroEdgeå¨ Dual-lens Car Camera Vehicle Traffic/Driving History/Accident Camcorder Large Re... http://t.co/kKFaSJv6Cj 108accidentMassachusettsCoincidence Or #Curse? Still #Unresolved Secrets From Past http://t.co/7VG8Df9pLE #accident 111accidentBexhill@Traffic_SouthE @roadpol_east Accident on A27 near Lewes is it Kingston Roundabout rather than A283 115accidentAnime World@sakuma_en If you pretend to feel a certain way the feeling can become genuine all by accident. -Hei (Darker than Black) #manga #anime 116accidentFor Legal and Medical Referral Service @1800_Injured Call us at: 1-800-465-87332 #accident #slipandfall #dogbite 122accidentCowtown, Caliii !!There's a construction guy working on the Disney store and he has huge gauges in his ears ?? ...that is a bloody accident waiting to happen 123accident@RobynJilllian @WlSDOMTEETHS I feel like I'm going to do it on accident. Teesha is gonna come out?? 124accidentAll Motorways, UKOn the #M42 northbound between junctions J3 and J3A there are currently delays of 10 mins due to an accident c... http://t.co/LwI3prBa31 125accidentFrankfurt, Germany@DaveOshry @Soembie So if I say that I met her by accident this week- would you be super jelly Dave? :p 127accidentGresham, ORACCIDENT - HIT AND RUN - COLD at 500 BLOCK OF SE VISTA TER GRESHAM OR [Gresham Police #PG15000044357] 10:35 #pdx911 140accident@Calum5SOS this happened on accident but I like it http://t.co/QHmXuljSX9 142accidentLas Vegas Please donate and spread the word! A training accident left the pole-vaulter Kira GrÃŒ_nberg a paraplegic http://t.co/6MpnyCl8PK 147aftershockMidland, MiPlease like and share our new page for our Indoor Trampoline Park Aftershock opening this fall!! http://t.co/UgXhHErrxS 148aftershockSÌ£o Vicente, SÌ£o Paulo@bxckylynch foi no ROH Aftershock: Las Vegas procura no pirate bay que tem 150aftershockVault 101, FalloutSchoolboy ‰ÛÒ Aftershock (Original Mix) Excision & Skism ‰ÛÒ SEXisM (Far Too Loud Remix) Firebeatz Schella ‰ÛÒ Dear New... http://t.co/JQLzUA6YzQ 152aftershockSwitzerland320 [IR] ICEMOON [AFTERSHOCK] | http://t.co/THyzOMVWU0 | @djicemoon | #Dubstep #TrapMusic #DnB #EDM #Dance #Ices‰Û_ http://t.co/83jOO0xk29 154aftershockCalifornia'When the aftershock happened (Nepal) we were the last int'l team still there; in a way we were 1st responders.' Chief Collins @LACo_FD 155aftershockEurope320 [IR] ICEMOON [AFTERSHOCK] | http://t.co/gRPeF7yAWG | @djicemoon | #Dubstep #TrapMusic #DnB #EDM #Dance #Ices‰Û_ http://t.co/GGmvzT58vE 166aftershock304Stop saying 'I Wish' and start saying 'I Will'. ‰ÛÒ Unknown 167aftershockDavis, CAI want to go to Aftershock in October because it has all the bands I listen to and #NXT! Can't afford it yet though. #gradschoolapps 169aftershockDetroit, MI'We are still living in the aftershock of Hiroshima people are still the scars of history.' - Edward Bond http://t.co/engTl5wrGp 177aftershockSwitzerland320 [IR] ICEMOON [AFTERSHOCK] | http://t.co/THyzOMVWU0 | @djicemoon | #Dubstep #TrapMusic #DnB #EDM #Dance #Ices‰Û_ http://t.co/83jOO0xk29 179aftershockAftershock https://t.co/Ecy4U623nO 181aftershock304'There is no victory at bargain basement prices.' Dwight David Eisenhower 186aftershockUnited KingdomBo2 had by far the best competitive maps imo hope bo3 is the same #InVahnWeTrust 188aftershockLondon, EnglandBrass and Copper in Cataclysm & AfterShock!!! http://t.co/uxYZyaygTy 189aftershockIn your hearts and minds@JadeForMKX You should be happy I don't use Aftershock. That variation counters your play style hard. 192aftershockRuncornAftershock https://t.co/38Nhq9moEf 200airplane%20accidentLake Charles, LAWhen carelessness leads to an aviation accident the victim has the right to seek compensation for damages. http://t.co/eqAG6rz1vO 202airplane%20accidentCalifornia, USA@rewind_music found out about you guys today(regarding the accident on the airplane lol) & became a fan! Sending love & support from Cali~? 206airplane%20accidentA girl who died in an airplane accident fifteen years ago 207airplane%20accident@Mintechan Hihow are you? There is Keio line on the stationright? BTW do you know the airplane accident near Chofu airport this week? 214airplane%20accidentEagle Pass, TexasMexican airplane accident in Ocampo Coahuila MX on 7/29/25 killed Coahuila government SubSecretariat Francisco Garcia Castells age 42. 217airplane%20accidentHorrible Accident Man Died In Wings of AirplaneåÊ(29-07-2015) http://t.co/5ZRKZdhODe 223airplane%20accidentinland empire ca@god if an accident were to happen on this airplane idc if the rest of my luggage is completely destroyed just please save my makeup 224airplane%20accidentMuscatHorrible Accident Man Died In Wings of Airplane (29-07-2015) http://t.co/hG8u2kR1Rq 227airplane%20accident#UPDATE: Picture from the Penn Twp. airplane accident. http://t.co/6JfgDnZRlC 228airplane%20accidentNew YorkSee how a judge ruled in this 2009 accident at #JFK Airport? involving Korean Air?. http://t.co/Yh1cGlN3rl http://t.co/6F5ShPKjOB 230airplane%20accident#BlackLivesMatter@thugIauren I had myself on airplane mode by accident ?? 233airplane%20accidentUSA - Global Online Sales 36 years ago today baseball lost one of its greats in an airplane accident. RIP Captain. #Yankees @yankees http://t.co/iNKU28vjJj 234airplane%20accidentExperts in France begin examining airplane debris found on Reunion Island: French air accident experts on Wedn... http://t.co/miw2i0pQxz 236airplane%20accident#BreakingNews Experts in France begin examining airplane debris found on Reunion Island: French air accident e... http://t.co/3XIcUvlvlJ 239airplane%20accidentFranceExperts in France begin examining airplane debris found on Reunion Island: French air accident experts on Wedn... http://t.co/KuBsM16OuD 250ambulanceIstanbul, TÃŒ_rkiyeTwelve feared killed in Pakistani air ambulance helicopter crash http://t.co/zdsug0UjS7 255ambulanceHigh in Prague with Ayahttp://t.co/Q5XTkaKM08 I'M DYING SEND AN AMBULANCE @M__Belly @brightasastar_ 257ambulanceHappily Married with 2 kids AMBULANCE SPRINTER AUTOMATIC FRONTLINE VEHICLE CHOICE OF 14 LEZ COMPLIANT | eBay http://t.co/7X3PDDbT0Z 259ambulanceborn on september 1st@disneyxrowbrina the ambulance isn't even parked well like its nearly on top of someone's car I'm laughing 275ambulanceAtlanta, GAShot 12 times. Found dead in cuffs after being involved in a car accident. Officers told ambulance not to treat him. https://t.co/MEUDJwaaNg 278ambulanceUSA @margaretcho Call me a fag and I'm going to call you an ambulance :) #RainbowPower 282ambulanceWorldwideNew Nanotech Device Will Be Able To Target And Destroy Blood Clots http://t.co/MnmyJXQ9go #science 284ambulanceeverywhere@vballplaya2296 want me to send you some medic supplies from my dad's ambulance? 286ambulanceWorld2 held with heroin in ambulance http://t.co/d9sOwi1G21 http://t.co/OPxmdPIwAu 288ambulancehttp://t.co/B2FaSrt1tN Twelve feared killed in Pakistani air ambulance helicopter crash http://t.co/O8BJXnEPQm 292ambulanceWest Chester, PAWhy should a helicopter ambulance ride to transfer to a hospital 21 miles away cost $29800? http://t.co/7ZqIreY7Te http://t.co/9Qp3PqPwZv 295ambulanceChorley, Lancashire, UKso privileged and proud to wear this uniform.?? #NHS #Ambulance #GayUK #Uniform #Proud #Privileged #WhatsYourEmergency http://t.co/0BkmuhYSFx 300annihilatedThe bartender at work described a drunk man as annihilated @kdunning1919 @hsnowberger @gabrielasmith29. 16 more days 304annihilatedSan DiegoCop pulls drunk driver to safety SECONDS before his car is