iI am very new to machine learning and in my first project have stumbled across a lot of issues which iI really want to get through.
i mI'm using logistic regression usingwith R's glmnetglmnet
package withand alpha = 0 for ridge regression.
i mI'm using ridge regression actually since lasso deleted all my variables and gave very low Areaarea under Curvecurve (0.52)
but with ridge also, there aintisn't much of a difference (0.61).
myMy dependent variable/output is probability of click, based on if there is a click or not in historical data.
theThe independent variables are state, city, device, user age, user gender, IP carrier, keyword, mobile manufacturer, ad template, browser version, browser family, OS version, and OS family.
ofOf these, infor prediction i mI'm using state, device, user age, user gender, IP carrier, browser version, browser family, OS version, and OS family,family; I am not using keyword or template since we want to reject a user request before deep diving in our system and selectselecting a keyword or template. I am not using city because they are too many, or mobile manufacturer cuzbecause they are too few.
is it okay or should i be using these the rejected variables?Is that okay or should I be using the rejected variables?
to go aboutTo start, iI create a sparse matrix from my variables which are mapped against the column of clicks that have yes or no values.
so afterAfter training the model, iI save the coefficients and intercept. theseThese are used for new incoming requests using the formula for logistic that is 1/(1+e^-1*sum(a+k(ith)*x(ith))) where aregression:
Where a
is intercept, kk
is the ithi
th coefficient and xx
is the ithi
th variable value.
please let me know if my approach is correct so far.Is my approach correct so far?
now simple glmSimple GLM in R (that is where there is no regularisedregularized regression, right?) gave me 0.56 AUC with. With regularization iI get 0.61 but there is no distinct threshold thatwhere we could say that okay above 0.xx its mostly 1sones and below it most 0szeros are covered,covered; actually, the max probability of wherethat a click didnt happeneddidn't happen is almost always >greater than the max probability wherethat a click happened.
so basically what should i do?So basically what should I do?
iI have read how stochastic gradient descent is an effective technique in logit so how todo I implement stochastic gradient descent in R? if itsIf it's not straightforward, is there a way to implement this system in pythonPython? isIs SGD implemented after generating a regularized logistic regression model or is it a different process all togetheraltogether?
Also there is an algoalgorithm called follow the regularized leader (FTRL) that is used in ctrclick-through rate prediction. isIs there a sample code and use of itFTRL that iI could go through?