# Path: discomll/dataset.py
# class Data:
#     def __init__(self, data_tag, X_indices, **kwargs):
#     def generate_urls(self, first_url, last_url):
# 
# Path: discomll/classification/logistic_regression.py
# def simple_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, alpha=1e-8, max_iterations=10, save_results=True, show=False):
# def predict(dataset, fitmodel_url, save_results=True, show=False):
#     H = [0 for i in range(len(state["X_indices"]) + 1)]
#     J = [0]  # J cost function values for every iteration
# 
# Path: discomll/utils/model_view.py
# def output_model(fitmodel_url):
# def _rf_model(fitmodel):
# def _dt_model(fitmodel):
# def _kmeans_model(fitmodel):
# def _linsvm_model(fitmodel):
# def _logreg_model(fitmodel):
# def _linreg_model(fitmodel):
# def _naivebayes_model(fitmodel):
# def _tree_view(tree, feature_names=[]):


from discomll import dataset
from discomll.classification import logistic_regression
from discomll.utils import model_view

# define training dataset
train = dataset.Data(data_tag=["test:ex4"],
                     data_type="chunk",
                     X_indices=xrange(0, 2),
                     y_index=2,
                     y_map=["0.0000000e+00", "1.0000000e+00"])

# fit model on training dataset
fit_model = logistic_regression.fit(train)

# output model
model = model_view.output_model(fit_model)

# Path: discomll/dataset.py
# class Data:
#     def __init__(self, data_tag, X_indices, **kwargs):
#     def generate_urls(self, first_url, last_url):
# 
# Path: discomll/classification/logistic_regression.py
# def simple_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, alpha=1e-8, max_iterations=10, save_results=True, show=False):
# def predict(dataset, fitmodel_url, save_results=True, show=False):
#     H = [0 for i in range(len(state["X_indices"]) + 1)]
#     J = [0]  # J cost function values for every iteration
# 
# Path: discomll/utils/model_view.py
# def output_model(fitmodel_url):
# def _rf_model(fitmodel):
# def _dt_model(fitmodel):
# def _kmeans_model(fitmodel):
# def _linsvm_model(fitmodel):
# def _logreg_model(fitmodel):
# def _linreg_model(fitmodel):
# def _naivebayes_model(fitmodel):
# def _tree_view(tree, feature_names=[]):


# Path: discomll/examples/classification/logistic_regression_ddfs.py
from discomll import dataset
from discomll.classification import logistic_regression
from discomll.utils import model_view


# define training dataset
train = dataset.Data(data_tag=["test:ex4"],
                     data_type="chunk",
                     X_indices=xrange(0, 2),
                     y_index=2,
                     y_map=["0.0000000e+00", "1.0000000e+00"])

# fit model on training dataset
fit_model = logistic_regression.fit(train)

# output model
model = model_view.output_model(fit_model)

print model