Skip to content

Commit

Permalink
add importDefaultClassifier()
Browse files Browse the repository at this point in the history
  • Loading branch information
luponzo86 committed Nov 3, 2019
1 parent 2cc2dfc commit a8a34af
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion rhapsody/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import tarfile
import pickle
import urllib.request
import shutil
import sklearn
Expand All @@ -13,7 +14,7 @@

__all__ = ['DEFAULT_FEATSETS', 'initialSetup',
'getDefaultTrainingDataset', 'getDefaultClassifiers',
'delSettings', 'getSettings']
'importDefaultClassifier', 'delSettings', 'getSettings']

USERHOME = os.getenv('USERPROFILE') or os.getenv('HOME') or './'
DEFAULT_WORKING_DIR = os.path.join(USERHOME, 'rhapsody')
Expand Down Expand Up @@ -232,6 +233,18 @@ def getDefaultClassifiers():
return def_clsfs


def importDefaultClassifier(version):
"""Imports the specified classifier and its summary
:arg version: either 'full', 'reduced' or 'EVmut'
:type version: str
"""
assert version in ['full', 'reduced', 'EVmut']
with open(getDefaultClassifiers()[version], 'rb') as p:
clsf = pickle.load(p)
return clsf


def delSettings():
for entry in ['rhapsody_local_folder', 'rhapsody_training_dataset',
'EVmutation_local_folder', 'EVmutation_metrics']:
Expand Down

0 comments on commit a8a34af

Please sign in to comment.