# Path: speculator/market.py
# TARGET_CODES = {'bearish': 0, 'neutral': 1, 'bullish': 2}
#         DIRECTION = 'last'
#     TARGET_NAMES = {v: k for k, v in TARGET_CODES.items()}
# class Market:
#     def __init__(self, json=None, symbol='USDT_BTC', unit='month', count=6, period=86400):
#     def get_json(self):
#     def set_features(self, partition=1):
#     def set_long_features(self, features, columns_to_set=[], partition=2):
# def set_targets(x, delta=10):
# def eval_features(json):
# def target_code_to_name(code):
# def setup_model(x, y, model_type='random_forest', seed=None, **kwargs):


import argparse
import pandas as pd
from datetime import datetime as dt
from speculator import market
from speculator import models
                        help=('Price buffer in the neutral zone before'
                              'classifying a trend as bullish or bearish'))
    parser.add_argument('-t', '--trees', default=10, type=int,
                        help=('Number of trees (estimators) to generate in '
                              'the Random Forest, higher is usually better'))
    parser.add_argument('-j', '--jobs', default=1, type=int,
                        help=('Number of jobs (CPUs for multithreading) when '
                              'processing model fits and predictions'))
    parser.add_argument('--proba', default=False, action='store_true',
                        help='Display probabilities of the predicted trend')
    parser.add_argument('--proba_log', default=False, action='store_true',
                        help=('Display logarithmic probabilities of the '
                              'predicted trend'))
    return parser.parse_args()

def main():
    args = get_args()
    assert args.partition > 0, 'The data must be partitioned!'

    m = market.Market(symbol=args.symbol, unit=args.unit,
                      count=args.count, period=args.period)
    features = m.set_features(partition=args.partition)
    if args.long is not None:
        features = m.set_long_features(features,
                                       columns_to_set=args.long,
                                       partition=args.partition)

    targets = market.set_targets(features, delta=args.delta)
    features = features.drop(['close'], axis=1)


# Path: speculator/market.py
# TARGET_CODES = {'bearish': 0, 'neutral': 1, 'bullish': 2}
#         DIRECTION = 'last'
#     TARGET_NAMES = {v: k for k, v in TARGET_CODES.items()}
# class Market:
#     def __init__(self, json=None, symbol='USDT_BTC', unit='month', count=6, period=86400):
#     def get_json(self):
#     def set_features(self, partition=1):
#     def set_long_features(self, features, columns_to_set=[], partition=2):
# def set_targets(x, delta=10):
# def eval_features(json):
# def target_code_to_name(code):
# def setup_model(x, y, model_type='random_forest', seed=None, **kwargs):


# Path: speculator/main.py
import argparse
import pandas as pd
from datetime import datetime as dt
from speculator import market
from speculator import models

                        help=('Price buffer in the neutral zone before'
                              'classifying a trend as bullish or bearish'))
    parser.add_argument('-t', '--trees', default=10, type=int,
                        help=('Number of trees (estimators) to generate in '
                              'the Random Forest, higher is usually better'))
    parser.add_argument('-j', '--jobs', default=1, type=int,
                        help=('Number of jobs (CPUs for multithreading) when '
                              'processing model fits and predictions'))
    parser.add_argument('--proba', default=False, action='store_true',
                        help='Display probabilities of the predicted trend')
    parser.add_argument('--proba_log', default=False, action='store_true',
                        help=('Display logarithmic probabilities of the '
                              'predicted trend'))
    return parser.parse_args()

def main():
    args = get_args()
    assert args.partition > 0, 'The data must be partitioned!'

    m = market.Market(symbol=args.symbol, unit=args.unit,
                      count=args.count, period=args.period)
    features = m.set_features(partition=args.partition)
    if args.long is not None:
        features = m.set_long_features(features,
                                       columns_to_set=args.long,
                                       partition=args.partition)

    targets = market.set_targets(features, delta=args.delta)
    features = features.drop(['close'], axis=1)


    model = market.setup_model(features[:-1], targets,