# Path: chelmbigstock/stock_value.py
# class StockHist:
# class StockValue:
# class LinearAdapter:
# class QuadraticAdapter:
# class CubicAdapter:
#     _FDELIM = '_'
#     _DFMT = '%Y%m%d'
#     _EXT = '.csv'
#     _URL_HEADER = 'http://ichart.yahoo.com/table.csv?s='
#     _URL_TRAILER = '&g=w&ignore=.csv'
#     _URL_SMONTH = '&a='
#     _URL_SDAY = '&b='
#     _URL_SYEAR = '&c='
#     _URL_EMONTH = '&d='
#     _URL_EDAY = '&e='
#     _URL_EYEAR = '&f='
#         X = [ [i] for i in x ]
#         X = [[i] for i in x]
#         X = [ [i, i*i] for i in x ]
#         X = [[i, i*i] for i in ex]
#         X = [ [i, i**2, i**3] for i in x ]
#         X = [[i, i**2, i**3] for i in ex]
#     def _make_url(self):
#     def __init__(self, symbol, start_date = None, end_date = None):
#     def symbol(self):
#     def start_date(self):
#     def end_date(self):
#     def filename(self):
#     def _read_data(self, pos, converter):
#     def dates(self):
#     def highs(self):
#     def __init__(self, stock_hist, predictor, comment):
#     def symbol(self):
#     def comment(self):
#     def past_dates(self):
#     def past_highs(self):
#     def future_highs(self, future_dates):
#     def __init__(self, clf):
#     def fit(self, x, y):
#     def predict(self, x):
#     def __init__(self, clf):
#     def fit(self, x, y):
#     def predict(self, ex):
#     def __init__(self, clf):
#     def fit(self, x, y):
#     def predict(self, ex):


import os
import sys
import shutil
import unittest
from datetime import date, datetime, timedelta
from sklearn import linear_model
from chelmbigstock import stock_value
                [2, 5, 8, 7, 10],
                [5.5], [7.4375]
            ]
        ]

    _test_RR = [                    # test data for Ridge regression with alpha = 0.5
            [
                [0, 1, 3],
                [0, 1, 3],
                [5.5], [5.09677419]
            ],
            [
                [1, 3, 4, 5, 9],
                [2, 5, 8, 7, 10],
                [5.5], [7.42296919]
            ]
        ]


    def equal_floats(self, l1, l2):
        if len(l1) != len(l2):
            return False
        for i in range(0, len(l1)):
            if abs((l1[i] - l2[i])/l1[i]) >= self._e:
                return False
        return True


    def test_linear_regression(self):
        clf = linear_model.LinearRegression()

# Path: chelmbigstock/stock_value.py
# class StockHist:
# class StockValue:
# class LinearAdapter:
# class QuadraticAdapter:
# class CubicAdapter:
#     _FDELIM = '_'
#     _DFMT = '%Y%m%d'
#     _EXT = '.csv'
#     _URL_HEADER = 'http://ichart.yahoo.com/table.csv?s='
#     _URL_TRAILER = '&g=w&ignore=.csv'
#     _URL_SMONTH = '&a='
#     _URL_SDAY = '&b='
#     _URL_SYEAR = '&c='
#     _URL_EMONTH = '&d='
#     _URL_EDAY = '&e='
#     _URL_EYEAR = '&f='
#         X = [ [i] for i in x ]
#         X = [[i] for i in x]
#         X = [ [i, i*i] for i in x ]
#         X = [[i, i*i] for i in ex]
#         X = [ [i, i**2, i**3] for i in x ]
#         X = [[i, i**2, i**3] for i in ex]
#     def _make_url(self):
#     def __init__(self, symbol, start_date = None, end_date = None):
#     def symbol(self):
#     def start_date(self):
#     def end_date(self):
#     def filename(self):
#     def _read_data(self, pos, converter):
#     def dates(self):
#     def highs(self):
#     def __init__(self, stock_hist, predictor, comment):
#     def symbol(self):
#     def comment(self):
#     def past_dates(self):
#     def past_highs(self):
#     def future_highs(self, future_dates):
#     def __init__(self, clf):
#     def fit(self, x, y):
#     def predict(self, x):
#     def __init__(self, clf):
#     def fit(self, x, y):
#     def predict(self, ex):
#     def __init__(self, clf):
#     def fit(self, x, y):
#     def predict(self, ex):


# Path: tests/linear_adapter_test.py
import os
import sys
import shutil
import unittest
from datetime import date, datetime, timedelta
from sklearn import linear_model
from chelmbigstock import stock_value

                [2, 5, 8, 7, 10],
                [5.5], [7.4375]
            ]
        ]

    _test_RR = [                    # test data for Ridge regression with alpha = 0.5
            [
                [0, 1, 3],
                [0, 1, 3],
                [5.5], [5.09677419]
            ],
            [
                [1, 3, 4, 5, 9],
                [2, 5, 8, 7, 10],
                [5.5], [7.42296919]
            ]
        ]


    def equal_floats(self, l1, l2):
        if len(l1) != len(l2):
            return False
        for i in range(0, len(l1)):
            if abs((l1[i] - l2[i])/l1[i]) >= self._e:
                return False
        return True


    def test_linear_regression(self):
        clf = linear_model.LinearRegression()

        predictor = stock_value.LinearAdapter(clf)