We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
Ranch,
Hees Modelt -
is a stahshval mefbo usec 40 model the relatenship
behveen a cleperdent variable and one or moe independent
viable. The main aim is 7 understanel how chanyes in the
iodependent variables oe associakel with chetges ia oleh voclent Variable '
key components of vyression ye
' Dependent Variable : thisisthe variable Put nreds 4 be prebcteel
This also knoun as respnge vuriable
2-Indeperdent Varables: Theo variables hue aa intleene on the
dependent variables. Tris also known as rechedw variables
2 -Rapesion Eyeboo! repens tHe rlabuatbip befveen uo varably ”
fiw simple linear regression with ene indegendert varake
S.. ¥= dependent yeoia ble
ma 7 ne She
Beg X =Todlependnt teroble , ie o Ope
Po Jolewept fy wake chen Xs eI
9]
4 Residvals:. Th is hee ditlewcis
é behuren — th
ce ° ie obsewed salves of
ss a we onl the wales preclerol 4 He epasion
& Ase mp hens. # passion
Analysis relies on ascuen phen
depend BB ap oes ph nc Ho
alas Venstort voriome of eres and ny Slnaiy, F
5
Model Evalvhen’ Quression vovllels oe evalvakel usm various wre hus
suchas R* adjukel R>, Meon syrarecl Erov J %
FT pes of Regression
lie Reluborshia hehueen varabls is asemod tebe LINEAR
iAulkple - Sare as Iieear but mulhple independent rarabes imohect,
eter hehuren varabes in wow LIMeAR
Mlogehe -7 :
This is usecl wher the depenckod verable is Bivapy
dud it predicts the Prbably of eaacae of un
evend‘ “XN as,
FileHay, oh Resse Eq sachin:
J well the node) Fits He dah,
Tr vimehes, assessiog how
andl how yliable V the eshmates of the ‘oethiicnds ene
The wmrcn methods are *
1. Cethcient Fstmale:
eae the eshte coethcients Cslepes and iolercept) te
undlerstond the divechien encl wrupritule of the relaboaships
between the —inclepenclent ancl cle pendent varia bls
2 hee - of - Bt measures '.
* R?Ctoethaent of Detemmoaben) i Th repeserk the prperheo
| of vareme in the dependent — variuble thet is explamect
| by the independent varrables , Higher R? vales inclines betby Ft
A) Adjusted 2% Similar to R% bub it pomalres fy the rember
of predicts 0 the model, which ton be vseh) uben
ey models with litlerent nembes of predhichns
> Residual Analasts
| A) Residval Plots: Plot He residvals (the cliflevene behuren the
| obsered and prechicledl vale) against The — prechctel vale oy
aqviast each indepenlent eriable . ook for pucHerns oy herds
| Athe —yesiduals that right indicate vivlufens of regression
| assemphins (eg heterostedosh«ity ) non heeeri ty )
») Narolily of Residtals's Assess whether He residials are
approximately namally dishbuded This can be chechect
oe Dates 9 @ plots ov Shchsheo) Fests
4 Hedero sce dosheity). Chek whether the vurene of the wichals
| is constant ee diHerent levels of the rdepenceat
| variables, This con be assessecl visrall ahee>
vesicle) plots f qGP nee 4.
Ihcollineari ty’
se tela linee? ¢ Wee conelahens — Whueen independent voniables
he deo fy melbiollamrity, which ours wher inde prodent
vanubls me highly meld with each other. Tt tan
jaf latecl sey) enors ond rouke loefhuent — eshnuts
coreliable
6 predictive perfomance!
Assess how well the — rode! prachicts new date b
usie Htbngues Suh os Cvs vahduhen ow splitheg te dala
ino Peicicg ond cates sek.
7 Signitioe ies
Condut hy potess tests w delermine whether the
coctbuerts ave t ritiantly cliflerent fare 200. The rast remmen
desk is t-fest vs iodnidval Coethuents, whith assess wheter
Cech —prechetw bus SigetBeond etel on depentlent rarable
|8 Odhiners and Led hental Porodss.
| DB may hue a dispwpaberatly large impact co the
| eee Tek hese we inthenbal interns of they levenge
w ther eHect on the repre ion cook ha erk
Steps te fe beilk —veqression mode!
Collech
® Date erie | atter clude om winables 40 eesti de
[Date pepeesiq. - Cleen Re clade, honclle miss; rales
PXrpliatey Dade Avelyas: Unelestead the velabeship, behueen
vanabs anh siummarin oe
Model Selahen'- choose a ppwprale
| Nahwe of date
l#) Model rn, SPIE He larly into twinig gael deshap sets
MAodel Lvaladen Frulude the pertrorcae of he § d,
4) Ace Deployment. One subhed with the models perkrmeoe ,
dep tf prule pPreclichens on new dak
Coe model basecl on the
mode t1"
| Correlahon
ag
ig concerned with Ba ees toy the Shength ve
the velabenshio — befween variables s \
‘orrlahon model:
ae dn this, both X and ¥ variables are yandem vanables
The sample observahens are obkuoe! by selechay a voadem
sample of the units of associahon and Za keg on Cath a
meusurement of X anc a meascrement one,
ovthae to build = cone ben mode!
Date preparahun' Orgam ze pe cedu 50 that, och row
veprsen Parr of varikbks and incheles velevont Potwes
Hud ae influene the corelahien —ehuren Hose vanables
3) Fechoe Fevineerin
IT den’ tee featves thet ge be prediche
of the wrlahen behveen variables. “These sacldes
the properhes of the vanables, dlishrbuhens ,veluhenghips el
#) Model Selecher’
choose an appmprate eee model fer
Dredeteg the tonelaton sales This woudl be a hoor
ihe model ov move complex rnodlels . -dpodig a
ne ioe ot the clata
#) Mode) Traaming
Split the dd i; into tele ard feshoy sets
MAode) Ervaladion:
Geneon sysarteck enor)
\ balate the perforane vey MSE, RMSE ov R? delerminahen
2) Mode Toterprelation!
Analyze the wethuents tp cackeistoncl which Pahves ae
mnt preliihe of the —forrelation behueen variables
[Medel Dephy ment 1 Depby it tw precicd coelaheng
fer pews pars of varia bles ‘Correlation Cockhecient :
Tt 5 a Stubsta)
measue thet quohhes te
Shength and direchon of te velabonship — behuten hue
vanables Jt 15 dlenotel by the symbol yr and venge$
d f 4
foro -1 toy
Covelaben toethaent ¥, = g 2 ems ya
[Em ely) vie
an. ave n ten Coothivsent
Ie hich covelaben (OF
x ond Y vara bles for w é oe
where,
Kandy are the ymmans of X and ¥
cor)
Covela ton. cothuent Y, = Cov Op
Sx S
Where, d
COvarione , erlny) z 2xy ae
= xg
n
nen, foie VEG! Gisd
stendorch ee
mee ae [2 -@
aIndications of — fonelation toePhvient .
| Y21, perkct pesihie tonelakin . As one wrrable
totrenses, the other vanable also increuses lineos
<
4
re-1, perfect negare forelahin | As one yanable
increases the otter vaviuble
decreases sey
» 250 6 Mo tonelakon) > There i, np linear velahurshy
W-\
| Y=) % OLN oo A Y=O.
/ Pere peste posite re vacmekidel date
y
4
beact ative
nega tive
Shes covets bon
Pr Ree cali aneWee Ree ean 7
Ripon , Qrelaton for detu vsog R/ Pifthen.
pylon offer powerful Vibes for pectooing
R oJ
Yeoression — analysis
\ Y
USiog kk
N
deed Data:
H# oad
data <- read. tsv ("dat csv’
Perfrra — Regression:
DAS Ake
+ Perdam — |incor reqressivo
XQ
rnedel Z- Im (dependent_ variable ~ independent _vorablei +
independent - varale >, clara = cata)
Summon Croce)
d
Calulke Coreen
Leet
forebton — mahix £- Cor (data)
Prot Coorelatin —rrats ).
| doak Date:
ae A
import Pandas os pa
A dood — dutaset Creplce “duo. csv” with your File path )
date = pd. reed csv (“dafa.esv")Pe rfovm Req yession +
import stutsrnodels.api as oro
4 Defre independet and dependent vana bles
Xe dade [Ciodeperdent vasable’, odependent varia ble a 4
# Add consent term to iedepenclnt varrables
X= sm.add — const Cx)
(# BE he vapesum model
mode) = oe CY x) ALO
| Prot Seemes oF the Een yeasts
priot Cenodlel. SEG aD)
Caludate Correlahen
# (alulite coveluton reatox
Covrelahin_ rnukix = clack (ore)
prot (tonelation maker)