def __init__(self, dic_path='..'): self.Analysis = Analyzer() self.dic_path = dic_path self.DataVis = DataVis() course_initialization = Course_Initialization() course_initialization.set_course_data_path(self.dic_path)
def predict_by_decision_tree(self, x_data, y_data, test_size=0.10): analysis = Analyzer() x_train, x_test, y_train, y_test = analysis.Predictive_Analysis.split_training_and_testing( x_data, y_data, test_size=test_size) analysis.Predictive_Analysis.decision_tree(x_train, x_test, y_train, y_test)
def __init__(self, args): if match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", args.db): # the db is on device so we need to grab a local copy scp = ScpClient(ip=args.db) db_path = scp.select_and_fetch_db() else: db_path = args.db self.analyzer = Analyzer(db_path, signature_list, args.group, args.sub_group, args.list)
def predict_by_svm(self, x_data, y_data, test_size=0.10, kernel='linear'): analysis = Analyzer() x_train, x_test, y_train, y_test = analysis.Predictive_Analysis.split_training_and_testing( x_data, y_data, test_size=test_size) analysis.Predictive_Analysis.svm(x_train, x_test, y_train, y_test, kernel=kernel)
def predict_by_random_forest(self, x_data, y_data, test_size=0.10, tree_amount=10, max_depth=2, random_state=0): analysis = Analyzer() x_train, x_test, y_train, y_test = analysis.Predictive_Analysis.split_training_and_testing( x_data, y_data, test_size=test_size) analysis.Predictive_Analysis.random_forest(x_train, x_test, y_train, y_test, tree_amount=tree_amount, max_depth=max_depth, random_state=random_state)
def __init__(self): self.analyzer = Analyzer()
def getAnalyzer(self): analyzer = Analyzer() return analyzer