0% found this document useful (0 votes)
25 views4 pages

Module 1 Notes

The document discusses various types of variables, data sets, and classification models, emphasizing the importance of distinguishing between numeric and categorical variables. It covers the development of classification models using training and testing data, evaluating model performance, and potential sources of bias. Additionally, it addresses prediction models, randomization, and statistical testing to determine the significance of observed results.

Uploaded by

elladdaso
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

Module 1 Notes

The document discusses various types of variables, data sets, and classification models, emphasizing the importance of distinguishing between numeric and categorical variables. It covers the development of classification models using training and testing data, evaluating model performance, and potential sources of bias. Additionally, it addresses prediction models, randomization, and statistical testing to determine the significance of observed results.

Uploaded by

elladdaso
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

chapter one

numeric variable Measurable :


characteristic of an entity described as a number
categorical variable : names/codes for different entities -
not measurable on a scale ..
May be numbers (code for entity

rectangular data sets : each row = an


entity ,
each column-variable

variable I variable 2 variable 3


for
categorical variables :
·

entity/value entity/value entity/value -


classification : identifying entities/values into predetermined categories
entity/value entity/value entity/value -cross-classification : creating groups based on combinations of two variables

entity/value 4 can create two wal tables


entity/value entity/value

two-way table of counts


Y
no total. , y =

categorical variable on

* not
rectangular
no y # # #
find proportions (% )
# total

within
classification Model :
predicting classification of entities one
target calegorical variable
·

binary classification Model :


predict classification of
entity into one of two groups within target valiable
baseline Model "No information' classification model always predicts entity
:

as
group w/ highest proportion
-

compare final Model W/baseline Model


-
to evaluate accuracy

distribution by
distribution of variable a of variable a 2
taller : Most entities
Within 2 no = x fatter -
> Most 2
entities =2
yes'
I D2 yes

F
overall

F ↑ D 2

larger difference
no

n
·

n
in height ofz between
groups =
More
useful in prediction
of classification
between U
x Y x Y
variable a variable a

confusion Matrix use to evaluate classification Model percentage correctly classified (PCC) (%. )

Predicted
sum of correctly classified
(C predicted y total X 100
total entities
actual
# #
x #
conditional proportion :
of what proportion was correctly predicted ?
actual
-

# # -
PCC within a specific subset of entire data

sum of correctly classified


total # # total XX X 100
total entities
within subset

Chapter two :
classification

describing key features of numeric data :


sum of all values
·
Mean = ·
Median = Middle value
no of values

both Median & Mean can be used as the average

pin
·
dot plot

shape descriptions of distributions

·
box
:
00
fairly symmetric
negativeined :
biModal
..

variable s

Mean
in :
·
neglect outliers
if required
trimodal
(IQR) difference between Va & LQ

anaman
interquartile range =

·
at least 50 % of values no more than IQR value apart
&
·

upper quartile (a) =


75th percentile
·
lower quartile ((a) =
25th percentile

-
-

~
25 %
standard deviation Measure of:
how much values deviate from
11 the Mean

variable larger SD More deviation


=

(further away from mean)


s

Mean larger 10R =


larger SD

developing classification models :

training-testing approach in
developing classification models -

Split data into training & testing


training data : used to develop new Model learn patterns based on training data
-

testing data : used to evaluate model performance on new unseen data

ensures Model generalises to new data (not just memorising training data

4 Prevents over-optimism (assuming Model is better than it actually is)

determine best (numeric) variable to use to predict classification of entities within the target categorical Variable
eg. determining variable to use to predict if entily time of day (target variable) is night or
day (group/levels)
bad variable (variable x) no/less overlap
lots of
good
:
overlap variable (variable
y)
-

-
:

day day

·
:iiiiii
: G
night
.......................
variable x

·
if variable y is

Y
less than cut-off
determined
- cutoff value
value,Classic

Dis
developing decision rules -
-
decision rule (for binary outcomes) : if value of (numeric variable G
is less than a cutoff value , classify target variable of entity
as A , else classify the entity as B .
(Where A & B =
will be
levels/groups within target categorical variable Misclassiea

evaluating model with testing data


apply decision rule (determined using training data)
-

I
lesting
to data
....
19

I
day O
· o O
decision rule :

· cutof
classification
o correct
·
if variable y is less than cut-off

night
value , classify time of day as
incorrect
=
o
&

night ,
else , classify as day
6 00

2
15
no of correct
I I I I I 1 PCC =

total no of values

variable
y
-

compare PCC of Model to PCC of baseline model >


-
is it better or worse than baseline model ?

·
potential sources of bias
-
algorithmic bias =
data/assumptions in algorithm lead to unfair outcomes
-
sources of bias :

biased or incomplete training data -


if training data flawed , Model flawed
human bias in design
feedback loops : biased decisions amplify & enforce existing biases over time

unbalanced of
training data unbalanced ratio entities in one group vs another
·
:

of smaller group
-
focuses too much on correctly classifying larger group at expense

PCC of two subgroups be different from each other


May
Chapter 3 : Prediction
Dynamic data :
upated live as new information becomes available -
data changes with time

developing a prediction model (using training + testing data)


predict value/intervals individual entities (for
·

numeric of a numeric variable)


baseline Model "No information' classification model :

always predid entity as


group w/ highest proportion
-

compare final Model W/baseline Model


-
to evaluate accuracy
·

prediction error : actual value -

predicted value ->


positive/negative prediction error

dynamic data >


develop dynamic prediction model condition
a
using categorical variable as
-

; a

Ca , b, c , d all levels improve accuracy even more by using intervals instead


individual entity of a categorical of values : Prediction interval > range of Values -

variable)

isnay timprintin
can use middle 95 % (of
training data results) as the
>
- Prediction interval for the model
write interval as : (Min value , Max value

tid to balance accuracy with precision

Inumpredictheynumberedtue
Predict accuracy percentage correctly calculated
Enumpredicthey
=

inumeric values percentage =


Proximity of predictions to actual values (size of
Prediction interval

dynamic prediction model :


using another numerical variable
error

Xten
S
0
create a scatter for both variables
e plot
.

visualise (pos neg N/A) pattern/trend (linear linear),


·
O O linear association , , , ,
no

Model Scatter/variation (small/close together large/far



0
o 8 apart ,

· O

!
There appears

·
to be
negative/positive relationship
o
[variable (c]
S o
a between and
· ....
O *

8
[variable u] . [variable (C) increases
As the ,
the [variable y> tends to
O 60 increase/decrease) .
O 00

Y numerical

response variable
variable

(y)
c

explanatory variable (x)

look at correlation : Measure of association + indicate strength (value) & direction (sign : -/ ) +

rank correlation : +
1/-1 =
perfect positive/negative association between variables

There appears to be between [variable(c] and (variable U] . As the [variable (2)


a
negative/positive relationship
increases the (variable y> tends
to increase/decrease . The relationship appears
,
Moderately very
strong/weak as the Scatter/variation is large/ not large This is supported by the rank correlation of . - -

if appropriate (correlation is present) fit linear


, a model to
training data
· to calculate point prediction , use equation of fitted line :

E = error term (variation) ruse to form prediction interval ·

Bo y-intercept
=

y =
Bo +
B , EE .
y & x = variable y/variable va l u e s B, =
Slope/gradient (ise) >
-
neg/pos correlation

Precision : width of prediction interval >


-
wider = less accurate & rice versa

accuracy : aim for 95 % PC


Chapter 4 : randomisation

relative position

within Middlelikeausual Yusing Middle 95 %

option the tail


an : use proportion
tail proportion : tells us what percentage of values in distribution are above/below our value of interest
-

>2 5 .
% = Within Middle 95 %: likely/Usual

-
<2 5 %.
=
Outside Middle <5 %: Unlikely/ unusual

Null Models : baseline ,


no information model
null hypothesis : the observed result was due to just chance (p =
-) .
-
chance variation : even if simulation is up to chance
,
variation on either side ofM odel
proportion expected
·

perform simulations generate data from null Model + visualise data & chance Variation
many -

randomisation test :
randomly reallocate data 1000 times
·
random allocation :
randomly allocate 2 units/groups

statistical test using null model


·

determine Whether an observed result is significant (not by chance) or not


compare observed result to hull model data
-
within Middle 95 % of null model data : result is insignificant (due to chance) & Compatible w null Model
-
outside Middle 95 % of null model data : result is significant (not chance) & incompatible w null Model

·
display data using simple Modelling tool
- (observed result(

Middle asy .
-
- --

&
P =

- %. (null hypothesis (

You might also like