Commit 0492a38e authored by Marco Chierici's avatar Marco Chierici
Browse files

Dropped unused imports; minor improvements

parent a128b05f
......@@ -8,25 +8,24 @@ import numpy as np
import pandas as pd
import csv
import os.path
from scaling import norm_l2
from mlpy import borda_count, canberra_stability
from input_output import load_data
import performance as perf
import sys
import tarfile
import glob
import argparse
import configparser as ConfigParser
from sklearn.ensemble import RandomForestClassifier
from sklearn.multiclass import OneVsRestClassifier
from sklearn.metrics import roc_auc_score, matthews_corrcoef, accuracy_score
from sklearn import preprocessing
from sklearn.model_selection import StratifiedKFold, StratifiedShuffleSplit, train_test_split
import bootstrapped.bootstrap as bs
import bootstrapped.stats_functions as bs_stats
__author__ = 'Marco Chierici, Alessandro Zandona'
__version__ = '2.0'
__date__ = '15 December 2016'
__author__ = 'Marco Chierici'
__version__ = '2.5'
__date__ = '28 Nov 2019'
class myArgumentParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
......@@ -68,8 +67,8 @@ RANKFEATS = args.rankFeats
relief_k = args.reliefk
BASEFILE = os.path.splitext(os.path.basename(DATAFILE))[0]
SVM_TYPE = 'RandomForest'
OUTFILE = os.path.join(OUTDIR, '_'.join([BASEFILE, SVM_TYPE, 'RF' if RANK_METHOD=='randomForest' else RANK_METHOD]))
MODEL_TYPE = 'RandomForest'
OUTFILE = os.path.join(OUTDIR, '_'.join([BASEFILE, MODEL_TYPE, 'RF' if RANK_METHOD=='randomForest' else RANK_METHOD]))
# create OUTDIR if not present
try:
......@@ -82,7 +81,7 @@ except OSError:
if RANK_METHOD == 'ReliefF':
from relief import ReliefF
# add ReliefF K to OUTFILE
OUTFILE = os.path.join(OUTDIR, '_'.join([BASEFILE, SVM_TYPE, RANK_METHOD + str(relief_k)]))
OUTFILE = os.path.join(OUTDIR, '_'.join([BASEFILE, MODEL_TYPE, RANK_METHOD + str(relief_k)]))
elif RANK_METHOD == 'tree' :
from sklearn.ensemble import ExtraTreesClassifier
elif RANK_METHOD == 'KBest':
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment