# Path: utility/dumpload.py
# class DumpLoad:
#     def __init__(self, pickle_filepath):
#         self.pickle_filepath = pickle_filepath
#         dir_path = os.path.dirname(pickle_filepath)
#         if not os.path.exists(dir_path):
#             os.makedirs(dir_path)
#         
#         return
#     def load(self):
#         with open(self.pickle_filepath, 'rb') as handle:
#             dataset = pickle.load(handle)
#         return dataset
#     def isExisiting(self):
#         return os.path.exists(self.pickle_filepath) 
#     def run(self):
#         self.dump((np.arange(10), np.arange(20)))
#         print(self.load())
#         return
#     
#     def dump(self, dataset):
#         with open(self.pickle_filepath, 'wb') as f:
#             pickle.dump(dataset, f, pickle.HIGHEST_PROTOCOL)
#         return


import sys
import os
from utility.dumpload import DumpLoad
from decisiontreemodel import DecisionTreeModel
from knnmodel import KNNModel
sys.path.insert(0, os.path.abspath('..'))



class LoadedModel:
    def __init__(self):
        return
    def loadmodel (self):
        filename = r'2016_06_11_08_31_01_estimator.pickle'
        filepath = r'C:\Users\jianz\workspace\sdfp\implement\logs\\' + filename
        dumpload = DumpLoad(filepath)
        self.model = dumpload.load()

# Path: utility/dumpload.py
# class DumpLoad:
#     def __init__(self, pickle_filepath):
#         self.pickle_filepath = pickle_filepath
#         dir_path = os.path.dirname(pickle_filepath)
#         if not os.path.exists(dir_path):
#             os.makedirs(dir_path)
#         
#         return
#     def load(self):
#         with open(self.pickle_filepath, 'rb') as handle:
#             dataset = pickle.load(handle)
#         return dataset
#     def isExisiting(self):
#         return os.path.exists(self.pickle_filepath) 
#     def run(self):
#         self.dump((np.arange(10), np.arange(20)))
#         print(self.load())
#         return
#     
#     def dump(self, dataset):
#         with open(self.pickle_filepath, 'wb') as f:
#             pickle.dump(dataset, f, pickle.HIGHEST_PROTOCOL)
#         return


# Path: implement/loadedmodel.py
import sys
import os
from utility.dumpload import DumpLoad
from decisiontreemodel import DecisionTreeModel
from knnmodel import KNNModel

sys.path.insert(0, os.path.abspath('..'))



class LoadedModel:
    def __init__(self):
        return
    def loadmodel (self):
        filename = r'2016_06_11_08_31_01_estimator.pickle'
        filepath = r'C:\Users\jianz\workspace\sdfp\implement\logs\\' + filename
        dumpload = DumpLoad(filepath)
        self.model = dumpload.load()

        return