SVM; training data doesn't contain target
<p>I'm trying to predict whether a fan is going to turn out to a sporting event or not.  My data (pandas DataFrame) consists of fan information (demographic's, etc.), and whether or not they attended the last 10 matches (g1_attend - g10_attend).</p>

<pre><code>fan_info age neighborhood g1_attend g2_attend ... g1_neigh_turnout 
2717     22   downtown      0         1               .47
2219     67   east side     1         1               .78
</code></pre>

<p>How can I predict if they're going to attend g11_attend, when g11_attend doesn't exist in the DataFrame?</p>

<p>Originally, I was going to look into applying some of the basic models in scikit-learn for classification, and possibly just add a g11_attend column into the DataFrame.  This all has me quite confused for some reason.  I'm thinking now that it would be more appropriate to treat this as a time-series, and was looking into other models.</p>

<p>You are correct, you can't just add a new category (ie output class) to a classifier -- this requires something that does time series.</p>

<p>But there is a fairly standard technique for using a classifier on times-series. Asserting (conditional) Time Independence, and using windowing.</p>

<p>In short we are going to make the assumption that whether or not someone attends a game depends only on variables we have captured, and not on some other time factor (or other factor in general).
i.e. we assume we can translate their history of games attended around the year and it will still be the same probability.
This is clearly wrong, but we do it anyway because machine learning techneques will deal with some noised in the data. 
It is clearly wrong because some people are going to avoid games in winter cos it is too cold etc.</p>

<p>So now on the the classifier:</p>

<p>We have inputs, and we want just one output.
So the basic idea is that we are going to train a model, 
that given as input whether they attended the <strong>first 9 games</strong>, predicts if they will attend the <strong>10th</strong></p>

<p>So out inputs are <sup>1</sup> <code>age</code>, <code>neighbourhood</code>, <code>g1_attend</code>, <code>g2_attend</code>,... <code>g9_attend</code>
and the output is <code>g10_attend</code> -- a binary value.</p>

<p>This gives us training data.</p>

<p>Then when it it time to test it we move everything accross: switch <code>g1_attend</code> for <code>g2_attend</code>, and <code>g2_attend</code> for <code>g3_attend</code> and ... and <code>g9_attend</code> for <code>g10_attend</code>.
And then our prediction output will be for <code>g11_attend</code>.</p>

<p>You can also train several models with different window sizes.
Eg only looking at the last 2 games, to predict attendance of the 3rd.
This gives you a lot more trainind data, since you can do.
<code>g1,g2</code>-><code>g3</code> and <code>g2,g3</code>-><code>g4</code> etc for each row.</p>

<p>You could train a bundle of different window sizes and merge the results with some ensemble technique. </p>

<p>In particular it is a good idea to train <code>g1,...,g8</code>-> <code>g9</code>,
and then use that to predict <code>g10</code> (using <code>g2,...,g9</code> as inputs)
to check if it is working.</p>

<p>I suggest in future you may like to ask these questions on <a href="http://stats.stackexchange.com/">Cross Validated</a>. While this may be on topic on stack overflow, it is more on topic there, and has a lot more statisticians and machine learning experts.</p>

<hr>

<p><sup>1</sup> I suggest discarding <code>fan_id</code> for now as an input. I just don't think it will get you anywhere, but it is beyond this question to explain why.</p>

python pandas scikit-learn modeling