SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
Data Science
“folk knowledge”
Krishna Sankar
@ksankar
https://www.linkedin.com/in/ksankar
Data Science “folk knowledge” (1 of A)
o  "If you torture the data long enough, it will confess to anything." – Hal Varian, Computer
Mediated Transactions
o  Learning = Representation + Evaluation + Optimization
o  It’s Generalization that counts
•  The fundamental goal of machine learning is to generalize beyond the
examples in the training set
o  Data alone is not enough
•  Induction not deduction - Every learner should embody some knowledge
or assumptions beyond the data it is given in order to generalize beyond
it
o  Machine Learning is not magic – one cannot get something from nothing
•  In order to infer, one needs the knobs & the dials
•  One also needs a rich expressive dataset
A few useful things to know about machine learning - by Pedro Domingos
http://dl.acm.org/citation.cfm?id=2347755
Data Science “folk knowledge” (2 of A)
o  Over fitting has many faces
•  Bias – Model not strong enough. So the learner has the tendency to learn the
same wrong things
•  Variance – Learning too much from one dataset; model will fall apart (ie much
less accurate) on a different dataset
•  Sampling Bias
o  Intuition Fails in high Dimensions –Bellman
•  Blessing of non-conformity & lower effective dimension; many applications
have examples not uniformly spread but concentrated near a lower dimensional
manifold eg. Space of digits is much smaller then the space of images
o  Theoretical Guarantees are not What they seem
•  One of the major developments o f recent decades has been the realization that
we can have guarantees on the results of induction, particularly if we are
willing to settle for probabilistic guarantees.
o  Feature engineering is the Key
A few useful things to know about machine learning - by Pedro Domingos
http://dl.acm.org/citation.cfm?id=2347755
Data Science “folk knowledge” (3 of A)
o  More Data Beats a Cleverer Algorithm
•  Or conversely select algorithms that improve with data
•  Don’t optimize prematurely without getting more data
o  Learn many models, not Just One
•  Ensembles ! – Change the hypothesis space
•  Netflix prize
•  E.g. Bagging, Boosting, Stacking
o  Simplicity Does not necessarily imply Accuracy
o  Representable Does not imply Learnable
•  Just because a function can be represented does not mean
it can be learned
o  Correlation Does not imply Causation
o  http://doubleclix.wordpress.com/2014/03/07/a-glimpse-of-google-nasa-peter-norvig/
o  A few useful things to know about machine learning - by Pedro Domingos
§  http://dl.acm.org/citation.cfm?id=2347755
Data Science “folk knowledge” (4 of A)
o  The simplest hypothesis that fits the data is also the most
plausible
•  Occam’s Razor
•  Don’t go for a 4 layer Neural Network unless
you have that complex data
•  But that doesn’t also mean that one should
choose the simplest hypothesis
•  Match the impedance of the domain, data & the
algorithms
o  Think of over fitting as memorizing as opposed to learning.
o  Data leakage has many forms
o  Sometimes the Absence of Something is Everything
o  [Corollary] Absence of Evidence is not the Evidence of
Absence
§  Simple	
  Model	
  
§  High	
  Error	
  line	
  that	
  cannot	
  be	
  
compensated	
  with	
  more	
  data	
  
§  Gets	
  to	
  a	
  lower	
  error	
  rate	
  with	
  less	
  data	
  
points	
  
§  Complex	
  Model	
  
§  Lower	
  Error	
  Line	
  
§  But	
  needs	
  more	
  data	
  points	
  to	
  reach	
  
decent	
  error	
  	
  
New to Machine Learning? Avoid these three mistakes, James Faghmous
https://medium.com/about-data/73258b3848a4Ref: Andrew Ng/Stanford, Yaser S./CalTech
Check your assumptions
o  The decisions a model makes, is directly related to the it’s assumptions about the
statistical distribution of the underlying data
o  For example, for regression one should check that:
① Variables are normally distributed
•  Test for normality via visual inspection, skew & kurtosis, outlier inspections via
plots, z-scores et al
② There is a linear relationship between the dependent & independent
variables
•  Inspect residual plots, try quadratic relationships, try log plots et al
③ Variables are measured without error
④ Assumption of Homoscedasticity
§  Homoscedasticity assumes constant or near constant error variance
§  Check the standard residual plots and look for heteroscedasticity
§  For example in the figure, left box has the errors scattered randomly around zero; while the
right two diagrams have the errors unevenly distributed
Jason W. Osborne and Elaine Waters, Four assumptions of multiple regression that researchers should always test,
http://pareonline.net/getvn.asp?v=8&n=2
Data Science “folk knowledge” (5 of A)
Donald Rumsfeld is an armchair Data Scientist !
http://smartorg.com/2013/07/valuepoint19/
The
World

Knowns	
  
	
  
	
  
	
  
	
  
	
  
Unknowns	
  
You
UnKnown	
   Known	
  
o  Others	
  know,	
  you	
  don’t	
   o  What	
  we	
  do	
  
o  Facts,	
  outcomes	
  or	
  
scenarios	
  we	
  have	
  not	
  
encountered,	
  nor	
  
considered	
  
o  “Black	
  swans”,	
  outliers,	
  
long	
  tails	
  of	
  probability	
  
distribuHons	
  
o  Lack	
  of	
  experience,	
  
imaginaHon	
  
o  PotenHal	
  facts,	
  
outcomes	
  we	
  
are	
  aware,	
  but	
  
not	
  	
  with	
  
certainty	
  
o  StochasHc	
  
processes,	
  
ProbabiliHes	
  
o  Known Knowns
o  There are things we know that we know
o  Known Unknowns
o  That is to say, there are things that we
now know we don't know
o  But there are also Unknown Unknowns
o  There are things we do not know we
don't know
Data Science “folk knowledge” (6 of A) - Pipeline
o  Scalable	
  Model	
  
Deployment	
  
o  Big	
  Data	
  
automation	
  &	
  
purpose	
  built	
  
appliances	
  (soft/
hard)	
  
o  Manage	
  SLAs	
  &	
  
response	
  times	
  
o  Volume	
  
o  Velocity	
  
o  Streaming	
  Data	
  
o  Canonical	
  form	
  
o  Data	
  catalog	
  
o  Data	
  Fabric	
  across	
  the	
  
organization	
  
o  Access	
  to	
  multiple	
  
sources	
  of	
  data	
  	
  
o  Think	
  Hybrid	
  –	
  Big	
  Data	
  
Apps,	
  Appliances	
  &	
  
Infrastructure	
  
Collect Store Transform
o  Metadata	
  
o  Monitor	
  counters	
  &	
  
Metrics	
  
o  Structured	
  vs.	
  Multi-­‐
structured	
  
o  Flexible	
  &	
  Selectable	
  
§  Data	
  Subsets	
  	
  
§  Attribute	
  sets	
  
o  Refine	
  model	
  with	
  
§  Extended	
  Data	
  
subsets	
  
§  Engineered	
  
Attribute	
  sets	
  
o  Validation	
  run	
  across	
  a	
  
larger	
  data	
  set	
  
Reason Model Deploy
Data Management
Data Science
o  Dynamic	
  Data	
  Sets	
  
o  2	
  way	
  key-­‐value	
  tagging	
  of	
  
datasets	
  
o  Extended	
  attribute	
  sets	
  
o  Advanced	
  Analytics	
  
ExploreVisualize Recommend Predict
o  Performance	
  
o  Scalability	
  
o  Refresh	
  Latency	
  
o  In-­‐memory	
  Analytics	
  
o  Advanced	
  Visualization	
  
o  Interactive	
  Dashboards	
  
o  Map	
  Overlay	
  
o  Infographics	
  
