# Path: discomll/dataset.py
# class Data:
#     def __init__(self, data_tag, X_indices, **kwargs):
#     def generate_urls(self, first_url, last_url):
# 
# Path: discomll/ensemble/distributed_weighted_forest_rand.py
# def simple_init(interface, params):
# def map_init(interface, params):
# def map_fit(interface, state, label, inp):
# def reduce_fit(interface, state, label, inp):
# def map_predict(interface, state, label, inp):
# def fit(dataset, trees_per_chunk=3, max_tree_nodes=50, min_samples_leaf=10, min_samples_split=5, class_majority=1,
#         measure="info_gain", num_medoids=10, accuracy=1, separate_max=True, random_state=None, save_results=True,
#         show=False):
# def predict(dataset, fitmodel_url, coeff=0.5, save_results=True, show=False):


from discomll import dataset
from discomll.ensemble import distributed_weighted_forest_rand

train = dataset.Data(data_tag=["http://ropot.ijs.si/data/lymphography/train/xaaaaa.gz",
                               "http://ropot.ijs.si/data/lymphography/train/xaaabj.gz"],
                     data_type="gzip",
                     generate_urls=True,
                     X_indices=range(2, 20),
                     id_index=0,
                     y_index=1,
                     X_meta=["d", "d", "d", "d", "d", "d", "d", "d", "c", "c", "d", "d", "d", "d", "d", "d", "d", "c"],
                     delimiter=",")

test = dataset.Data(data_tag=["http://ropot.ijs.si/data/lymphography/test/xaaaaa.gz",
                              "http://ropot.ijs.si/data/lymphography/test/xaaabj.gz"],
                    data_type="gzip",
                    generate_urls=True,
                    X_indices=range(2, 20),
                    id_index=0,
                    y_index=1,
                    X_meta=["d", "d", "d", "d", "d", "d", "d", "d", "c", "c", "d", "d", "d", "d", "d", "d", "d", "c"],
                    delimiter=",")

fit_model = distributed_weighted_forest_rand.fit(train, trees_per_chunk=3, max_tree_nodes=50, min_samples_leaf=10,
                                                 min_samples_split=5, class_majority=1, measure="info_gain",
                                                 num_medoids=10, accuracy=1, separate_max=True, random_state=None,
                                                 save_results=True)

# Path: discomll/dataset.py
# class Data:
#     def __init__(self, data_tag, X_indices, **kwargs):
#     def generate_urls(self, first_url, last_url):
# 
# Path: discomll/ensemble/distributed_weighted_forest_rand.py
# def simple_init(interface, params):
# def map_init(interface, params):
# def map_fit(interface, state, label, inp):
# def reduce_fit(interface, state, label, inp):
# def map_predict(interface, state, label, inp):
# def fit(dataset, trees_per_chunk=3, max_tree_nodes=50, min_samples_leaf=10, min_samples_split=5, class_majority=1,
#         measure="info_gain", num_medoids=10, accuracy=1, separate_max=True, random_state=None, save_results=True,
#         show=False):
# def predict(dataset, fitmodel_url, coeff=0.5, save_results=True, show=False):


# Path: discomll/examples/big_data/dwfr_lymphography.py
from discomll import dataset
from discomll.ensemble import distributed_weighted_forest_rand


train = dataset.Data(data_tag=["http://ropot.ijs.si/data/lymphography/train/xaaaaa.gz",
                               "http://ropot.ijs.si/data/lymphography/train/xaaabj.gz"],
                     data_type="gzip",
                     generate_urls=True,
                     X_indices=range(2, 20),
                     id_index=0,
                     y_index=1,
                     X_meta=["d", "d", "d", "d", "d", "d", "d", "d", "c", "c", "d", "d", "d", "d", "d", "d", "d", "c"],
                     delimiter=",")

test = dataset.Data(data_tag=["http://ropot.ijs.si/data/lymphography/test/xaaaaa.gz",
                              "http://ropot.ijs.si/data/lymphography/test/xaaabj.gz"],
                    data_type="gzip",
                    generate_urls=True,
                    X_indices=range(2, 20),
                    id_index=0,
                    y_index=1,
                    X_meta=["d", "d", "d", "d", "d", "d", "d", "d", "c", "c", "d", "d", "d", "d", "d", "d", "d", "c"],
                    delimiter=",")

fit_model = distributed_weighted_forest_rand.fit(train, trees_per_chunk=3, max_tree_nodes=50, min_samples_leaf=10,
                                                 min_samples_split=5, class_majority=1, measure="info_gain",
                                                 num_medoids=10, accuracy=1, separate_max=True, random_state=None,
                                                 save_results=True)

predict_url = distributed_weighted_forest_rand.predict(test, fit_model)