Summary Data Mining classification (1+2) + solutions exercises
7 views 0 purchase
Course
Data Mining
Institution
Universiteit Gent (UGent)
This document contains a summary of the theory that was completed during this lab session. In addition, at the end of the document, there are solutions for the lab sessions.
Classification 1
lag1, lag2,…,lag5: percentage return for each of the five previous trading days
volume: number of shares traded on previous day
today: percentage return on data in question
direction: whether the market was Up or Down on this data
cor(): produces matrix containing all of correlations among the predictors
Here error because “direction” variable is qualitative
Correlations between the lags and today’s returns close to zero => little correlation
Year and volume: substantial correlation
glm(): fits linear models that includes logistic regression (similar to lm() except: family = binomial)
Lag1
smallest p-value
negative coefficient: if
market had positive return
yesterday, then less likely to
go up today
0.15: no clear evidence of
association between Lag1
and direction
, coef(): access coefficients
summary(): access specific aspects of fitted model
predict(): can be used for the probability that the market will go up, given values of predictors
type = “response”: tells R to output probabilities of the form P(Y=1|X)
contrasts(): indicates that R has created a dummy variable
Vector of class predictions based on whether predicted probability of a market increase is greater
than or less than 0.5:
First command: creates vector of 1,250 Down elements
Second command: transforms to Up all of elements for which predicted probability of
market increase exceeds 0.5
table(): produces a confusion matrix
Diagonal elements: correct predictions
Off-diagonal elements: incorrect
Training error rate: 100 – 52.2 = 47.8%
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Worstje2021. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R58,86. You're not tied to anything after your purchase.