# Path: nowtrade/logger.py
# CRITICAL = logging.CRITICAL
# ERROR = logging.ERROR
# WARNING = logging.WARNING
# INFO = logging.INFO
# DEBUG = logging.DEBUG
# class Logger(object):
#     def __init__(self, name, log_file=configuration.LOG_FILE, \
#                  console_lvl=configuration.LOGGING_DEFAULT_CONSOLE, \
#                  file_lvl=configuration.LOGGING_DEFAULT_FILE):
#     def get_logger_level(self, name, default, out):
#     def get_console_level(self, name, default):
#     def get_file_level(self, name, default):
#     def set_file_level(self, lvl):
#     def set_console_level(self, lvl):
#     def debug(self, message):
#     def info(self, message):
#     def warning(self, message):
#     def error(self, message):
#     def critical(self, message):
#     def exception(self, message):
#     def __getstate__(self):
#     def __setstate__(self, data):


import cPickle
import numpy as np
from itertools import chain
from sklearn.ensemble import RandomForestRegressor #, RandomForestClassifier
from nowtrade import logger
    """
    file_handler = open(filename, 'rb')
    ensemble = cPickle.load(file_handler)
    file_handler.close()
    return ensemble

class Ensemble(object):
    """
    The ensemble class does all the heavy lifting to incorporate sklearn
    ensembles into the NowTrade ecosystem.
    """
    def __init__(self, train_data, prediction_data, ensemble_type=RANDOM_FOREST_REGRESSOR):
        self.train_data = train_data
        self.prediction_data = prediction_data
        self.ensemble_type = ensemble_type
        self.ensemble = None
        self.prediction_window = None
        self.look_back_window = None
        self.training_set = []
        self.target_set = []
        self.normalize = True
        self.number_of_estimators = 150
        self.max_depth = None
        self.random_state = 0
        self.min_samples_split = 2
        self.number_of_jobs = 2
        self.learning_rate = 1.0 # For Gradient Boosting
        self.rating = None
        self.feature_importances = None
        self.logger = logger.Logger(self.__class__.__name__)

# Path: nowtrade/logger.py
# CRITICAL = logging.CRITICAL
# ERROR = logging.ERROR
# WARNING = logging.WARNING
# INFO = logging.INFO
# DEBUG = logging.DEBUG
# class Logger(object):
#     def __init__(self, name, log_file=configuration.LOG_FILE, \
#                  console_lvl=configuration.LOGGING_DEFAULT_CONSOLE, \
#                  file_lvl=configuration.LOGGING_DEFAULT_FILE):
#     def get_logger_level(self, name, default, out):
#     def get_console_level(self, name, default):
#     def get_file_level(self, name, default):
#     def set_file_level(self, lvl):
#     def set_console_level(self, lvl):
#     def debug(self, message):
#     def info(self, message):
#     def warning(self, message):
#     def error(self, message):
#     def critical(self, message):
#     def exception(self, message):
#     def __getstate__(self):
#     def __setstate__(self, data):


# Path: nowtrade/ensemble.py
import cPickle
import numpy as np
from itertools import chain
from sklearn.ensemble import RandomForestRegressor #, RandomForestClassifier
from nowtrade import logger

    """
    file_handler = open(filename, 'rb')
    ensemble = cPickle.load(file_handler)
    file_handler.close()
    return ensemble

class Ensemble(object):
    """
    The ensemble class does all the heavy lifting to incorporate sklearn
    ensembles into the NowTrade ecosystem.
    """
    def __init__(self, train_data, prediction_data, ensemble_type=RANDOM_FOREST_REGRESSOR):
        self.train_data = train_data
        self.prediction_data = prediction_data
        self.ensemble_type = ensemble_type
        self.ensemble = None
        self.prediction_window = None
        self.look_back_window = None
        self.training_set = []
        self.target_set = []
        self.normalize = True
        self.number_of_estimators = 150
        self.max_depth = None
        self.random_state = 0
        self.min_samples_split = 2
        self.number_of_jobs = 2
        self.learning_rate = 1.0 # For Gradient Boosting
        self.rating = None
        self.feature_importances = None
        self.logger = logger.Logger(self.__class__.__name__)

        self.logger.info('train_data: %s  prediction_data: %s  ensemble_type: %s'