def main(): print 'Main' data = DataExtractorFactory.getDataExtractor('expertmodel', 'data/') expertsData = data.getAllExpertsData() clusterer = UsersClustering(expertsData) clusterer.getExpertRegions('tech') '''
def main(): print 'Main' dataDirectory = 'data/' start = time.time() data = DataExtractorFactory.getDataExtractor('expertisemodel', dataDirectory) expertUsersData = data.getAllExpertsData() region = Region((50, -125), (25.255, -60),center = (30,-60) ,expertise='vc') UsersData.addUserDataToRegions(expertUsersData) usersBucket = BucketUsers(region, 50) print time.time() - start,' is the time taken' usersBucket.printBuckets()
def __init__(self, dataDirectory, dataExtractor=None): self._dictExpertiseRegions.clear() self._dictExpertModels.clear() self._dataDirectory = dataDirectory if dataExtractor == None: self._expertDataExtractor = DataExtractorFactory.getDataExtractor("expertisemodel", self._dataDirectory) self._expertDataExtractor.populateData(self._dataDirectory) else: self._expertDataExtractor = dataExtractor self._dictExpertUsersData = self._expertDataExtractor.getAllExpertsData() self._createParentRegions() UsersData.addUserDataToRegions(self._dictExpertUsersData)
def __init__(self, dataDirectory): ''' Constructor ''' self._dataDirectory = dataDirectory self._dataExtractor = DataExtractorFactory.getDataExtractor('expertmodel', dataDirectory)
def __init__(self, dataDirectory, cachedModelsFileName = ''): self._cachedModelsFileName = cachedModelsFileName self._dataDirectory = dataDirectory self._expertDataExtractor = DataExtractorFactory.getDataExtractor('expertmodel', dataDirectory)