Professional Documents
Culture Documents
classification paobtenm'
datoset:
Study bous Play hOtUMS o/PCPass/ Fail)
2 Fail
3 fail
3 PasS
OutlieS 1 Pass
6 8 10 12 13 14
Fail (Butin Seality itis fass)
ohy we use loqisic Reg&cssion when we can
Solve alassipicaios psoblem using
Linea Regaession
and
due to outliers best it line gets change
6esults wi be wsong
Squash("cut")
best tline using sigmoid
AnctHon.
he(ox)=Go+61
best ktlinc
Squash "cut")(
using Sigmoid
o uncHon.
hex)=6o+610
Sigmod kuncion > output wil
&ange betn 0 and l.
Pamofo Funchion:
SCeo,6)
heco
MSE
heox)=eo+01
GH&adient desent
Conveo kunction
one qlobal minima)
Steps:
Cfeaie best itline
apply squashing3 using siqmoid unclion
S(e0,e1) = he o)
sigmoid uncion
he(o) s(e0+e1)
et tihaicniMAaABot
Aet Oo+e10
heC)= (R)
hec)
be()
1+ ot81)
be()=
e0+610()
e No convea
unction
e
change theCost unchon to solve thè convexity
p&oblenm
1oq he(x)
cost uncion
conveacunclion
he (a) =E
+ ®o+61)
Cost (he(o),
minima
1og(be))
)1og(1-ha(a))
valuc
reath
minimige cost uncion (€6,e1)
by changtmg
e0, 61
Convetgence Algosithm
Repeat Convegence
J
3(eo, G)
o O andjal
take hscshold =0:5
by dekault
using ROC ond ToC CUxv€, we can
deine+h&eshold.
xkesmance Meeics
Conusion matviot
2 Acc acy
3. Pecision
Reca
5. P-Beta Scoe
datase*
Olp P-y(nodelpfedictE
co8Eect
Oweong
peediction
pfediction
3 2
pfedic+ed O
value (G)
Actua value
TP Tue Posittve
TP FP Co6sect
TN: TEue Megakve
match
TO
AOL us&ong FP: False Positive
Accwxacy
reis
AccwKacy TP+TN
TP+ PP +FN+T
lcoo datapointHs
oo Imbalanced daaset
(o)
Peecision TP
Actual TP+ PP
Diabe4es o ot diabees
Actual diabeles and Psedicied- Not
diabetes
Ceittca p8oblem Seduce PN
Recall
Oat o 'ai 4hepfedicted values
Recall TPTP+FO
howmany aURE cwKAentY
Psedicted.
Companies RP
(can Aake cextain
decision)
-Beta Scose
2.Psecision
+ Recall
O FP and FN oke both impostant
PI Scose =2.PxR
P+R
PP is mose impostant
B 0:5
han P1o
3 1 F >>FP, (FPis
B2
less impo stant 4han Fru),
F2scose = (+4)PxR
4x P+R
In-depth Insights
Logistic Regression
papergrid
Date:
Clasalea
Classikicaion_psoblem, it just /kethe
eOhleM ECept hat the values
a
ake on oni small numbef o e
Segsessionadel
nooUOant topdedict
discsele Nalues
yEO,1 O Ve class
Binaey class 1 +Ve elagS
Hypohesis Kepseserstatio
iu iively
ages %an o
,
it doesh't omake seDselo8
0
smalles thao obeo we
be(ox)totakeNalues
be (o) g(eox)
ga)
funetioo q*), shocmD besc,
mapsanydea oumbee8 tothbe
0,1) iotesval, making
it usekul o6
4eansfosmingan
Obita6y-Nalued tunetioninto uncion a betteašuited
{o classiticatio
beCo) PCye1|xe)=
PCyolxie) +PCy»|lx;0)
Oecisioo Rounda&y
be(ox) O:5
beot)o: 0
Tbe way ousogistickuocior g
behaves is %at uben ds
inpu is gseavefhan of equal to 3e€0,its outpt is
9EcateS hao o6 equal 40 05
>o:5 when2>0
Remembes:
0,eIg /2 Cor)=
o, e 0g()
g(o)0
SoioEinput 40 is e heo +hat means
Tbe decision
afea usbe
se
bypobesis uncion
o
boundas tsthe line
ql + +hot.sepe.sates
CSeated by ou&
*e
papergrid
Date:
Yi 5+-)X+0.270
5- O
153
o his Cgse Ou6 decision boundoafy tsa stsaiqbt
yectical ine_placcd on thegsapbwhes =8 add
evesyh{ng *o he lef q{ that denotes wbie
evefyhing fothe sigbt depotes q0.
again,he înpit to
eed o 6esiomoid functioo
6e tineaf, could be atunctioo
g)
ot
Ceg.ex
a
desesibes
doesot
Cost RuncHon
S(O) m i1 cost(he ( y)
cost (he(oxt),u)=-Hog (be(od)iya
cost (he (oc)) -loq-he(0 ity=o
ngto) heta)
papergrid
Date:
=0
cost (beCo)1y) ba)E
ye0 and beo)->1
cos+(beo)1)0,i
COS (he(atd,y) ie and be(c)->o
Gadient Desccot:
RepeatR
Repeat
\.o
halo)-yi
mi1
2
Notice
tnlioea
updaie
Segsessio0:
al
e
hat hisalgos ithm is idenical to he one awe used
St have do simulta0eously
valuesin the1o. he)
isdittesent
e - x(a(xe)-
Advanceod Oplimalfon
GSadient desceo
Goojugae gsadient
RGS
LBRGIS.
Mollclasg_elassiLcaions
be) P(y:olgx;)
ha(o)= PCyzilox;e
he'(ox)=_PCyzolx;6
pSediction ma«ha (ox)
wea&c basically
lumpiog a he
one class andhen
choosi0g
othess into o single 5econdclass, uwe dothis &epeated
papergrid
luio9 6i0as Date: I
logisic
usehe egeessiontoeach
bypothesis
Asedietiog.
hat case,aod *6us
ekusned thie btghest
NalueaSOu
ne-Vs-alone-vs-eal)
AA-
o
-
Class
class2
class 3:x
:
A
heloc)=P(y=ilx;e) Ci=2,3)
To summasige
Tsain a logistic segsession class ikiee helo«)jo8 each
a
OD new input ox,to make a p$ediokion piok the class
hat m acimizes
mao be()
papergrid
Date:
II
KequlaiQatM
De+A
Reduccheoumbec
of_{eauces:
manuglly selec¥ wbich {eotues
do keep
use a
model selechon
algoeitbro
2. Requlacization
keep al thejeaukes
O
,butseduce
pasa meieks 6
heoag oitude
Regulaization wasks wellgobeg
lot o slighkly usekul uebavea
ceseukce.LeakueeS.
oe 6oveoverHA0g
{om
can seduce the uweiqht ou,byupohesis
that someok he fungkon1
eams inOudG
papergrid
Date: I
doithout elinminale
actually
geHing eio o fhese featues
changing *beofm ofcut
oue cOSt unchon. bypdthesis, C oe
COn iosfeod modig
mine
2m 2
2 (hao)-yi +1000 e+looo.e
Now io08de& {08be cost_LuncHo0 toget
closett0 2ek0
we oil bave to eoluce be valueS O O3 and
toneot
This uwil in dun gseatlySeduce the
in
ReYO
N
oue bupothesis ungio0
Nalues okSZA
i/
6i3e House ,Sige qf House
0o+1x+62t
mi6 1 (ba(i)-qi*+
2
10vo2 lovoet
ta parom.
all Oou heYa paamele
CouCould alsoSegulaeige
i a single sunmaions aS
mio belori)-yi+2J
e 2 il
lambdo t
is choosen to be too laxge, may smooth out
he luockoo doo much and cause undeAiing.
Gsadieot Descent
we wil1 g8adient descent {uocion to sepogYe
moodify
out Go_16om he
Sesf O hc_poramcYers because do we
o0t wan to AeOalize eo.
Repeat
o Go-X. 2 (baoci)-qi.
j ba(od)-i\
iESh2,s
papergrid
1
Date:
S
sanipulaton OUG update sule ca0also be sepsesenled
mi
aluays willbeless ¥haD
Nosmal Bquokoni
1
down the
Lisam aeio with O atthe topleftt and ps
evesywhcse else
diagonal, with O's
I XP*).
shold hove dimension(nt)
intuitivelu ,
this is
Howevel,when we add
Imx, 4hen X 'Xis non-OVeSH6le
hen X'X+*L 6ecomes invesihle.
the deem A:L
papergrid
Date:
ion
Keqularigeod oqistte Keqkess
CoStuno¥ioo
GOS uOCion {OSlogishc
Segsession GS
laq(1-8bec
SO)=2i.loq(ha(ox))+(q).
20 je
Grsadieot Ocscent
Sepeat
o eo-o:
M, (baC)-yi).
- i alg
ei heCcxi)-i)a+
ste) (12