#!/opt/anaconda2/bin/python
# -*- coding: utf-8 -*-

"""
################################################################################
#
#  Copyright (c) 2015 Wojciech Migda
#  All rights reserved
#  Distributed under the terms of the MIT license
#
################################################################################
#
#  Filename: clf_ert.py
#
#  Decription:
#      ExtraRandomTrees regressor
#
#  Authors:
#       Wojciech Migda
#
################################################################################
#
#  History:
#  --------
#  Date         Who  Ticket     Description
#  ----------   ---  ---------  ------------------------------------------------
#  2015-12-19   wm              Initial version
#
################################################################################
"""

from __future__ import print_function

DEBUG = False
__all__ = []
__version__ = 0.1
__date__ = '2015-12-19'
__updated__ = '2015-12-19'

from sys import path
path.insert(0, './Pipe')
import pipe as P


def work(
        in_y_train_csv,
        in_train_feat_csv,
        in_test_feat_csv,
        in_test_labels_csv,
        seed,
        n_est,
        max_depth,
        nclone,
        out_csv_file):

    from pypipes import as_csv_rows
    from nppipes import repeat

    y_train = (
        in_y_train_csv
        | as_csv_rows
        | P.select(lambda x: float(x[1]))
        | P.as_list
        | repeat(nclone)