Partial preview of the text
Download Summary sheet of data and more Summaries Data Mining in PDF only on Docsity!
EDA - Exploratory Data Analysis ‘hestewed ——syrmetical et stewed ‘seruon song oo Caregorical Nominal: No o-dering mowie oe + Ordinal Has order 2 a. had, meiital, dood Numerical Interval: No fixed “2cro point” eg. temperature, pli + Ratio: Has fixce “zero pont Buaget, weight Graphs For making comparisons + Togste quick view Tables + For wading off valscs + Tocraw attertion to actual sizes Reference table: Store “all” date in table ‘hat Itcar be [o0kes up esi y Demonstration table! Table to llustrare = point Unimad! Bimodal Symmetric Positively skewed Level: Location statistics, what are “typical” values: Spread: Scale stet stcs how much a values vary? + Mean eeu 2 Median “neil value Sede” mest requent valve 1 stquarile cute pa nt far 25% of the dae + ndeuaele cutot po refer sos of ie data Frew Sid uartle cut! po fer 759 of dhe doce ‘Rage mex Dobe = quae + Sample variance Eas! + Sample stencers deviation a? Median absolute deviation trecian of ve absolute Cevietion “tom fhe mectan fe Sianlard devia sates 1 fonysicay ant + Vallance is more convenient ‘rethematicely + Variance and stanesre deviation are Sersive te “outle-s", [QR and MAD are STANDARDIZATION AND Z-SCORES Zscores + Transform data nthel- original units ints Universal stot stical unit of slandare! deviation Fam che mean, be extremet"autiers”) Negative z-score indicated that velue fs ive 2 car indicates Rule of thumb: cbservations with a 7 score larger thar 2.5 are consict to ‘Oke compute Norain Orin Imery Ratt ee cesvaan, sania ‘ror af ean Faia a a VIS - Visualization UREYSANDVALUES key/independent attribute: categorical or ordinal, usually Marks (geometric primitives): points lines, areas, complex shape ‘Channels (appearance of marks): position, color, length, size, shape, not t quantitative Value/dependent attribute: index curvature . . e . . . . . e ‘Mark: Ling Mark: Point Aading Hue Aading Sze Channel LengtvPositon Channel: Postion categorical at: +1 quanttaive at. 1 quanbiatve atinbute 1 categorical attribute 2 quantitative att. What/Where for categorical: Hue Targetinown = Target unknown: How much for ordered: Saturation — Lotion poate ee How much for orderded: Luminance ‘""" ‘8lom os Mare Cannes ‘Sealant Zavanitative — Powts: ‘Herizenal and vertical atroutes poston No keys, onty ‘Bacshart ‘categorical Lines (bar= a Length to express: 1 yt Picking) quant value 1 uanttatve Satis regions, one vale} pecmatk . ‘Stached bat ‘2 categorical Vertical stack af Length and color hue, gua ant Ine mans Spal regions quanttawe one per gion Lint chad -Dguantatire Pants ow Agno eats ta fanroutes, one connection express quantitative eyansone between hen value os vai Sparse and ordced : fn bykey abiraues into eee norco regions Heatman 2caleporcal Aiea, separate Color by atrbutes ané 1 and apn 2D. cuantatne quantiaive mai. dered stout saute 2 Orceres evergng cole map | idiom oa soa —l.eys es, Pe ein ll beet os Rei AND Table, Squanteme find datrnston or Test Find tends, auters Dictiouton, ‘correlation Clusters Compare, fookup vaues Compare, lookup vaues Partto-wnose ‘alationstio Find vend Conneceng ine ‘emphasizes ordenng tite Find clusters, aulers Data mning = dssiilling Information fram raw cata, Four methods: + Linear Regression = Clustering = Decision Tree Mining = Association Rule Learning » Often osta miring finds correlstions, not causatians! Supervised: wo have 2 credefined target Unsupervised: predefined target, Pinal interesting groups seek intonation on all nacian on aly 2 lew = Linear regression isa global, daca mir pa meth "ear refers to the way parameters occurs, not to the form of the regression supervised func tice! + Lear regression may have mattile input rt + Cross terms are important to acc: intevaction between puts Determine the quality of a linear model + Sum of squared deviations (SSD) © One measures tne (vertical) distance betwee the line and @ ata pe nt forall data points. One then computes tre sum of seuared deviations model = Re value © Is the percentage of variation in ‘utut va ues tras is explained by the variaticn In Inu: values mode! + eeamples © Linear vefyaie © Netinesr — Y=f,#A,o" Clustering is a9 unsupervised data mining metho The kemear's clgorithm i a conveniens way to fine clusters + Good stusternes Uy to find e balance between smal witsin-cluster distances and the nurber of clusters, ‘The same balance problem occured within regression: a good belance erween the sum of aquiated deviations (SSD) and the number of insuis Use data standardization when necessary Clustering vs. Linear Regression Linear Regression Dredet the tou: valves From a linear model aver the inpir va Clr output concect in the deter hal ort our tare Supervised tearning Clustering arning” = Ean be apclied also mirere labels are Lnknowin, unceain, or too expersive ta aba Centroid = represeated by one po nt ‘Clustering algorithm: kemeans Pick k randcm points as inize| centrcics Ii, Assign points te nearest centroid Wi, Recomptte certroiés MM. Repeat until heppy! Within-claster distance 2 Witirecluster distance = for each Custer, we add ue the distances between each cbsenvation in that cluster an the luster center + ‘The sum of these values forall clusters Is cluster distance WiC) for the entire clustering. > Lower valve > better clustering Euclidean Network Manhattan, distance _distance_—_distance Movemeris Mataorkar—— Kenwnrkiva Unrestriced —possibe rie suum ‘+ Decision rrees are a supervised, glebal {eta mining method Intenral ncdes correspond :0 decisions Leaves correspond to outcomes Decision trees are bullt by firding spits that have the h ghestinfarmation gain (envropy! How good z tree is can be descrived by lrustlalse pos : ves and negatives ‘True/False and NegativerPosit ve cr ee a Tr yes No 2 False Negative yes Yes > Tue Peat No yes 2 faise Positive No No 9 Tue Negative Pulse Pusilives and Fulbe Negelives ar + Asse shan rules are an uneLnery sed, loca’ data minirg methee + thuses iequeat item sls to ge rules + A strong rule hes bot hig! high confidence joporz and Strong rules Rules ef the form: x3 arestrong 10 Their support is high enough © Thelrconfidence shign enauen Support Inthe aroun: of easervations where bath and 8 (3) occur civided by tre total emeuntot Dbservatiors iA ~ €). xy) Confidence Isthe amour: of e2servations where bo:t and D eur [2.7 Bd vided 9y a eservations where & ecu [8.440 1B ORG - Organization Conceptual anc Logical Data modelling 2. Data maripulation Object system “The "real world Information system wReprecersatian of the “real world Redundancy different conditions fr but the user's dominant hand coes nat change Many measurements for eat task but the cond task stay the seme = A minimal set of ar autes oF a table “hat unicvely de‘ines each row of shis table, ‘Task ID ana Tire stamp tefine the curso’ position. so tis.a primary key Mee eave cy the “ee eclurne” able. then tactears ne ‘eoctitions oF values 6 DEMS's are des gred fo support systematic principled soluticrs to all of these problems (313 rare}: Data redundancy ard ineansisency © Data securiy 5 Expressive and efficient data ana yties Database model = 2 ccllection 2 tools for descr ting: 5 Data © Data relationships © Data semantics © Data constrains ‘We study the relational database model, os itis the domminent practica -moideland industcv standana Instance and schemas: smler:0 varia es and types in nrogrammng encuages, respectively Logical schema (data model): logical strecure othe cetabase Analogous te name variacie ina arogram A relational database schema consists of a col econ of Leble schemas and type ef a Instance = the actual content o° the Satabase at a ret cuar point inte gnu (o Un vale ct a vor able + Adatabese can be moceled asi ©. Acellection of entities 1 Relatlonsh p among entities ntity = an ctv ect thal exists anu is os shable From other ozlecs Attributes = 2 cheracteristic or tral of an enciy type that describes. the entity ‘© £9, pecole have names and ac Entity set = a set of entitics af the same type that share the seme proper: es F sl) persons, companies, tree ORG - Organization Relationship. ertities sh association among several Relationship set _ 2 collection of relationships among ently sas ‘typical SGL cuery has the form ‘Select Ist attributes to retrieve From Ist ables frers whieh we quesy Where define a predicate (iter) over the value of aliributes, aatiors: + instinct remove duplicates fa select all attributes Sst operating + And.o: pol parentheses + Uke 8 contains tas rename Count hnurrber of velues Min rrininruim value + Max axirnumn value avg average value + Sum Sumo" values + Grows by + Havieg Union Intersect Except branch (bName, bCiry, assets) customer {custName, custStrect, custCity) account —facctNumber, Name, basance) loan (lcanNunver, bName, amount) depositor (custName, acctNumber) borrower {custName, loanNumber) Fa the names ef all branches In the loan relation ‘select branch_name fram loan, Fp the rames cf all branches In the joan relation, ard remove cuplicates ct distinct branch name from joan, EXAMPLES Tne al oan number for loans made at the Perryridge branch with loan ariounts greste” thar $1200 select ican number From joan whare branch name — Perryrid ‘ragunt > 1200 EXAMPLES Firdi all pas of instructor and teaches entries select * fram iistracioy, teaches (select customer union (select customer rere from borrower) ‘ore from depesitor) have both a loan and an account: (select cusiome ture Fram do Intersect (Select customer_name fram borrower) have an account but no loan: select customer name fram depositor’ except (select customer_name from horreser) select avgibulunce) as aves fram account where brane! mex "Perry Find the number of tuples in the customer. relation. select count (*) as cusiCi Fram custannes select count (distinct customer nam=) Fram depositor Find the total assets in each city where assets are at least 100K. Select SCity, sum(assets} as totalAssers from branch ‘group by bciry having sum(assets)> 100000 HYP - Hypothesis Sele Method Uslics: hypolinesis ests assumations (hypothesis Stata tess) |. Statistics: assumptions (regression analysis) Statist es: pitfalls reqression analysis: GonLs OF SCIENCE 3 typas of analytics: I. Descriptive insight: into che oact 2. Predictive underscarding the ‘esture 3. Prescriptive advise on coss tle urease EXPLORATORY VS CONFIRMATORY lorator Confirmatot nal seems I bein Use the dala 0 the data? anewer a specific question essed before collecting tre data Magnitude stefiecis “Level of ‘Simple techniques Generate questions hypotheses") ‘advanced techniques ‘Test nypotheses Deduction “The use af logical rues Louine lo cencitsians Induction 2y observing special ses, we wis to obtaiy jena ConClUS Ons Verification by others Ockham’s Make overyth no as Razor / simple as possib e. but Parsimony ‘ot simpler Statistics Used to drow weld cenciusians from experiments DAS - Data Aggregation and Sampling Feature: characteristic What data can we collect? Primary data: collected by you Secondary data: collected by others Scientific method: approach ‘to obtain answers to questions Deduetive reasoning: logic, Sherlock Holmes way of thinking - Inductive reasoning: need more than logic, need more observations - Occam's Razor: A simpler explanation Valicity + Internal: validity within the group/study group/study, exemple data limited Feb Precision: random errors (measuring ist) ‘Accuracy: systematic errors Convenience sampling: Going for data that is easier to collect - Advantage: saving time, money = _Disacvantage: possible bias that is @ ‘threat to external valicity Random sampling: everyone is equally likely to be included Stratified random sampling: define strata - Proportionate: take a random sample ‘rom every stratum in proportion equal ‘to proportion of this stratum - Disproportionate: when you want to overrepresent strata in the sample Voluntary sampling: self-selection Median filter: choose the window size, position at the beginning of the series and compute the median Mean filter: Same approach as the median, filter, but now use the mean value. nore sensitive to outliers than median Gaussian filter: choose the filter width, consider a pair from the time series, assign weights to each value Convolution filter: same approach as the gaussian filter Data consai coardivates (X,¥) aver tirre T but {or problem statements related to overshoot and rorrectian movements we need sdeitional measures ("features") thet take into tne time aspeel Linear approximation Ib the approximation of a end with a finzar Ine, in case of distance aver = ne this gives us the velocity overtime, I Is the derivative of :72 ers ‘Quadratic approximation ihe appronimalin of a trend will a questa ¢ Ine, in cace of distance aver ‘ne thie gives Ls Ure ‘aecsieralion over Une. Ibis the secon: derivative of the tend, ‘Window = a part of aren By using windows, one can focus on cerain parts of the ersh withwul boing sree by ‘he rest ofthe dae + ivindew nee contra anda certain wath. ECDF + ECDF = Empirical Cumulta Distribution Function + plot of x versus Lbr-percentile ive oF + CDF = Cumulative Distributor Functions + 000=DN0 sO), where P stands for probability Data Transformat ons can help to visualize and analyze deta Logarithmic transformations can help to turn relative diftererces into absolute difference = reduce sxewedness Covarlate = the variable ID + An indepencent variable that has an effect on zhe deperder: variable tu: that isnot an independent variable of interest by itself pes of experimant Designed experiment. + Observetionel study Probab lites ave useful fo quartify evidence for hypotheses Biramial distribution cescrbes the probebilties related to the umber of Suceesees and failures of independent repeated binary outcomes with tre same success probebil ty © Pix=K=[tpu-ey " Hypotheses are rejected when Ue utcorne othe experiment too luni kely (t20 low orobabilty) if s9e null hypothesis would he true BL Uhyposveses: Ha Pann = Prsne ‘Atarnative nypoche: He pee > Hit Panta © Branca HE Pana + Pr DECISION PROCEDURE From the aca we compute a so-ca led test Sotatc property seated diference of the sample prozartions). ‘L. ifthe value cf the test stetistic Is too ferreme, then ive reject Hy (not. ther we da net reject H ‘The way v0 express aeing a excreme Is a 50- alled p value (usually computes by softwere) ‘The commonly Used :aresad Is 0.05. Nullhypornests is rejacted when owalue 's below tnis Freshele ('signifcance ‘evel ‘Other wame: Gausslor distribution “Bel Curve d stbution Oter used prebaciity model with Continuous outcomes, + Notaton: X Nia + 4 ismean (location paameter) + Ee Isvariance (larger values ncleate more spread) Seecialease =D and gmt is called “sterca normal distribution ‘Typa | error, proba We may reece a (*sgnifice whleHe Stree Type Il error, probability + We may net reject Hy, while, is trie Confidence Intervals require assurnption of undertying protaaily distribution One-semaie case neans (normal cistbution, assumed to be known): Remarks 1. Ifeis 10¢ known, then a similar formula exists with the quanti es of tie normal astribut distrioutio degrees of freedom) and o being replaced hy the sample stanca-t 2 ‘The wath of the interval Increases when the stanosrd deviation incraases (less, certainty! ‘The w dth of the inte-val decveases when the semple size n increases (mere terlainiy) ee pheervarins 9 your data set are indege dent from each other dheervarian in yo re fram. the seme probability cist eur on lesseand eonidenc? intervals for means normality tesrs and confidence inzervale Proportions: np >S, ni: fcoreitions to ensure app normaly) Distinguish between We agélacomect a Data that do rar ft statisti mocel + Could d stort analysis rasut: = Simple graphical (oul: Box and Whiske po + Rule of thumb: dats pov: more than 3 or 3 standard devissiens away ‘rom graphical (gives insight why nonra ity may not be evar ate ‘emel density platigood for gleba assessment of shape) orrral srobabllity plot (re: {good for detecting whether thee are problems) + goodness-of-fit tes: (gives objective decision criterion} \ Angarson-Darling test (naw) Kemel density plot + good for “seeing” symmetry! bell shops not good encugh fr tals Bs obal shove? Normal provebility plot = similar Lo Ure ECF trick: transform y-axis so thar ECO? becomes straight! ‘Anderson-Dar'ing test ‘This s a stalsticel rest to oe used together with ‘the qrapnical mstaods. A stat stical test 3 ves an ozjective answer. the graphical methods bive ins ght why ve data are distributes Hee & Rormal d striburion Ls dala comes from nermal distribution Ue data doas not come from rormal distribution “This test requires software to perforin Interpretation at p-value: it pas small, ther reject Bs Practical enoice: small twresnola (e.g. 001 Instead 0.05). since che t-test Is robust against mederate ceviatiors of ror malty. Moet Y= Bo B.ay ae +B,x,r8,£ Ni0,0") options 1, Expectation is a linear ‘unction of ataimels: L(V BAB Arto Bye 2. Aeditive error term (since enor term is written as +6) Normalty ef the error terra Independence of aoservations qual vanance o? ob allabservatins Each of these made. assumst ons for linear regression may not te met. They are ten hard ‘to checé upfront, sa ene checks them after 3 ode! has seen Tt:ed ("iredel diagnostics") ‘Tools for diagresties 1 Scaiier plols 2. Plots of residua's( ¢=y, ¥, } vervus eriablies and predicted! values (lor assuret mi. Ani Hormel probaoilcy plots (assumption 3 based on res duals) Commror piv'ells n linesr regress on: 1. wang intemreta‘ion of R° 2. Leverage paints 3. Extrapolation 4. Inte’pretation of -egression coeffclenss, etn