def prepare_classify_mode(dataset_name, current_patient_name): fc.candidatesDataFile = neuro_networks_path + "candidates_" + current_patient_name + ".csv" fc.neuroNetworkFile = neuro_networks_path + "network_" + dataset_name + ".xml" fc.reportDataFile = neuro_networks_path + "report_" + dataset_name + ".txt" fc.bestNetworkFile = neuro_networks_path + "best_nn_" + dataset_name + ".xml" fc.bestNetworkInfoFile = neuro_networks_path + "best_nn_" + dataset_name + ".txt" fc.sepSymbol = "," fc.showExpected = False #SetLevel("DEBUG") SetLevel("ERROR")
def prepare_learning_mode(dataset_name): fc.ethalonsDataFile = neuro_networks_path + "ethalons_" + dataset_name + ".csv" fc.neuroNetworkFile = neuro_networks_path + "network_" + dataset_name + ".xml" fc.reportDataFile = neuro_networks_path + "report_" + dataset_name + ".txt" fc.bestNetworkFile = neuro_networks_path + "best_nn_" + dataset_name + ".xml" fc.bestNetworkInfoFile = neuro_networks_path + "best_nn_" + dataset_name + ".txt" fc.sepSymbol = "," fc.showExpected = True #SetLevel("DEBUG") SetLevel("ERROR")
def classify(): fc.reportDataFile = "report.txt" fc.sepSymbol = "," fc.showExpected = True SetLevel("DEBUG") parameters = { "config": str(num_columns) + ",3,2,1", "epochs": 100, "rate": 0.5, "momentum": 0.5, "epsilon": 0.05, "stop": 1 } fc.Main(classifyParameters=parameters)
def train_classifier(): fc.ethalonsDataFile = "ethalons.dat" fc.candidatesDataFile = "candidates.dat" fc.neuroNetworkFile = "network.xml" fc.sepSymbol = "," SetLevel("DEBUG") parameters = { "config": str(num_columns) + ",3,2,1", "epochs": 100, "rate": 0.5, "momentum": 0.5, "epsilon": 0.05, "stop": 1 } fc.Main(learnParameters=parameters)
replace_with = float(data[column].sum()) / data.shape[0] data[column].fillna(replace_with, inplace=True) data.to_csv(resource_path + "without_nan.csv") train, test = train_test_split(data, test_size=0.3, random_state=0) #test["Class"].replace({0: "", 1: ""}, inplace=True) train.to_csv("ethalons.dat", index=False) test.to_csv("candidates.dat", index=False) fc.EthalonDataFile = "ethalons.dat" fc.candidatesDataFile = "candidates.dat" fc.neuroNetworkFile = "network.xml" fc.sepSymbol = "," SetLevel("DEBUG") parameters = { "config": str(num_columns) + ",3,2,1", "epochs": 120, "rate": 0.6, "momentum": 0.38, "epsilon": 0.044, "stop": 1} fc.Main(learnParameters=parameters) fc.reportDataFile = "report.txt" fc.sepSymbol = "," fc.showExpected = True SetLevel("DEBUG") parameters = {