def test_train_classifier_with_classifier(): malware_rate = 0.45 partition_size = 0.92 mlf.load_json_data(malware_rate) mlf.partition_data(partition_size) mlf.select_classifier("Decision Tree") mlf.train_classifier()
def test_calculate_classifier_accuracy_with_classifier(): malware_rate = 0.33 partition_size = 0.33 mlf.load_json_data(malware_rate) mlf.partition_data(partition_size) mlf.select_classifier("Decision Tree") mlf.train_classifier() ret_val = mlf.calculate_classifier_accuracy() assert isinstance(ret_val, float)
def test_classify_new_data_with_classifier(): malware_rate = 0.33 partition_size = 0.33 mlf.load_json_data(malware_rate) mlf.partition_data(partition_size) mlf.select_classifier("Decision Tree") mlf.train_classifier() ret_val = mlf.classify_new_data() assert isinstance(ret_val, numpy.ndarray)
def test_display_confusion_matrix_pass(): malware_rate = 0.33 partition_size = 0.33 mlf.REPORT.create_new_report_directory() mlf.load_json_data(malware_rate) mlf.partition_data(partition_size) mlf.select_classifier("Decision Tree") mlf.train_classifier() mlf.classify_new_data() mlf.display_confusion_matrix()
def test_train_classifier_without_classifier(): ret_val = mlf.train_classifier() assert isinstance(ret_val, str)