January 2019
Intermediate to advanced
378 pages
8h 27m
English
Now, we'll create the target for our model. This is the column that will tell our model whether each IPO should have been invested in or not. We are going to say that we should invest in any IPO that has a 2.5% or greater return on day one. Obviously, this is an arbitrary number, but it seems like a reasonable value for the investment to be worthy of our attention:
y = df['1st Day Open to Close % Chg'].apply(lambda x: 1 if x > .025 else 0)
Now that we have set our target column, we need to set up our predictor variables. We'll again use patsy for this:
X = dmatrix("Q('Opening Gap % Chg') + C(Q('Month'), Treatment) + C(Q('Day of Week'), Treatment)\ + Q('Mgr Count') + Q('Lead Mgr') + Q('Offer Price') + C(Q('Star ...Read now
Unlock full access