Numerical prediction using Machine learning
<p>I got started with naive numerical prediction. Here is the training data</p>

<p><a href="https://gist.github.com/karimkhanp/75d6d5f9c4fbaaaaffe8258073d00a75" rel="nofollow noreferrer">https://gist.github.com/karimkhanp/75d6d5f9c4fbaaaaffe8258073d00a75</a></p>

<p>Test data</p>

<p><a href="https://gist.github.com/karimkhanp/0f93ecf5fe8ec5fccc8a7f360a6c3950" rel="nofollow noreferrer">https://gist.github.com/karimkhanp/0f93ecf5fe8ec5fccc8a7f360a6c3950</a></p>

<p>I wrote basic scikit learn code to train and test.</p>

<pre><code>import pandas as pd
import pylab as pl
from sklearn import datasets
from sklearn import metrics, linear_model
from sklearn.linear_model import LogisticRegression, LinearRegression, BayesianRidge, OrthogonalMatchingPursuitCV, SGDRegressor
from datetime import datetime, date, timedelta

class NumericPrediction(object):
    def __init__(self):
        pass
    def dataPrediction(self):
        Train = pd.read_csv("data_scientist_assignment.tsv", sep='\t', parse_dates=['date'])
        Train_visualize = Train
        Train['timestamp'] = Train.date.values.astype(pd.np.int64)
        Train_visualize['date'] = Train['timestamp']
        print Train.describe()
        x1=["timestamp", "hr_of_day"]
        test=pd.read_csv("test.tsv", sep='\t', parse_dates=['date'])
        test['timestamp'] = test.date.values.astype(pd.np.int64)
        model = LinearRegression()
        model.fit(Train[x1], Train["vals"])
        # print(model)
        # print model.score(Train[x1], Train["vals"])
        print model.predict(test[x1])

        Train.hist()
        pl.show()

if __name__ == '__main__':
    NumericPrediction().dataPrediction()
</code></pre>

<p>But accuracy is very low here. Because approach is very naive. Any better suggestion to improve accuracy ( In terms of algorithm, example, reference, library)?</p>