Commit 7507f448 authored by Marco Chierici's avatar Marco Chierici
Browse files

Import only required modules from mlpy

parent bedbd3ad
......@@ -4,12 +4,11 @@
## Requires Python >= 2.7, mlpy >= 3.5
from __future__ import division
import numpy as np
import csv
import os.path
from scaling import norm_l2
import mlpy
from mlpy import bootstrap_ci, borda_count, canberra_stability
from input_output import load_data
import performance as perf
import sys
......@@ -233,31 +232,31 @@ ADOR_APPROX = (ASENS / (1 - ASPEC)) / ((1 - ASENS) / ASPEC)
# confidence intervals
NPVCI = []
for i in range(NPV.shape[1]):
NPVCI.append(mlpy.bootstrap_ci(NPV[:, i]))
NPVCI.append(bootstrap_ci(NPV[:, i]))
PPVCI = []
for i in range(PPV.shape[1]):
PPVCI.append(mlpy.bootstrap_ci(PPV[:, i]))
PPVCI.append(bootstrap_ci(PPV[:, i]))
SENSCI = []
for i in range(SENS.shape[1]):
SENSCI.append(mlpy.bootstrap_ci(SENS[:, i]))
SENSCI.append(bootstrap_ci(SENS[:, i]))
SPECCI = []
for i in range(SPEC.shape[1]):
SPECCI.append(mlpy.bootstrap_ci(SPEC[:, i]))
SPECCI.append(bootstrap_ci(SPEC[:, i]))
MCCCI = []
for i in range(MCC.shape[1]):
MCCCI.append(mlpy.bootstrap_ci(MCC[:, i]))
MCCCI.append(bootstrap_ci(MCC[:, i]))
AUCCI = []
for i in range(AUC.shape[1]):
AUCCI.append(mlpy.bootstrap_ci(AUC[:, i]))
AUCCI.append(bootstrap_ci(AUC[:, i]))
DORCI = []
for i in range(DOR.shape[1]):
DORCI.append(mlpy.bootstrap_ci(DOR[:, i]))
DORCI.append(bootstrap_ci(DOR[:, i]))
ACCCI = []
for i in range(ACC.shape[1]):
ACCCI.append(mlpy.bootstrap_ci(ACC[:, i]))
ACCCI.append(bootstrap_ci(ACC[:, i]))
# Borda list
BORDA_ID, _, BORDA_POS = mlpy.borda_count(RANKING)
BORDA_ID, _, BORDA_POS = borda_count(RANKING)
# optimal number of features (yielding max MCC)
opt_feats = FSTEPS[np.argmax(AMCC)]
......@@ -265,7 +264,7 @@ opt_feats = FSTEPS[np.argmax(AMCC)]
STABILITY = []
PR = np.argsort( RANKING )
for ss in FSTEPS:
STABILITY.append( mlpy.canberra_stability(PR, ss) )
STABILITY.append( canberra_stability(PR, ss) )
metrics_w.writerow(["FS_WITH_BEST_MCC", opt_feats])
metrics_w.writerow(["STEP",
......
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