¤  Bytes to Business
a.k.a. Build the full
stack
¤  Find Relevant Data
For Business
¤  Connect the Dots
Volume
Velocity
Variety
Data Science “folk knowledge” (7 of A)
Context
Connect
edness
Intelligence
Interface
Inference
“Data of unusual size”
that can't be brute forced
o  Three Amigos
o  Interface = Cognition
o  Intelligence = Compute(CPU) & Computational(GPU)
o  Infer Significance & Causality
Data Science “folk knowledge” (8 of A)
Jeremy’s Axioms
o  Iteratively explore data
o  Tools
•  Excel Format, Perl, Perl Book
o  Get your head around data
•  Pivot Table
o  Don’t over-complicate
o  If people give you data, don’t assume that you
need to use all of it
o  Look at pictures !
o  History of your submissions – keep a tab
o  Don’t be afraid to submit simple solutions
•  We will do this during this workshop
Ref: http://blog.kaggle.com/2011/03/23/getting-in-shape-for-the-sport-of-data-sciencetalk-by-jeremy-howard/
Data Science “folk knowledge” (9 of A)
①  Common Sense (some features make more sense then others)
②  Carefully read these forums to get a peak at other peoples’ mindset
③  Visualizations
④  Train a classifier (e.g. logistic regression) and look at the feature weights
⑤  Train a decision tree and visualize it
⑥  Cluster the data and look at what clusters you get out
⑦  Just look at the raw data
⑧  Train a simple classifier, see what mistakes it makes
⑨  Write a classifier using handwritten rules
⑩  Pick a fancy method that you want to apply (Deep Learning/Nnet)
-- Maarten Bosma
-- http://www.kaggle.com/c/stumbleupon/forums/t/5761/methods-for-getting-a-first-overview-over-the-data
Data Science “folk knowledge” (A of A)
Lessons from Kaggle Winners
①  Don’t over-fit
②  All predictors are not needed
•  All data rows are not needed, either
③  Tuning the algorithms will give different results
④  Reduce the dataset (Average, select transition data,…)
⑤  Test set & training set can differ
⑥  Iteratively explore & get your head around data
⑦  Don’t be afraid to submit simple solutions
⑧  Keep a tab & history your submissions
The curious case of the Data Scientist
o Data Scientist is multi-faceted & Contextual
o Data Scientist should be building Data Products
o Data Scientist should tell a story
Data Scientist (noun): Person who is better at
statistics than any software engineer & better
at software engineering than any statistician
– Josh Wills (Cloudera)
Data Scientist (noun): Person who is worse at
statistics than any statistician & worse at
software engineering than any software
engineer – Will Cukierski (Kaggle)
http://doubleclix.wordpress.com/2014/01/25/the-curious-case-of-the-data-scientist-profession/
Large is hard; Infinite is much easier !
– Titus Brown
Essential Reading List
o  A few useful things to know about machine learning - by Pedro Domingos
•  http://dl.acm.org/citation.cfm?id=2347755
o  The Lack of A Priori Distinctions Between Learning Algorithms by David H. Wolpert
•  http://mpdc.mae.cornell.edu/Courses/MAE714/Papers/
lack_of_a_priori_distinctions_wolpert.pdf
o  http://www.no-free-lunch.org/
o  Controlling the false discovery rate: a practical and powerful approach to multiple testing Benjamini, Y. and Hochberg,
Y. C
•  http://www.stat.purdue.edu/~‾doerge/BIOINFORM.D/FALL06/Benjamini%20and%20Y
%20FDR.pdf
o  A Glimpse of Googl, NASA,Peter Norvig + The Restaurant at the End of the Universe
•  http://doubleclix.wordpress.com/2014/03/07/a-glimpse-of-google-nasa-peter-norvig/
o  Avoid these three mistakes, James Faghmo
•  https://medium.com/about-data/73258b3848a4
o  Leakage in Data Mining: Formulation, Detection, and Avoidance
•  http://www.cs.umb.edu/~‾ding/history/470_670_fall_2011/papers/
cs670_Tran_PreferredPaper_LeakingInDataMining.pdf
For your reading & viewing pleasure … An ordered List
①  An Introduction to Statistical Learning
•  http://www-bcf.usc.edu/~‾gareth/ISL/
②  ISL Class Stanford/Hastie/Tibsharani at their best - Statistical Learning
•  http://online.stanford.edu/course/statistical-learning-winter-2014
③  Prof. Pedro Domingo
•  https://class.coursera.org/machlearning-001/lecture/preview
④  Prof. Andrew Ng
•  https://class.coursera.org/ml-003/lecture/preview
⑤  Prof. Abu Mostafa, CaltechX: CS1156x: Learning From Data
•  https://www.edx.org/course/caltechx/caltechx-cs1156x-learning-data-1120
⑥  Mathematicalmonk @ YouTube
•  https://www.youtube.com/playlist?list=PLD0F06AA0D2E8FFBA
⑦  The Elements Of Statistical Learning
•  http://statweb.stanford.edu/~‾tibs/ElemStatLearn/
http://www.quora.com/Machine-Learning/Whats-the-easiest-way-to-learn-machine-learning/
Of Models,
Performance, Evaluation
& Interpretation
What does it mean ? Let us ponder ….
o  We have a training data set representing a domain
•  We reason over the dataset & develop a model to predict outcomes
o  How good is our prediction when it comes to real life scenarios ?
o  The assumption is that the dataset is taken at random
•  Or Is it ? Is there a Sampling Bias ?
•  i.i.d ? Independent ? Identically Distributed ?
•  What about homoscedasticity ? Do they have the same finite variance ?
o  Can we assure that another dataset (from the same domain) will give us the same
result ?
o  Will our model & it’s parameters remain the same if we get another data set ?
o  How can we evaluate our model ?
o  How can we select the right parameters for a selected model ?
Bias/Variance (1 of 2)
o Model Complexity
•  Complex Model increases the
training data fit
•  But then it overfits & doesn't
perform as well with real data
o  Bias vs. Variance
o  Classical diagram
o  From ELSII, By Hastie, Tibshirani & Friedman
o  Bias – Model learns wrong things; not
complex enough; error gap small; more
data by itself won’t help
o  Variance – Different dataset will give
different error rate; over fitted model;
larger error gap; more data could help
Prediction Error

Training 

Error

Ref: Andrew Ng/Stanford, Yaser S./CalTech
Learning Curve
Bias/Variance (2 of 2)
o High Bias
•  Due to Underfitting
•  Add more features
•  More sophisticated model
•  Quadratic Terms, complex equations,…
•  Decrease regularization
o High Variance
•  Due to Overfitting
•  Use fewer features
•  Use more training sample
•  Increase Regularization
Prediction Error

Training 

Error

Ref: Strata 2013 Tutorial by Olivier Grisel
Learning Curve
Need	
  more	
  features	
  or	
  more	
  
complex	
  model	
  to	
  improve	
  
Need	
  more	
  data	
  to	
  improve	
  
Partition Data !
•  Training (60%)
•  Validation(20%) &
•  “Vault” Test (20%) Data sets
k-fold Cross-Validation
•  Split data into k equal parts
•  Fit model to k-1 parts &
calculate prediction error on kth
part
•  Non-overlapping dataset
Data Partition &
Cross-Validation
—  Goal

◦  Model Complexity (-)

◦  Variance (-)

◦  Prediction Accuracy (+)

Train	
   Validate	
   Test	
  
#2	
   #3	
   #4	
  
#5	
  
#1	
  
#2	
   #3	
   #5	
  
#4	
  
#1	
  
#2	
   #4	
   #5	
  
#3	
  
#1	
  
#3	
   #4	
   #5	
  
#2	
  
#1	
  
#3	
   #4	
   #5	
  
#1	
  
#2	
  
K-­‐fold	
  CV	
  (k=5)	
  
Train	
   Validate	
  
Bootstrap
•  Draw datasets (with replacement) and fit model for each dataset
•  Remember : Data Partitioning (#1) & Cross Validation (#2) are without
replacement
Bootstrap & Bagging
—  Goal

◦  Model Complexity (-)

◦  Variance (-)

◦  Prediction Accuracy (+)

Bagging (Bootstrap aggregation)
◦  Average prediction over a collection of
bootstrap-ed samples, thus reducing
variance
◦  “Output	
  of	
  weak	
  classifiers	
  into	
  a	
  powerful	
  commiSee”	
  
◦  Final	
  PredicHon	
  =	
  weighted	
  majority	
  vote	
  	
  
◦  Later	
  classifiers	
  get	
  misclassified	
  points	
  	
  
–  With	
  higher	
  weight,	
  	
  
–  So	
  they	
  are	
  forced	
  	
  
–  To	
  concentrate	
  on	
  them	
  
◦  AdaBoost	
  (AdapHveBoosting)	
  
◦  BoosHng	
  vs	
  Bagging	
  
–  Bagging	
  –	
  independent	
  trees	
  
–  BoosHng	
  –	
  successively	
  weighted	
  
Boosting
—  Goal

◦  Model Complexity (-)

◦  Variance (-)

◦  Prediction Accuracy (+)
◦  Builds	
  large	
  collecHon	
  of	
  de-­‐correlated	
  trees	
  &	
  averages	
  
them	
  
◦  Improves	
  Bagging	
  by	
  selecHng	
  i.i.d*	
  random	
  variables	
  for	
  
spli_ng	
  
◦  Simpler	
  to	
  train	
  &	
  tune	
  
◦  “Do	
  remarkably	
  well,	
  with	
  very	
  li6le	
  tuning	
  required”	
  –	
  ESLII	
  
◦  Less	
  suscepHble	
  to	
  over	
  fi_ng	
  (than	
  boosHng)	
  
◦  Many	
  RF	
  implementaHons	
  
–  Original	
  version	
  -­‐	
  Fortran-­‐77	
  !	
  By	
  Breiman/Cutler	
  
–  Python,	
  R,	
  Mahout,	
  Weka,	
  Milk	
  (ML	
  toolkit	
  for	
  py),	
  matlab	
  	
  
* i.i.d – independent identically distributed
+ http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm
Random Forests+
—  Goal

◦  Model Complexity (-)

◦  Variance (-)

◦  Prediction Accuracy (+)
Random Forests
o  While Boosting splits based on best among all variables, RF splits based on best among
randomly chosen variables
o  Simpler because it requires two variables – no. of Predictors (typically √k) & no. of trees
(500 for large dataset, 150 for smaller)
o  Error prediction
•  For each iteration, predict for dataset that is not in the sample (OOB data)
•  Aggregate OOB predictions
•  Calculate Prediction Error for the aggregate, which is basically the OOB
estimate of error rate
•  Can use this to search for optimal # of predictors
•  We will see how close this is to the actual error in the Heritage Health Prize
o  Assumes equal cost for mis-prediction. Can add a cost function
o  Proximity matrix & applications like adding missing data, dropping outliers
Ref: R News Vol 2/3, Dec 2002
Statistical Learning from a Regression Perspective : Berk
A Brief Overview of RF by Dan Steinberg
◦  Two	
  Step	
  
–  Develop	
  a	
  set	
  of	
  learners	
  
–  Combine	
  the	
  results	
  to	
  develop	
  a	
  composite	
  predictor	
  
◦  Ensemble	
  methods	
  can	
  take	
  the	
  form	
  of:	
  
–  Using	
  different	
  algorithms,	
  	
  
–  Using	
  the	
  same	
  algorithm	
  with	
  different	
  se_ngs	
  
–  Assigning	
  different	
  parts	
  of	
  the	
  dataset	
  to	
  different	
  classifiers	
  
◦  Bagging	
  &	
  Random	
  Forests	
  are	
  examples	
  of	
  ensemble	
  
method	
  	
  
Ref: Machine Learning In Action
Ensemble Methods
—  Goal

◦  Model Complexity (-)

◦  Variance (-)

◦  Prediction Accuracy (+)
Algorithms for the
Amateur Data Scientist
“A towel is about the most massively useful thing an interstellar hitchhiker can have … any
man who can hitch the length and breadth of the Galaxy, rough it … win through, and still
know where his towel is, is clearly a man to be reckoned with.”
- From The Hitchhiker's Guide to the Galaxy, by Douglas Adams.
Algorithms ! The Most Massively useful thing an Amateur Data Scientist can have …
2:30
Ref: Anthony’s Kaggle Presentation
Data Scientists apply different techniques
•  Support Vector Machine
•  adaBoost
•  Bayesian Networks
•  Decision Trees
•  Ensemble Methods
•  Random Forest
•  Logistic Regression
•  Genetic Algorithms
•  Monte Carlo Methods
•  Principal Component Analysis
•  Kalman Filter
•  Evolutionary Fuzzy Modelling
•  Neural Networks
Quora
•  http://www.quora.com/What-are-the-top-10-data-mining-or-machine-learning-algorithms
Algorithm spectrum
o  Regression
o  Logit
o  CART
o  Ensemble :
Random
Forest
o  Clustering
o  KNN
o  Genetic Alg
o  Simulated
Annealing	
  
o  Collab
Filtering
o  SVM
o  Kernels
o  SVD
o  NNet
o  Boltzman
Machine
o  Feature
Learning	
  
Machine	
  Learning	
   Cute	
  Math	
  
Ar?ficial	
  
Intelligence	
  
Classifying Classifiers
Statistical	
   Structural	
  
Regression	
   Naïve	
  
Bayes	
  
Bayesian	
  
Networks	
  
Rule-­‐based	
   Distance-­‐based	
  
Neural	
  
Networks	
  
Production	
  Rules	
   Decision	
  Trees	
  
Multi-­‐layer	
  
Perception	
  
Functional	
   Nearest	
  Neighbor	
  
Linear	
   Spectral	
  
Wavelet	
  
kNN	
   Learning	
  vector	
  
Quantization	
  
Ensemble	
  
Random	
  Forests	
  
Logistic	
  
Regression1	
  
SVM	
  Boosting	
  
1Max	
  Entropy	
  Classifier	
  	
  
Ref: Algorithms of the Intelligent Web, Marmanis & Babenko
Classifiers	
  
Regression	
  
Continuous
Variables
Categorical 
Variables
Decision	
  
Trees	
  
k-­‐NN(Nearest	
  
Neighbors)	
  
Bias

Variance

Model Complexity

Over-fitting

BoosHng	
  Bagging	
  
CART	
  
Model Evaluation &
Interpretation
Relevant Digression
3:10
2:50
Cross Validation
o Reference:
•  https://www.kaggle.com/wiki/
GettingStartedWithPythonForDataScience
•  Chris Clark ‘s blog :
http://blog.kaggle.com/2012/07/02/up-and-running-with-python-
my-first-kaggle-entry/
•  Predicive Modelling in py with scikit-learning, Olivier Grisel Strata
2013
•  titanic from pycon2014/parallelmaster/An introduction to Predictive
Modeling in Python
Refer	
  to	
  iPython	
  notebook	
  <2-­‐Model-­‐EvaluaHon>	
  	
  
at	
  hSps://github.com/xsankar/freezing-­‐bear	
  
Model Evaluation - Accuracy
o Accuracy =
o For cases where tn is large compared tp, a degenerate return(false) will be
very accurate !
o Hence the F-measure is a better reflection of the model strength
Predicted=1	
   Predicted=0	
  
Actual	
  =1	
   True+	
  (tp)	
   False-­‐	
  (fn)	
  
Actual=0	
   False+	
  (fp)	
   True-­‐	
  (tn)	
  
	
  	
  	
  	
  tp	
  +	
  tn	
  
tp+fp+fn+tn	
  
	
  
Model Evaluation – Precision & Recall
o  Precision = How many items we identified are relevant
o  Recall = How many relevant items did we identify
o  Inverse relationship – Tradeoff depends on situations
•  Legal – Coverage is important than correctness
•  Search – Accuracy is more important
•  Fraud
•  Support cost (high fp) vs. wrath of credit card co.(high fn)
Predicted=1	
   Predicted=0	
  
Actual=1	
   True	
  +ve	
  	
  -­‐	
  tp	
   False	
  -­‐ve	
  -­‐	
  fn	
  
Actual=0	
   False	
  +ve	
  	
  -­‐	
  fp	
   True	
  –ve	
  -­‐	
  tn	
  
	
  	
  	
  	
  tp	
  
tp+fp	
  
	
  
•  Precision	
  	
  
•  Accuracy	
  
•  Relevancy	
  
	
  	
  	
  	
  tp	
  
tp+fn	
  
	
  
•  Recall	
  	
  
•  True	
  +ve	
  Rate	
  
•  Coverage	
  
•  Sensitivity	
  
•  Hit	
  Rate	
  
http://nltk.googlecode.com/svn/trunk/doc/book/ch06.html	

	
  	
  	
  	
  fp	
  
fp+tn	
  
	
  
•  Type	
  1	
  Error	
  
Rate	
  
•  False	
  +ve	
  Rate	
  
•  False	
  Alarm	
  Rate	
  
•  Specificity	
  =	
  1	
  –	
  fp	
  rate	
  
•  Type	
  1	
  Error	
  =	
  fp	
  
•  Type	
  2	
  Error	
  =	
  fn	
  
Confusion Matrix
	
  
	
  
	
  
Actual	
  
Predicted	
  
C1	
   C2	
   C3	
   C4	
  
C1	
   10	
   5	
   9	
   3	
  
C2	
   4	
   20	
   3	
   7	
  
C3	
   6	
   4	
   13	
   3	
  
C4	
   2	
   1	
   4	
   15	
  
Correct	
  Ones	
  (cii)	
  
Precision	
  =	
  
Columns	
  
	
  	
  	
  	
  	
  	
  	
  	
  i	
  
cii	
  
cij	
  
Recall	
  =	
  
Rows	
  
	
  	
  	
  	
  	
  j	
  
	
  
cii	
  
cij	
  
Σ
Σ
Model Evaluation : F-Measure
Precision = tp / (tp+fp) : Recall = tp / (tp+fn)
F-Measure
Balanced, Combined, Weighted Harmonic Mean, measures effectiveness
Predicted=1	
   Predicted=0	
  
Actual=1	
   True+	
  (tp)	
   False-­‐	
  (fn)	
  
Actual=0	
   False+	
  (fp)	
   True-­‐	
  (tn)	
  
=	
  
β2	
  P	
  +	
  R	
  
Common Form (Balanced F1) : β=1 (α = ½ ) ; F1 = 2PR / P+R
+	
  (1	
  –	
  α)	
  α	
   1	
  
P	
  
1	
  
R	
  
1	
   (β2	
  +	
  1)PR	
  
Hands-on Walkthru - Model Evaluation
Train	
   Test	
  
712 (80%) 179
891
Refer	
  to	
  iPython	
  notebook	
  <2-­‐Model-­‐EvaluaHon>	
  	
  
at	
  hSps://github.com/xsankar/freezing-­‐bear	
  
ROC Analysis
o “How good is my model?”
o Good Reference : http://people.inf.elte.hu/kiss/13dwhdm/roc.pdf
o “A receiver operating characteristics (ROC) graph is a technique for visualizing,
organizing and selecting classifiers based on their performance”
o Much better than evaluating a model based on simple classification accuracy
o Plots tp rate vs. fp rate
o After understanding the ROC Graph, we will draw a few for our models in
iPython notebook <2-Model-Evaluation> at https://github.com/xsankar/
freezing-bear
ROC Graph - Discussion
o  E = Conservative, Everything
NO
o  H = Liberal, Everything YES
o Am not making any
political statement !
o  F = Ideal
o  G = Worst
o  The diagonal is the chance
o  North West Corner is good
o  South-East is bad
•  For example E
•  Believe it or Not - I have
actually seen a graph
with the curve in this
region !
E
F
G
H
ROC Graph – Clinical Example
Ifcc	
  :	
  Measures	
  of	
  diagnostic	
  accuracy:	
  basic	
  definitions	
  
ROC Graph Walk thru
o iPython notebook <2-Model-Evaluation> at https://github.com/xsankar/
freezing-bear
Data Science "Folk Knowledge

Mais conteúdo relacionado

Mais procurados

An excursion into Text Analytics with Apache Spark
An excursion into Text Analytics with Apache SparkAn excursion into Text Analytics with Apache Spark
An excursion into Text Analytics with Apache SparkKrishna Sankar
 
The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012OSCON Byrum
 
Architecture in action 01
Architecture in action 01Architecture in action 01
Architecture in action 01Krishna Sankar
 
Using the search engine as recommendation engine
Using the search engine as recommendation engineUsing the search engine as recommendation engine
Using the search engine as recommendation engineLars Marius Garshol
 
2015 data-science-salary-survey
2015 data-science-salary-survey2015 data-science-salary-survey
2015 data-science-salary-surveyAdam Rabinovitch
 
Data Science in Future Tense
Data Science in Future TenseData Science in Future Tense
Data Science in Future TensePaco Nathan
 
Information Visualization for Knowledge Discovery: An Introduction
Information Visualization for Knowledge Discovery: An IntroductionInformation Visualization for Knowledge Discovery: An Introduction
Information Visualization for Knowledge Discovery: An IntroductionKrist Wongsuphasawat
 
Data Science Provenance: From Drug Discovery to Fake Fans
Data Science Provenance: From Drug Discovery to Fake FansData Science Provenance: From Drug Discovery to Fake Fans
Data Science Provenance: From Drug Discovery to Fake FansJameel Syed
 
Sql saturday el salvador 2016 - Me, A Data Scientist?
Sql saturday el salvador 2016 - Me, A Data Scientist?Sql saturday el salvador 2016 - Me, A Data Scientist?
Sql saturday el salvador 2016 - Me, A Data Scientist?Fabricio Quintanilla
 
Hadoop and Machine Learning
Hadoop and Machine LearningHadoop and Machine Learning
Hadoop and Machine Learningjoshwills
 
Combining Data Mining and Machine Learning for Effective User Profiling
Combining Data Mining and Machine Learning for Effective User ProfilingCombining Data Mining and Machine Learning for Effective User Profiling
Combining Data Mining and Machine Learning for Effective User ProfilingCodePolitan
 
Training in Analytics and Data Science
Training in Analytics and Data ScienceTraining in Analytics and Data Science
Training in Analytics and Data ScienceAjay Ohri
 
GalvanizeU Seattle: Eleven Almost-Truisms About Data
GalvanizeU Seattle: Eleven Almost-Truisms About DataGalvanizeU Seattle: Eleven Almost-Truisms About Data
GalvanizeU Seattle: Eleven Almost-Truisms About DataPaco Nathan
 
What is Big Data?
What is Big Data?What is Big Data?
What is Big Data?CodePolitan
 
Data Science in 2016: Moving Up
Data Science in 2016: Moving UpData Science in 2016: Moving Up
Data Science in 2016: Moving UpPaco Nathan
 
EDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko GrobelnikEDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko GrobelnikEuropean Data Forum
 
PyData 2015 Keynote: "A Systems View of Machine Learning"
PyData 2015 Keynote: "A Systems View of Machine Learning" PyData 2015 Keynote: "A Systems View of Machine Learning"
PyData 2015 Keynote: "A Systems View of Machine Learning" Joshua Bloom
 
Intro to Machine Learning
Intro to Machine LearningIntro to Machine Learning
Intro to Machine LearningCorey Chivers
 

Mais procurados (20)

An excursion into Text Analytics with Apache Spark
An excursion into Text Analytics with Apache SparkAn excursion into Text Analytics with Apache Spark
An excursion into Text Analytics with Apache Spark
 
The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012
 
Architecture in action 01
Architecture in action 01Architecture in action 01
Architecture in action 01
 
Using the search engine as recommendation engine
Using the search engine as recommendation engineUsing the search engine as recommendation engine
Using the search engine as recommendation engine
 
2015 data-science-salary-survey
2015 data-science-salary-survey2015 data-science-salary-survey
2015 data-science-salary-survey
 
Data Science in Future Tense
Data Science in Future TenseData Science in Future Tense
Data Science in Future Tense
 
Analyzing social media with Python and other tools (4/4)
Analyzing social media with Python and other tools (4/4) Analyzing social media with Python and other tools (4/4)
Analyzing social media with Python and other tools (4/4)
 
Information Visualization for Knowledge Discovery: An Introduction
Information Visualization for Knowledge Discovery: An IntroductionInformation Visualization for Knowledge Discovery: An Introduction
Information Visualization for Knowledge Discovery: An Introduction
 
Data Science Provenance: From Drug Discovery to Fake Fans
Data Science Provenance: From Drug Discovery to Fake FansData Science Provenance: From Drug Discovery to Fake Fans
Data Science Provenance: From Drug Discovery to Fake Fans
 
Sql saturday el salvador 2016 - Me, A Data Scientist?
Sql saturday el salvador 2016 - Me, A Data Scientist?Sql saturday el salvador 2016 - Me, A Data Scientist?
Sql saturday el salvador 2016 - Me, A Data Scientist?
 
Hadoop and Machine Learning
Hadoop and Machine LearningHadoop and Machine Learning
Hadoop and Machine Learning
 
Combining Data Mining and Machine Learning for Effective User Profiling
Combining Data Mining and Machine Learning for Effective User ProfilingCombining Data Mining and Machine Learning for Effective User Profiling
Combining Data Mining and Machine Learning for Effective User Profiling
 
Training in Analytics and Data Science
Training in Analytics and Data ScienceTraining in Analytics and Data Science
Training in Analytics and Data Science
 
GalvanizeU Seattle: Eleven Almost-Truisms About Data
GalvanizeU Seattle: Eleven Almost-Truisms About DataGalvanizeU Seattle: Eleven Almost-Truisms About Data
GalvanizeU Seattle: Eleven Almost-Truisms About Data
 
What is Big Data?
What is Big Data?What is Big Data?
What is Big Data?
 
Data Science in 2016: Moving Up
Data Science in 2016: Moving UpData Science in 2016: Moving Up
Data Science in 2016: Moving Up
 
EDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko GrobelnikEDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko Grobelnik
 
PyData 2015 Keynote: "A Systems View of Machine Learning"
PyData 2015 Keynote: "A Systems View of Machine Learning" PyData 2015 Keynote: "A Systems View of Machine Learning"
PyData 2015 Keynote: "A Systems View of Machine Learning"
 
李育杰/The Growth of a Data Scientist
李育杰/The Growth of a Data Scientist李育杰/The Growth of a Data Scientist
李育杰/The Growth of a Data Scientist
 
Intro to Machine Learning
Intro to Machine LearningIntro to Machine Learning
Intro to Machine Learning
 

Semelhante a Data Science "Folk Knowledge

Module 1 introduction to machine learning
Module 1  introduction to machine learningModule 1  introduction to machine learning
Module 1 introduction to machine learningSara Hooker
 
Research Data Management
Research Data ManagementResearch Data Management
Research Data ManagementSarah Jones
 
Getting to Know Your Data with R
Getting to Know Your Data with RGetting to Know Your Data with R
Getting to Know Your Data with RStephen Withington
 
Data Science & AI Road Map by Python & Computer science tutor in Malaysia
Data Science  & AI Road Map by Python & Computer science tutor in MalaysiaData Science  & AI Road Map by Python & Computer science tutor in Malaysia
Data Science & AI Road Map by Python & Computer science tutor in MalaysiaAhmed Elmalla
 
Barga Data Science lecture 2
Barga Data Science lecture 2Barga Data Science lecture 2
Barga Data Science lecture 2Roger Barga
 
Unit 1-Data Science Process Overview.pptx
Unit 1-Data Science Process Overview.pptxUnit 1-Data Science Process Overview.pptx
Unit 1-Data Science Process Overview.pptxAnusuya123
 
Data science presentation
Data science presentationData science presentation
Data science presentationMSDEVMTL
 
Data Communities - reusable data in and outside your organization.
Data Communities - reusable data in and outside your organization.Data Communities - reusable data in and outside your organization.
Data Communities - reusable data in and outside your organization.Paul Groth
 
Machine Learning for Data Extraction
Machine Learning for Data ExtractionMachine Learning for Data Extraction
Machine Learning for Data ExtractionDasha Herrmannova
 
Data science for advanced dummies
Data science for advanced dummiesData science for advanced dummies
Data science for advanced dummiesSaurav Chakravorty
 
Data science.chapter-1,2,3
Data science.chapter-1,2,3Data science.chapter-1,2,3
Data science.chapter-1,2,3varshakumar21
 
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...tboubez
 
Fortune Teller API - Doing Data Science with Apache Spark
Fortune Teller API - Doing Data Science with Apache SparkFortune Teller API - Doing Data Science with Apache Spark
Fortune Teller API - Doing Data Science with Apache SparkBas Geerdink
 
Ai4life aiml-xops-sig
Ai4life aiml-xops-sigAi4life aiml-xops-sig
Ai4life aiml-xops-sigmadhucharis
 

Semelhante a Data Science "Folk Knowledge (20)

Module 1 introduction to machine learning
Module 1  introduction to machine learningModule 1  introduction to machine learning
Module 1 introduction to machine learning
 
Research Data Management
Research Data ManagementResearch Data Management
Research Data Management
 
Getting to Know Your Data with R
Getting to Know Your Data with RGetting to Know Your Data with R
Getting to Know Your Data with R
 
Data Science & AI Road Map by Python & Computer science tutor in Malaysia
Data Science  & AI Road Map by Python & Computer science tutor in MalaysiaData Science  & AI Road Map by Python & Computer science tutor in Malaysia
Data Science & AI Road Map by Python & Computer science tutor in Malaysia
 
Barga Data Science lecture 2
Barga Data Science lecture 2Barga Data Science lecture 2
Barga Data Science lecture 2
 
Unit 1-Data Science Process Overview.pptx
Unit 1-Data Science Process Overview.pptxUnit 1-Data Science Process Overview.pptx
Unit 1-Data Science Process Overview.pptx
 
Turning Information chaos into reliable data
Turning Information chaos into reliable dataTurning Information chaos into reliable data
Turning Information chaos into reliable data
 
Data science presentation
Data science presentationData science presentation
Data science presentation
 
Data Communities - reusable data in and outside your organization.
Data Communities - reusable data in and outside your organization.Data Communities - reusable data in and outside your organization.
Data Communities - reusable data in and outside your organization.
 
Machine Learning for Data Extraction
Machine Learning for Data ExtractionMachine Learning for Data Extraction
Machine Learning for Data Extraction
 
Introduction to data science
Introduction to data scienceIntroduction to data science
Introduction to data science
 
Data science for advanced dummies
Data science for advanced dummiesData science for advanced dummies
Data science for advanced dummies
 
Data science.chapter-1,2,3
Data science.chapter-1,2,3Data science.chapter-1,2,3
Data science.chapter-1,2,3
 
Debugging machine-learning
Debugging machine-learningDebugging machine-learning
Debugging machine-learning
 
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
 
Fortune Teller API - Doing Data Science with Apache Spark
Fortune Teller API - Doing Data Science with Apache SparkFortune Teller API - Doing Data Science with Apache Spark
Fortune Teller API - Doing Data Science with Apache Spark
 
Data science unit1
Data science unit1Data science unit1
Data science unit1
 
Ai4life aiml-xops-sig
Ai4life aiml-xops-sigAi4life aiml-xops-sig
Ai4life aiml-xops-sig
 
ML.ppt
ML.pptML.ppt
ML.ppt
 
ML.ppt
ML.pptML.ppt
ML.ppt
 

Mais de Krishna Sankar

An excursion into Graph Analytics with Apache Spark GraphX
An excursion into Graph Analytics with Apache Spark GraphXAn excursion into Graph Analytics with Apache Spark GraphX
An excursion into Graph Analytics with Apache Spark GraphXKrishna Sankar
 
Data Science with Spark
Data Science with SparkData Science with Spark
Data Science with SparkKrishna Sankar
 
Data Wrangling For Kaggle Data Science Competitions
Data Wrangling For Kaggle Data Science CompetitionsData Wrangling For Kaggle Data Science Competitions
Data Wrangling For Kaggle Data Science CompetitionsKrishna Sankar
 
Bayesian Machine Learning - Naive Bayes
Bayesian Machine Learning - Naive BayesBayesian Machine Learning - Naive Bayes
Bayesian Machine Learning - Naive BayesKrishna Sankar
 
AWS VPC distilled for MongoDB devOps
AWS VPC distilled for MongoDB devOpsAWS VPC distilled for MongoDB devOps
AWS VPC distilled for MongoDB devOpsKrishna Sankar
 
Big Data Engineering - Top 10 Pragmatics
Big Data Engineering - Top 10 PragmaticsBig Data Engineering - Top 10 Pragmatics
Big Data Engineering - Top 10 PragmaticsKrishna Sankar
 
Scrum debrief to team
Scrum debrief to team Scrum debrief to team
Scrum debrief to team Krishna Sankar
 
Precision Time Synchronization
Precision Time SynchronizationPrecision Time Synchronization
Precision Time SynchronizationKrishna Sankar
 
The Hitchhiker’s Guide to Kaggle
The Hitchhiker’s Guide to KaggleThe Hitchhiker’s Guide to Kaggle
The Hitchhiker’s Guide to KaggleKrishna Sankar
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04Krishna Sankar
 
Cloud Interoperability Demo at OGF29
Cloud Interoperability Demo at OGF29Cloud Interoperability Demo at OGF29
Cloud Interoperability Demo at OGF29Krishna Sankar
 
A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0Krishna Sankar
 

Mais de Krishna Sankar (13)

An excursion into Graph Analytics with Apache Spark GraphX
An excursion into Graph Analytics with Apache Spark GraphXAn excursion into Graph Analytics with Apache Spark GraphX
An excursion into Graph Analytics with Apache Spark GraphX
 
Data Science with Spark
Data Science with SparkData Science with Spark
Data Science with Spark
 
Data Wrangling For Kaggle Data Science Competitions
Data Wrangling For Kaggle Data Science CompetitionsData Wrangling For Kaggle Data Science Competitions
Data Wrangling For Kaggle Data Science Competitions
 
Bayesian Machine Learning - Naive Bayes
Bayesian Machine Learning - Naive BayesBayesian Machine Learning - Naive Bayes
Bayesian Machine Learning - Naive Bayes
 
AWS VPC distilled for MongoDB devOps
AWS VPC distilled for MongoDB devOpsAWS VPC distilled for MongoDB devOps
AWS VPC distilled for MongoDB devOps
 
Big Data Engineering - Top 10 Pragmatics
Big Data Engineering - Top 10 PragmaticsBig Data Engineering - Top 10 Pragmatics
Big Data Engineering - Top 10 Pragmatics
 
Scrum debrief to team
Scrum debrief to team Scrum debrief to team
Scrum debrief to team
 
The Art of Big Data
The Art of Big DataThe Art of Big Data
The Art of Big Data
 
Precision Time Synchronization
Precision Time SynchronizationPrecision Time Synchronization
Precision Time Synchronization
 
The Hitchhiker’s Guide to Kaggle
The Hitchhiker’s Guide to KaggleThe Hitchhiker’s Guide to Kaggle
The Hitchhiker’s Guide to Kaggle
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04
 
Cloud Interoperability Demo at OGF29
Cloud Interoperability Demo at OGF29Cloud Interoperability Demo at OGF29
Cloud Interoperability Demo at OGF29
 
A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0A Hitchhiker's Guide to NOSQL v1.0
A Hitchhiker's Guide to NOSQL v1.0
 

Último

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Data Science "Folk Knowledge

  • 1. Data Science “folk knowledge” Krishna Sankar @ksankar https://www.linkedin.com/in/ksankar
  • 2. Data Science “folk knowledge” (1 of A) o  "If you torture the data long enough, it will confess to anything." – Hal Varian, Computer Mediated Transactions o  Learning = Representation + Evaluation + Optimization o  It’s Generalization that counts •  The fundamental goal of machine learning is to generalize beyond the examples in the training set o  Data alone is not enough •  Induction not deduction - Every learner should embody some knowledge or assumptions beyond the data it is given in order to generalize beyond it o  Machine Learning is not magic – one cannot get something from nothing •  In order to infer, one needs the knobs & the dials •  One also needs a rich expressive dataset A few useful things to know about machine learning - by Pedro Domingos http://dl.acm.org/citation.cfm?id=2347755
  • 3. Data Science “folk knowledge” (2 of A) o  Over fitting has many faces •  Bias – Model not strong enough. So the learner has the tendency to learn the same wrong things •  Variance – Learning too much from one dataset; model will fall apart (ie much less accurate) on a different dataset •  Sampling Bias o  Intuition Fails in high Dimensions –Bellman •  Blessing of non-conformity & lower effective dimension; many applications have examples not uniformly spread but concentrated near a lower dimensional manifold eg. Space of digits is much smaller then the space of images o  Theoretical Guarantees are not What they seem •  One of the major developments o f recent decades has been the realization that we can have guarantees on the results of induction, particularly if we are willing to settle for probabilistic guarantees. o  Feature engineering is the Key A few useful things to know about machine learning - by Pedro Domingos http://dl.acm.org/citation.cfm?id=2347755
  • 4. Data Science “folk knowledge” (3 of A) o  More Data Beats a Cleverer Algorithm •  Or conversely select algorithms that improve with data •  Don’t optimize prematurely without getting more data o  Learn many models, not Just One •  Ensembles ! – Change the hypothesis space •  Netflix prize •  E.g. Bagging, Boosting, Stacking o  Simplicity Does not necessarily imply Accuracy o  Representable Does not imply Learnable •  Just because a function can be represented does not mean it can be learned o  Correlation Does not imply Causation o  http://doubleclix.wordpress.com/2014/03/07/a-glimpse-of-google-nasa-peter-norvig/ o  A few useful things to know about machine learning - by Pedro Domingos §  http://dl.acm.org/citation.cfm?id=2347755
  • 5. Data Science “folk knowledge” (4 of A) o  The simplest hypothesis that fits the data is also the most plausible •  Occam’s Razor •  Don’t go for a 4 layer Neural Network unless you have that complex data •  But that doesn’t also mean that one should choose the simplest hypothesis •  Match the impedance of the domain, data & the algorithms o  Think of over fitting as memorizing as opposed to learning. o  Data leakage has many forms o  Sometimes the Absence of Something is Everything o  [Corollary] Absence of Evidence is not the Evidence of Absence §  Simple  Model   §  High  Error  line  that  cannot  be   compensated  with  more  data   §  Gets  to  a  lower  error  rate  with  less  data   points   §  Complex  Model   §  Lower  Error  Line   §  But  needs  more  data  points  to  reach   decent  error     New to Machine Learning? Avoid these three mistakes, James Faghmous https://medium.com/about-data/73258b3848a4Ref: Andrew Ng/Stanford, Yaser S./CalTech
  • 6. Check your assumptions o  The decisions a model makes, is directly related to the it’s assumptions about the statistical distribution of the underlying data o  For example, for regression one should check that: ① Variables are normally distributed •  Test for normality via visual inspection, skew & kurtosis, outlier inspections via plots, z-scores et al ② There is a linear relationship between the dependent & independent variables •  Inspect residual plots, try quadratic relationships, try log plots et al ③ Variables are measured without error ④ Assumption of Homoscedasticity §  Homoscedasticity assumes constant or near constant error variance §  Check the standard residual plots and look for heteroscedasticity §  For example in the figure, left box has the errors scattered randomly around zero; while the right two diagrams have the errors unevenly distributed Jason W. Osborne and Elaine Waters, Four assumptions of multiple regression that researchers should always test, http://pareonline.net/getvn.asp?v=8&n=2
  • 7. Data Science “folk knowledge” (5 of A) Donald Rumsfeld is an armchair Data Scientist ! http://smartorg.com/2013/07/valuepoint19/ The World Knowns             Unknowns   You UnKnown   Known   o  Others  know,  you  don’t   o  What  we  do   o  Facts,  outcomes  or   scenarios  we  have  not   encountered,  nor   considered   o  “Black  swans”,  outliers,   long  tails  of  probability   distribuHons   o  Lack  of  experience,   imaginaHon   o  PotenHal  facts,   outcomes  we   are  aware,  but   not    with   certainty   o  StochasHc   processes,   ProbabiliHes   o  Known Knowns o  There are things we know that we know o  Known Unknowns o  That is to say, there are things that we now know we don't know o  But there are also Unknown Unknowns o  There are things we do not know we don't know
  • 8. Data Science “folk knowledge” (6 of A) - Pipeline o  Scalable  Model   Deployment   o  Big  Data   automation  &   purpose  built   appliances  (soft/ hard)   o  Manage  SLAs  &   response  times   o  Volume   o  Velocity   o  Streaming  Data   o  Canonical  form   o  Data  catalog   o  Data  Fabric  across  the   organization   o  Access  to  multiple   sources  of  data     o  Think  Hybrid  –  Big  Data   Apps,  Appliances  &   Infrastructure   Collect Store Transform o  Metadata   o  Monitor  counters  &   Metrics   o  Structured  vs.  Multi-­‐ structured   o  Flexible  &  Selectable   §  Data  Subsets     §  Attribute  sets   o  Refine  model  with   §  Extended  Data   subsets   §  Engineered   Attribute  sets   o  Validation  run  across  a   larger  data  set   Reason Model Deploy Data Management Data Science o  Dynamic  Data  Sets   o  2  way  key-­‐value  tagging  of   datasets   o  Extended  attribute  sets   o  Advanced  Analytics   ExploreVisualize Recommend Predict o  Performance   o  Scalability   o  Refresh  Latency   o  In-­‐memory  Analytics   o  Advanced  Visualization   o  Interactive  Dashboards   o  Map  Overlay   o  Infographics   ¤  Bytes to Business a.k.a. Build the full stack ¤  Find Relevant Data For Business ¤  Connect the Dots
  • 9. Volume Velocity Variety Data Science “folk knowledge” (7 of A) Context Connect edness Intelligence Interface Inference “Data of unusual size” that can't be brute forced o  Three Amigos o  Interface = Cognition o  Intelligence = Compute(CPU) & Computational(GPU) o  Infer Significance & Causality
  • 10. Data Science “folk knowledge” (8 of A) Jeremy’s Axioms o  Iteratively explore data o  Tools •  Excel Format, Perl, Perl Book o  Get your head around data •  Pivot Table o  Don’t over-complicate o  If people give you data, don’t assume that you need to use all of it o  Look at pictures ! o  History of your submissions – keep a tab o  Don’t be afraid to submit simple solutions •  We will do this during this workshop Ref: http://blog.kaggle.com/2011/03/23/getting-in-shape-for-the-sport-of-data-sciencetalk-by-jeremy-howard/
  • 11. Data Science “folk knowledge” (9 of A) ①  Common Sense (some features make more sense then others) ②  Carefully read these forums to get a peak at other peoples’ mindset ③  Visualizations ④  Train a classifier (e.g. logistic regression) and look at the feature weights ⑤  Train a decision tree and visualize it ⑥  Cluster the data and look at what clusters you get out ⑦  Just look at the raw data ⑧  Train a simple classifier, see what mistakes it makes ⑨  Write a classifier using handwritten rules ⑩  Pick a fancy method that you want to apply (Deep Learning/Nnet) -- Maarten Bosma -- http://www.kaggle.com/c/stumbleupon/forums/t/5761/methods-for-getting-a-first-overview-over-the-data
  • 12. Data Science “folk knowledge” (A of A) Lessons from Kaggle Winners ①  Don’t over-fit ②  All predictors are not needed •  All data rows are not needed, either ③  Tuning the algorithms will give different results ④  Reduce the dataset (Average, select transition data,…) ⑤  Test set & training set can differ ⑥  Iteratively explore & get your head around data ⑦  Don’t be afraid to submit simple solutions ⑧  Keep a tab & history your submissions
  • 13. The curious case of the Data Scientist o Data Scientist is multi-faceted & Contextual o Data Scientist should be building Data Products o Data Scientist should tell a story Data Scientist (noun): Person who is better at statistics than any software engineer & better at software engineering than any statistician – Josh Wills (Cloudera) Data Scientist (noun): Person who is worse at statistics than any statistician & worse at software engineering than any software engineer – Will Cukierski (Kaggle) http://doubleclix.wordpress.com/2014/01/25/the-curious-case-of-the-data-scientist-profession/ Large is hard; Infinite is much easier ! – Titus Brown
  • 14. Essential Reading List o  A few useful things to know about machine learning - by Pedro Domingos •  http://dl.acm.org/citation.cfm?id=2347755 o  The Lack of A Priori Distinctions Between Learning Algorithms by David H. Wolpert •  http://mpdc.mae.cornell.edu/Courses/MAE714/Papers/ lack_of_a_priori_distinctions_wolpert.pdf o  http://www.no-free-lunch.org/ o  Controlling the false discovery rate: a practical and powerful approach to multiple testing Benjamini, Y. and Hochberg, Y. C •  http://www.stat.purdue.edu/~‾doerge/BIOINFORM.D/FALL06/Benjamini%20and%20Y %20FDR.pdf o  A Glimpse of Googl, NASA,Peter Norvig + The Restaurant at the End of the Universe •  http://doubleclix.wordpress.com/2014/03/07/a-glimpse-of-google-nasa-peter-norvig/ o  Avoid these three mistakes, James Faghmo •  https://medium.com/about-data/73258b3848a4 o  Leakage in Data Mining: Formulation, Detection, and Avoidance •  http://www.cs.umb.edu/~‾ding/history/470_670_fall_2011/papers/ cs670_Tran_PreferredPaper_LeakingInDataMining.pdf
  • 15. For your reading & viewing pleasure … An ordered List ①  An Introduction to Statistical Learning •  http://www-bcf.usc.edu/~‾gareth/ISL/ ②  ISL Class Stanford/Hastie/Tibsharani at their best - Statistical Learning •  http://online.stanford.edu/course/statistical-learning-winter-2014 ③  Prof. Pedro Domingo •  https://class.coursera.org/machlearning-001/lecture/preview ④  Prof. Andrew Ng •  https://class.coursera.org/ml-003/lecture/preview ⑤  Prof. Abu Mostafa, CaltechX: CS1156x: Learning From Data •  https://www.edx.org/course/caltechx/caltechx-cs1156x-learning-data-1120 ⑥  Mathematicalmonk @ YouTube •  https://www.youtube.com/playlist?list=PLD0F06AA0D2E8FFBA ⑦  The Elements Of Statistical Learning •  http://statweb.stanford.edu/~‾tibs/ElemStatLearn/ http://www.quora.com/Machine-Learning/Whats-the-easiest-way-to-learn-machine-learning/
  • 17. What does it mean ? Let us ponder …. o  We have a training data set representing a domain •  We reason over the dataset & develop a model to predict outcomes o  How good is our prediction when it comes to real life scenarios ? o  The assumption is that the dataset is taken at random •  Or Is it ? Is there a Sampling Bias ? •  i.i.d ? Independent ? Identically Distributed ? •  What about homoscedasticity ? Do they have the same finite variance ? o  Can we assure that another dataset (from the same domain) will give us the same result ? o  Will our model & it’s parameters remain the same if we get another data set ? o  How can we evaluate our model ? o  How can we select the right parameters for a selected model ?
  • 18. Bias/Variance (1 of 2) o Model Complexity •  Complex Model increases the training data fit •  But then it overfits & doesn't perform as well with real data o  Bias vs. Variance o  Classical diagram o  From ELSII, By Hastie, Tibshirani & Friedman o  Bias – Model learns wrong things; not complex enough; error gap small; more data by itself won’t help o  Variance – Different dataset will give different error rate; over fitted model; larger error gap; more data could help Prediction Error Training Error Ref: Andrew Ng/Stanford, Yaser S./CalTech Learning Curve
  • 19. Bias/Variance (2 of 2) o High Bias •  Due to Underfitting •  Add more features •  More sophisticated model •  Quadratic Terms, complex equations,… •  Decrease regularization o High Variance •  Due to Overfitting •  Use fewer features •  Use more training sample •  Increase Regularization Prediction Error Training Error Ref: Strata 2013 Tutorial by Olivier Grisel Learning Curve Need  more  features  or  more   complex  model  to  improve   Need  more  data  to  improve  
  • 20. Partition Data ! •  Training (60%) •  Validation(20%) & •  “Vault” Test (20%) Data sets k-fold Cross-Validation •  Split data into k equal parts •  Fit model to k-1 parts & calculate prediction error on kth part •  Non-overlapping dataset Data Partition & Cross-Validation —  Goal ◦  Model Complexity (-) ◦  Variance (-) ◦  Prediction Accuracy (+) Train   Validate   Test   #2   #3   #4   #5   #1   #2   #3   #5   #4   #1   #2   #4   #5   #3   #1   #3   #4   #5   #2   #1   #3   #4   #5   #1   #2   K-­‐fold  CV  (k=5)   Train   Validate  
  • 21. Bootstrap •  Draw datasets (with replacement) and fit model for each dataset •  Remember : Data Partitioning (#1) & Cross Validation (#2) are without replacement Bootstrap & Bagging —  Goal ◦  Model Complexity (-) ◦  Variance (-) ◦  Prediction Accuracy (+) Bagging (Bootstrap aggregation) ◦  Average prediction over a collection of bootstrap-ed samples, thus reducing variance
  • 22. ◦  “Output  of  weak  classifiers  into  a  powerful  commiSee”   ◦  Final  PredicHon  =  weighted  majority  vote     ◦  Later  classifiers  get  misclassified  points     –  With  higher  weight,     –  So  they  are  forced     –  To  concentrate  on  them   ◦  AdaBoost  (AdapHveBoosting)   ◦  BoosHng  vs  Bagging   –  Bagging  –  independent  trees   –  BoosHng  –  successively  weighted   Boosting —  Goal ◦  Model Complexity (-) ◦  Variance (-) ◦  Prediction Accuracy (+)
  • 23. ◦  Builds  large  collecHon  of  de-­‐correlated  trees  &  averages   them   ◦  Improves  Bagging  by  selecHng  i.i.d*  random  variables  for   spli_ng   ◦  Simpler  to  train  &  tune   ◦  “Do  remarkably  well,  with  very  li6le  tuning  required”  –  ESLII   ◦  Less  suscepHble  to  over  fi_ng  (than  boosHng)   ◦  Many  RF  implementaHons   –  Original  version  -­‐  Fortran-­‐77  !  By  Breiman/Cutler   –  Python,  R,  Mahout,  Weka,  Milk  (ML  toolkit  for  py),  matlab     * i.i.d – independent identically distributed + http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm Random Forests+ —  Goal ◦  Model Complexity (-) ◦  Variance (-) ◦  Prediction Accuracy (+)
  • 24. Random Forests o  While Boosting splits based on best among all variables, RF splits based on best among randomly chosen variables o  Simpler because it requires two variables – no. of Predictors (typically √k) & no. of trees (500 for large dataset, 150 for smaller) o  Error prediction •  For each iteration, predict for dataset that is not in the sample (OOB data) •  Aggregate OOB predictions •  Calculate Prediction Error for the aggregate, which is basically the OOB estimate of error rate •  Can use this to search for optimal # of predictors •  We will see how close this is to the actual error in the Heritage Health Prize o  Assumes equal cost for mis-prediction. Can add a cost function o  Proximity matrix & applications like adding missing data, dropping outliers Ref: R News Vol 2/3, Dec 2002 Statistical Learning from a Regression Perspective : Berk A Brief Overview of RF by Dan Steinberg
  • 25. ◦  Two  Step   –  Develop  a  set  of  learners   –  Combine  the  results  to  develop  a  composite  predictor   ◦  Ensemble  methods  can  take  the  form  of:   –  Using  different  algorithms,     –  Using  the  same  algorithm  with  different  se_ngs   –  Assigning  different  parts  of  the  dataset  to  different  classifiers   ◦  Bagging  &  Random  Forests  are  examples  of  ensemble   method     Ref: Machine Learning In Action Ensemble Methods —  Goal ◦  Model Complexity (-) ◦  Variance (-) ◦  Prediction Accuracy (+)
  • 26. Algorithms for the Amateur Data Scientist “A towel is about the most massively useful thing an interstellar hitchhiker can have … any man who can hitch the length and breadth of the Galaxy, rough it … win through, and still know where his towel is, is clearly a man to be reckoned with.” - From The Hitchhiker's Guide to the Galaxy, by Douglas Adams. Algorithms ! The Most Massively useful thing an Amateur Data Scientist can have … 2:30
  • 27. Ref: Anthony’s Kaggle Presentation Data Scientists apply different techniques •  Support Vector Machine •  adaBoost •  Bayesian Networks •  Decision Trees •  Ensemble Methods •  Random Forest •  Logistic Regression •  Genetic Algorithms •  Monte Carlo Methods •  Principal Component Analysis •  Kalman Filter •  Evolutionary Fuzzy Modelling •  Neural Networks Quora •  http://www.quora.com/What-are-the-top-10-data-mining-or-machine-learning-algorithms
  • 28. Algorithm spectrum o  Regression o  Logit o  CART o  Ensemble : Random Forest o  Clustering o  KNN o  Genetic Alg o  Simulated Annealing   o  Collab Filtering o  SVM o  Kernels o  SVD o  NNet o  Boltzman Machine o  Feature Learning   Machine  Learning   Cute  Math   Ar?ficial   Intelligence  
  • 29. Classifying Classifiers Statistical   Structural   Regression   Naïve   Bayes   Bayesian   Networks   Rule-­‐based   Distance-­‐based   Neural   Networks   Production  Rules   Decision  Trees   Multi-­‐layer   Perception   Functional   Nearest  Neighbor   Linear   Spectral   Wavelet   kNN   Learning  vector   Quantization   Ensemble   Random  Forests   Logistic   Regression1   SVM  Boosting   1Max  Entropy  Classifier     Ref: Algorithms of the Intelligent Web, Marmanis & Babenko
  • 30. Classifiers   Regression   Continuous Variables Categorical Variables Decision   Trees   k-­‐NN(Nearest   Neighbors)   Bias Variance Model Complexity Over-fitting BoosHng  Bagging   CART  
  • 32. Cross Validation o Reference: •  https://www.kaggle.com/wiki/ GettingStartedWithPythonForDataScience •  Chris Clark ‘s blog : http://blog.kaggle.com/2012/07/02/up-and-running-with-python- my-first-kaggle-entry/ •  Predicive Modelling in py with scikit-learning, Olivier Grisel Strata 2013 •  titanic from pycon2014/parallelmaster/An introduction to Predictive Modeling in Python Refer  to  iPython  notebook  <2-­‐Model-­‐EvaluaHon>     at  hSps://github.com/xsankar/freezing-­‐bear  
  • 33. Model Evaluation - Accuracy o Accuracy = o For cases where tn is large compared tp, a degenerate return(false) will be very accurate ! o Hence the F-measure is a better reflection of the model strength Predicted=1   Predicted=0   Actual  =1   True+  (tp)   False-­‐  (fn)   Actual=0   False+  (fp)   True-­‐  (tn)          tp  +  tn   tp+fp+fn+tn    
  • 34. Model Evaluation – Precision & Recall o  Precision = How many items we identified are relevant o  Recall = How many relevant items did we identify o  Inverse relationship – Tradeoff depends on situations •  Legal – Coverage is important than correctness •  Search – Accuracy is more important •  Fraud •  Support cost (high fp) vs. wrath of credit card co.(high fn) Predicted=1   Predicted=0   Actual=1   True  +ve    -­‐  tp   False  -­‐ve  -­‐  fn   Actual=0   False  +ve    -­‐  fp   True  –ve  -­‐  tn          tp   tp+fp     •  Precision     •  Accuracy   •  Relevancy          tp   tp+fn     •  Recall     •  True  +ve  Rate   •  Coverage   •  Sensitivity   •  Hit  Rate   http://nltk.googlecode.com/svn/trunk/doc/book/ch06.html        fp   fp+tn     •  Type  1  Error   Rate   •  False  +ve  Rate   •  False  Alarm  Rate   •  Specificity  =  1  –  fp  rate   •  Type  1  Error  =  fp   •  Type  2  Error  =  fn  
  • 35. Confusion Matrix       Actual   Predicted   C1   C2   C3   C4   C1   10   5   9   3   C2   4   20   3   7   C3   6   4   13   3   C4   2   1   4   15   Correct  Ones  (cii)   Precision  =   Columns                  i   cii   cij   Recall  =   Rows            j     cii   cij   Σ Σ
  • 36. Model Evaluation : F-Measure Precision = tp / (tp+fp) : Recall = tp / (tp+fn) F-Measure Balanced, Combined, Weighted Harmonic Mean, measures effectiveness Predicted=1   Predicted=0   Actual=1   True+  (tp)   False-­‐  (fn)   Actual=0   False+  (fp)   True-­‐  (tn)   =   β2  P  +  R   Common Form (Balanced F1) : β=1 (α = ½ ) ; F1 = 2PR / P+R +  (1  –  α)  α   1   P   1   R   1   (β2  +  1)PR  
  • 37. Hands-on Walkthru - Model Evaluation Train   Test   712 (80%) 179 891 Refer  to  iPython  notebook  <2-­‐Model-­‐EvaluaHon>     at  hSps://github.com/xsankar/freezing-­‐bear  
  • 38. ROC Analysis o “How good is my model?” o Good Reference : http://people.inf.elte.hu/kiss/13dwhdm/roc.pdf o “A receiver operating characteristics (ROC) graph is a technique for visualizing, organizing and selecting classifiers based on their performance” o Much better than evaluating a model based on simple classification accuracy o Plots tp rate vs. fp rate o After understanding the ROC Graph, we will draw a few for our models in iPython notebook <2-Model-Evaluation> at https://github.com/xsankar/ freezing-bear
  • 39. ROC Graph - Discussion o  E = Conservative, Everything NO o  H = Liberal, Everything YES o Am not making any political statement ! o  F = Ideal o  G = Worst o  The diagonal is the chance o  North West Corner is good o  South-East is bad •  For example E •  Believe it or Not - I have actually seen a graph with the curve in this region ! E F G H
  • 40. ROC Graph – Clinical Example Ifcc  :  Measures  of  diagnostic  accuracy:  basic  definitions  
  • 41. ROC Graph Walk thru o iPython notebook <2-Model-Evaluation> at https://github.com/xsankar/ freezing-bear