# 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 numpy as np
import pandas as pd
import tensorflow as tf
from speculator import market
                                     y=y,
                                     batch_size=128,
                                     queue_capacity=1000,
                                     shuffle=True,
                                     num_threads=1,
                                     num_epochs=None)
        self.train(input_fn=input_fn, steps=2000)

    def get_input_fn(self, x, y=None, shuffle=True, **kwargs):
        return tf.estimator.inputs.pandas_input_fn(x,
                                                   y=y,
                                                   shuffle=shuffle,
                                                   **kwargs)

    def accuracy(self, x, y):
        input_fn = self.get_input_fn(x, y)
        return self.evaluate(input_fn)['accuracy']

    def _predict_trends(self, x, y=None):
        input_fn = self.get_input_fn(x, y=y)
        # TF returns a dict generator, convert to list
        preds = list(self.predict(input_fn=input_fn))
        return [int(p['class_ids'][0]) for p in preds]
        
    def _predict_logs(self, x, y=None):
        input_fn = self.get_input_fn(x, y=y)
        # TF returns a dict generator, convert to list
        preds = list(self.predict(input_fn=input_fn))
        return [list(p['logits']) for p in preds]


# 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/models/deep_neural_network.py
import numpy as np
import pandas as pd
import tensorflow as tf
from speculator import market

                                     y=y,
                                     batch_size=128,
                                     queue_capacity=1000,
                                     shuffle=True,
                                     num_threads=1,
                                     num_epochs=None)
        self.train(input_fn=input_fn, steps=2000)

    def get_input_fn(self, x, y=None, shuffle=True, **kwargs):
        return tf.estimator.inputs.pandas_input_fn(x,
                                                   y=y,
                                                   shuffle=shuffle,
                                                   **kwargs)

    def accuracy(self, x, y):
        input_fn = self.get_input_fn(x, y)
        return self.evaluate(input_fn)['accuracy']

    def _predict_trends(self, x, y=None):
        input_fn = self.get_input_fn(x, y=y)
        # TF returns a dict generator, convert to list
        preds = list(self.predict(input_fn=input_fn))
        return [int(p['class_ids'][0]) for p in preds]
        
    def _predict_logs(self, x, y=None):
        input_fn = self.get_input_fn(x, y=y)
        # TF returns a dict generator, convert to list
        preds = list(self.predict(input_fn=input_fn))
        return [list(p['logits']) for p in preds]


    def _predict_probas(self, x, y=None):