Example #1
0
def monitoring(matrix, rate, roundId, para):
    startTime = time.clock()
    logger.info('rate=%.2f, %2d-round starts.'%(rate, roundId + 1))

    # sampling
    logger.info('CS-PCA sampling...')
    startTime = time.clock() # to record the running time for one round
    (trainMatrix, observedMatrix, testMatrix) = CS_PCA.sampling(matrix, rate, roundId, para)

    # CS-PCA algorithm
    logger.info('CS-PCA estimation...')
    recoveredMatrix = CS_PCA.recover(trainMatrix, observedMatrix, para)
    runningTime = float(time.clock() - startTime) 
    
    # evaluate the estimation error  
    evalResult = evallib.evaluate(testMatrix, recoveredMatrix, para)
    result = (evalResult, runningTime)
    
    # dump the result at each rate
    outFile = '%s%s%s_result_%.2f%s.tmp'%(para['outPath'], para['dataName'], 
        ('_%s'%para['dataType'] if ('dataType' in para.keys()) else ''), rate, 
        '_round%02d'%(roundId + 1) if (para['rounds'] > 1) else '')
    evallib.dumpresult(outFile, result)
    
    logger.info('rate=%.2f, %2d-round done.'%(rate, roundId + 1))
    logger.info('----------------------------------------------')
Example #2
0
def executeOneSetting(matrix, density, roundId, sliceId, para):
    (numUser, numService) = matrix.shape
    dim = para['dimension']

    # remove data entries to generate trainMatrix and testMatrix
    seedID = roundId + sliceId * 100
    (trainMatrix, testMatrix) = evallib.removeEntries(matrix, density, seedID)
    (testVecX, testVecY) = np.where(testMatrix)
    testVec = testMatrix[testVecX, testVecY]

    # invocation to the prediction function
    startTime = time.clock()
    predictedMatrix = PMF.predict(trainMatrix, para)
    runningTime = float(time.clock() - startTime)

    # evaluate the prediction error
    predVec = predictedMatrix[testVecX, testVecY]
    evalResult = evallib.errMetric(testVec, predVec, para['metrics'])
    result = (evalResult, runningTime)

    # dump the result at each density
    outFile = '%s%s_%s_result_%02d_%.2f_round%02d.tmp' % (
        para['outPath'], para['dataName'], para['dataType'], sliceId + 1,
        density, roundId + 1)
    evallib.dumpresult(outFile, result)
    logger.info('density=%.2f, sliceId=%02d, %2d-round done.'\
        %(density, sliceId + 1, roundId + 1))
Example #3
0
def executeOneSetting(matrix, density, roundId, sliceId, para):
    (numUser, numService) = matrix.shape
    dim = para['dimension']

    # remove data entries to generate trainMatrix and testMatrix  
    seedID = roundId + sliceId * 100
    (trainMatrix, testMatrix) = evallib.removeEntries(matrix, density, seedID)
    (testVecX, testVecY) = np.where(testMatrix)     
    testVec = testMatrix[testVecX, testVecY]

    # invocation to the prediction function
    startTime = time.clock() 
    predictedMatrix = PMF.predict(trainMatrix, para)
    runningTime = float(time.clock() - startTime)

    # evaluate the prediction error  
    predVec = predictedMatrix[testVecX, testVecY]
    evalResult = evallib.errMetric(testVec, predVec, para['metrics'])
    result = (evalResult, runningTime)

    # dump the result at each density
    outFile = '%s%s_%s_result_%02d_%.2f_round%02d.tmp'%(para['outPath'], 
        para['dataName'], para['dataType'], sliceId + 1, density, roundId + 1)
    evallib.dumpresult(outFile, result)  
    logger.info('density=%.2f, sliceId=%02d, %2d-round done.'\
        %(density, sliceId + 1, roundId + 1))
Example #4
0
def monitoring(matrix, rate, para):
    startTime = time.clock()
    logger.info("rate=%.2f starts." % rate)

    # JGD algorithm
    startTime = time.clock()  # to record the running time for one round
    trainingPeriod = para["trainingPeriod"]
    trainMatrix = matrix[:, 0:trainingPeriod]
    testMatrix = matrix[:, trainingPeriod:]
    logger.info("monitor selection...")
    (selectedMonitors, toEstimateNodes) = JGD.selectMonitor(trainMatrix, rate, para)
    observedMatrix = testMatrix[selectedMonitors, :]
    logger.info("JGD estimation...")
    recoveredMatrix = JGD.recover(trainMatrix, observedMatrix, selectedMonitors, toEstimateNodes)
    runningTime = float(time.clock() - startTime)

    # evaluate the estimation error
    evalResult = evallib.evaluate(testMatrix, recoveredMatrix, para)
    result = (evalResult, runningTime)

    # dump the result at each rate
    outFile = "%s%s%s_result_%.2f.tmp" % (
        para["outPath"],
        para["dataName"],
        "_%s" % para["dataType"] if ("dataType" in para.keys()) else "",
        rate,
    )
    evallib.dumpresult(outFile, result)

    logger.info("rate=%.2f done." % rate)
    logger.info("----------------------------------------------")
Example #5
0
def monitoring(matrix, rate, roundId, para):
    startTime = time.clock()
    logger.info('rate=%.2f, %2d-round starts.'%(rate, roundId + 1))

    # sampling
    logger.info('CS sampling...')
    startTime = time.clock() # to record the running time for one round
    # sorting in ascending and permutation
    idx = np.argsort(-matrix[:, 0])
    matrix = matrix[idx, :]
    (trainMatrix, observedMatrix, testMatrix) = CS.sampling(matrix, rate, roundId, para)

    # CS algorithm
    logger.info('CS estimation...')
    recoveredMatrix = CS.recover(trainMatrix, observedMatrix, para)
    plot((matrix[:,30]), '-o')
    plot(recoveredMatrix[:,30], '-x')
    show()
    # sys.exit()
    runningTime = float(time.clock() - startTime) 
    
    # evaluate the estimation error  
    evalResult = evallib.evaluate(testMatrix, recoveredMatrix, para)
    result = (evalResult, runningTime)
    
    # dump the result at each rate
    outFile = '%s%s%s_result_%.2f%s.tmp'%(para['outPath'], para['dataName'], 
        ('_%s'%para['dataType'] if ('dataType' in para.keys()) else ''), rate, 
        '_round%02d'%(roundId + 1) if (para['rounds'] > 1) else '')
    evallib.dumpresult(outFile, result)

    logger.info('rate=%.2f, %2d-round done.'%(rate, roundId + 1))
    logger.info('----------------------------------------------')
Example #6
0
def executeOneSetting(tensor, density, roundId, para):
    logger.info('density=%.2f, %2d-round starts.'%(density, roundId + 1))
    (numUser, numService, numTime) = tensor.shape

    # remove the entries of data to generate trainTensor and testTensor
    (trainTensor, testTensor) = evallib.removeTensor(tensor, density, roundId, para) 

    # invocation to the prediction function
    startTime = time.clock() # to record the running time for one round             
    predictedTensor = Average.predict(trainTensor, para) 
    runningTime = float(time.clock() - startTime) / numTime

    # evaluate the prediction error 
    for sliceId in xrange(numTime):
        testMatrix = testTensor[:, :, sliceId]
        predictedMatrix = predictedTensor[:, :, sliceId]
        (testVecX, testVecY) = np.where(testMatrix)
        testVec = testMatrix[testVecX, testVecY]
        predVec = predictedMatrix[testVecX, testVecY]
        evalResult = evallib.errMetric(testVec, predVec, para['metrics'])        
        result = (evalResult, runningTime)

        # dump the result at each density
        outFile = '%s%s_%s_result_%02d_%.2f_round%02d.tmp'%(para['outPath'], 
            para['dataName'], para['dataType'], sliceId + 1, density, roundId + 1)
        evallib.dumpresult(outFile, result)
        
    logger.info('density=%.2f, %2d-round done.'%(density, roundId + 1))
    logger.info('----------------------------------------------')
Example #7
0
def executeOneSetting(tensor, density, roundId, para):
    logger.info('density=%.2f, %2d-round starts.' % (density, roundId + 1))
    (numUser, numService, numTime) = tensor.shape
    dim = para['dimension']

    # remove the entries of data to generate trainTensor and testTensor
    (trainTensor, testTensor) = evallib.removeTensor(tensor, density, roundId,
                                                     para)

    # invocation to the prediction function
    startTime = time.clock()  # to record the running time for one round
    predictedTensor = NTF.predict(trainTensor, para)
    runningTime = float(time.clock() - startTime) / numTime

    # evaluate the prediction error
    for sliceId in xrange(numTime):
        testMatrix = testTensor[:, :, sliceId]
        predictedMatrix = predictedTensor[:, :, sliceId]
        (testVecX, testVecY) = np.where(testMatrix)
        testVec = testMatrix[testVecX, testVecY]
        predVec = predictedMatrix[testVecX, testVecY]
        evalResult = evallib.errMetric(testVec, predVec, para['metrics'])
        result = (evalResult, runningTime)

        # dump the result at each density
        outFile = '%s%s_%s_result_%02d_%.2f_round%02d.tmp' % (
            para['outPath'], para['dataName'], para['dataType'], sliceId + 1,
            density, roundId + 1)
        evallib.dumpresult(outFile, result)

    logger.info('density=%.2f, %2d-round done.' % (density, roundId + 1))
    logger.info('----------------------------------------------')
Example #8
0
def executeOneSetting(matrix, density, roundId, para):
    logger.info('density=%.2f, %2d-round starts.' % (density, roundId + 1))

    # remove data matrix
    (trainMatrix, testMatrix) = evallib.removeEntries(matrix, density, roundId)

    # QoS prediction
    startTime = time.clock()  # to record the running time for one round

    predictedMatrix1 = UIPCC.UPCC(trainMatrix, para)
    predictedMatrix2 = UIPCC.IPCC(trainMatrix, para)
    predictedMatrix = UIPCC.UIPCC(trainMatrix, predictedMatrix1,
                                  predictedMatrix2, para)

    runningTime = float(time.clock() - startTime)

    # evaluate the estimation error
    evalResult = evallib.evaluate(testMatrix, predictedMatrix, para)
    result = (evalResult, runningTime)

    # dump the result at each density
    outFile = '%s%s_%s_result_%.2f_round%02d.tmp' % (
        para['outPath'], para['dataName'], para['dataType'], density,
        roundId + 1)
    evallib.dumpresult(outFile, result)

    logger.info('density=%.2f, %2d-round done.' % (density, roundId + 1))
    logger.info('----------------------------------------------')
Example #9
0
def executeOneSetting(matrix, density, roundId, para):
    logger.info('density=%.2f, %2d-round starts.'%(density, roundId + 1))
    
    # remove data matrix
    (trainMatrix, testMatrix) = evallib.removeEntries(matrix, density, roundId)

    # QoS prediction
    startTime = time.clock() # to record the running time for one round             
    predictedMatrix = NMF.predict(trainMatrix, para) 
    runningTime = float(time.clock() - startTime)

    # evaluate the estimation error  
    evalResult = evallib.evaluate(testMatrix, predictedMatrix, para)
    result = (evalResult, runningTime)

    # dump the result at each density
    outFile = '%s%s_%s_result_%.2f_round%02d.tmp'%(para['outPath'], para['dataName'], 
        para['dataType'], density, roundId + 1)
    evallib.dumpresult(outFile, result)
    
    logger.info('density=%.2f, %2d-round done.'%(density, roundId + 1))
    logger.info('----------------------------------------------')
        'topK': 10, # the parameter of TopK similar users or services, the default 
					# value is topK = 10 as in the reference paper
		'dimension': 10, # dimenisionality of the latent factors
		'etaInit': 0.01, # inital learning rate. We use line search
						 # to find the best eta at each iteration
		'lambda': 30, # L2 regularization parameter
		'alpha': 0.4,  # the parameter of combination, 0.4 as in the reference paper
		'maxIter': 300, # the max iterations
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': True, # whether to save log into file
        'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('NIMF: Neighbourhood Integrated Matrix Factorization')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')


Example #11
0
    'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE',
                'NPRE'],  # delete where appropriate      
    'density': np.arange(0.05, 0.31, 0.05),  # matrix density
    'rounds': 20,  # how many runs are performed at each matrix density
    'dimension': 10,  # dimenisionality of the latent factors
    'eta': 0.8,  # learning rate
    'lambda': 0.0002,  # regularization parameter
    'maxIter': 50,  # the max iterations
    'convergeThreshold': 5e-2,  # stopping criteria for convergence
    'beta': 0.3,  # the controlling weight of exponential moving average
    'saveTimeInfo': True,  # whether to keep track of the running time
    'saveLog': True,  # whether to save log into file
    'debugMode': False,  # whether to record the debug info
    'parallelMode': True  # whether to leverage multiprocessing for speedup
}

startTime = time.time()  # start timing
utils.setConfig(para)  # set configuration
logger.info('==============================================')
logger.info('AMF: Adaptive Matrix Factorization [TPDS]')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' +
            utils.formatElapsedTime(time.time() - startTime))  # end timing
logger.info('==============================================')
Example #12
0
        'dataName': 'google-cluster-data', # set the dataset name
        'dataType': 'cpu', # data type: cpu or memory
        'dataSample': 'day-sample', # choose 'day-sample', 'week-sample', or 'all-data'   
        'outPath': 'result/', # output path for results
        'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NNPRE', 'SNR'], # evaluation metrics  
        'samplingRate': np.arange(0.1, 0.11, 0.05), # sampling rate
        'rounds': 1, # how many runs to perform at each sampling rate
        'transform': 'DCT', # transform base: 'DCT', 'DWT-haar', or 'DWT-db4'
        'lmbda': 1e-4, # sparisty regularization parameter
        'trainingPeriod': 12, # training time periods
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': False, # whether to save log into file
        'debugMode': False, #whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }

startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('Compressive Sensing: [Luo et al., MobiCom\'2009].')

# load the dataset
dataMatrix = dataloader.load(para)
dataMatrix = dataMatrix[:,0:24]
# evaluate compressive monitoring algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #13
0
    'topK_U': 60,  # the parameter of TopK similar users, the default value is
    # topK_U = 60 as in the reference paper
    'topK_S': 300,  # the parameter of TopK similar users, the default value is
    # topK_S = 300 as in the reference paper
    'dimension': 10,  # dimenisionality of the latent factors
    'etaInit': 0.01,  # inital learning rate. We use line search
    # to find the best eta at each iteration
    'lambda': 30,  # L2 regularization parameter
    'alpha': 15,  # parameter of user and service regularization
    'maxIter': 300,  # the max iterations
    'saveTimeInfo': False,  # whether to keep track of the running time
    'saveLog': True,  # whether to save log into file
    'debugMode': False,  # whether to record the debug info
    'parallelMode': True  # whether to leverage multiprocessing for speedup
}

startTime = time.time()  # start timing
utils.setConfig(para)  # set configuration
logger.info('==============================================')
logger.info('EMF: [Lo et al., SCC 2012]')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' +
            utils.formatElapsedTime(time.time() - startTime))  # end timing
logger.info('==============================================')
Example #14
0
		'outPath': 'result/',
		'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NPRE'], # delete where appropriate		
		'density': np.arange(0.05, 0.31, 0.05), # matrix density
		'rounds': 20, # how many runs are performed at each matrix density
		'dimension': 10, # dimenisionality of the latent factors
		'etaInit': 0.001, # inital learning rate. We use line search
						 # to find the best eta at each iteration
		'lambda': 200, # regularization parameter
		'maxIter': 300, # the max iterations
		'saveTimeInfo': False, # whether to keep track of the running time
		'saveLog': True, # whether to save log into file
		'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
		}


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('PMF: Probabilistic Matrix Factorization')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')
 
Example #15
0
    'dataPath': '../../../data/',
    'dataName': 'dataset#2',
    'dataType': 'rt',  # set the dataType as 'rt' or 'tp'
    'outPath': 'result/',
    'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE',
                'NPRE'],  # delete where appropriate		
    'density': np.arange(0.05, 0.31, 0.05),  # matrix density
    'rounds': 20,  # how many runs are performed at each matrix density
    'topK': 10,  # the parameter of TopK similar users or services
    'lambda': 0.8,  # the combination coefficient of UPCC and IPCC
    'saveTimeInfo': False,  # whether to keep track of the running time
    'saveLog': True,  # whether to save log into file
    'debugMode': False,  # whether to record the debug info
    'parallelMode': True  # whether to leverage multiprocessing for speedup
}

startTime = time.time()  # start timing
utils.setConfig(para)  # set configuration
logger.info('==============================================')
logger.info('Approach: [UPCC, IPCC, UIPCC][TSC 2011]')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' +
            utils.formatElapsedTime(time.time() - startTime))  # end timing
logger.info('==============================================')
Example #16
0
# parameter config area
para = {
    'dataPath': '../../../data/',
    'dataName': 'dataset#2',
    'dataType': 'tp',  # set the dataType as 'rt' or 'tp'
    'outPath': 'result/',
    'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE',
                'NPRE'],  # delete where appropriate     
    'density': np.arange(0.05, 0.31, 0.05),  # matrix density
    'rounds': 20,  # how many runs are performed at each matrix density
    'saveTimeInfo': False,  # whether to keep track of the running time
    'saveLog': True,  # whether to save log into file
    'debugMode': False,  # whether to record the debug info
    'parallelMode': True  # whether to leverage multiprocessing for speedup
}

startTime = time.time()  # start timing
utils.setConfig(para)  # set configuration
logger.info('==============================================')
logger.info('Baseline approach: Average')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' +
            utils.formatElapsedTime(time.time() - startTime))  # end timing
logger.info('==============================================')
Example #17
0
		'topK_U': 60, # the parameter of TopK similar users, the default value is
					# topK_U = 60 as in the reference paper
		'topK_S': 300, # the parameter of TopK similar users, the default value is
					# topK_S = 300 as in the reference paper
		'dimension': 10, # dimenisionality of the latent factors
		'etaInit': 0.01, # inital learning rate. We use line search
						 # to find the best eta at each iteration
		'lambda': 30, # L2 regularization parameter
		'alpha': 15,  # parameter of user and service regularization
		'maxIter': 300, # the max iterations
		'saveTimeInfo': False, # whether to keep track of the running time
		'saveLog': True, # whether to save log into file
		'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
		}


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('EMF: [Lo et al., SCC 2012]')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')
Example #18
0
        'rounds': 20, # how many runs are performed at each matrix density
        'dimension': 10, # dimenisionality of the latent factors
		'eta': 0.0001, # learning rate
		'alpha': 0.6, # the combination coefficient
		'lambda': 5, # regularization parameter
        'maxIter': 300, # the max iterations
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': True, # whether to save log into file
        'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('LN-LFM: Latent Neighbor and Latent Factor Model')

# load the dataset
dataMatrix = dataloader.load(para)

# load the service location information
wsInfoList = dataloader.loadServInfo(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, wsInfoList, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #19
0
        'rounds': 20, # how many runs are performed at each matrix density
        'dimension': 10, # dimenisionality of the latent factors
		'eta': 0.0001, # learning rate
		'alpha': 0.6, # the combination coefficient
		'lambda': 5, # regularization parameter
        'maxIter': 300, # the max iterations
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': True, # whether to save log into file
        'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('LN-LFM: Latent Neighbor and Latent Factor Model')

# load the dataset
dataMatrix = dataloader.load(para)

# load the service location information
wsInfoList = dataloader.loadServInfo(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, wsInfoList, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #20
0
		'dataName': 'dataset#2',
		'dataType': 'rt', # set the dataType as 'rt' or 'tp'
		'outPath': 'result/',
		'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NPRE'], # delete where appropriate		
		'density': np.arange(0.05, 0.31, 0.05), # matrix density
		'rounds': 20, # how many runs are performed at each matrix density
		'dimension': 10, # dimenisionality of the latent factors
		'lambda': 35, # regularization parameter
		'maxIter': 300, # the max iterations
		'saveTimeInfo': False, # whether to keep track of the running time
		'saveLog': True, # whether to save log into file
		'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
		}


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('NTF: Non-negative Tensor Factorization [WWW 2014]')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #21
0
        'topK': 10, # the parameter of TopK similar users or services, the default 
					# value is topK = 10 as in the reference paper
		'dimension': 10, # dimenisionality of the latent factors
		'etaInit': 0.01, # inital learning rate. We use line search
						 # to find the best eta at each iteration
		'lambda': 30, # L2 regularization parameter
		'alpha': 0.4,  # the parameter of combination, 0.4 as in the reference paper
		'maxIter': 300, # the max iterations
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': True, # whether to save log into file
        'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('NIMF: Neighbourhood Integrated Matrix Factorization')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')


Example #22
0
    'outPath': 'result/',
    'metrics': ['NDCG', 'Precision'],  # delete where appropriate
    'metric_parameter': [1, 5, 10, 50, 100],
    'density': [0.01, 0.1, 0.3],  # matrix density
    'rounds': 10,  # how many runs are performed at each matrix density
    'dimension': 10,  # dimenisionality of the latent factors
    'etaInit': 0.01,  # inital learning rate. We use line search
    # to find the best eta at each iteration
    'lambda': 0.1,  # regularization parameter
    'maxIter': 300,  # the max iterations
    'saveTimeInfo': False,  # whether to keep track of the running time
    'saveLog': True,  # whether to save log into file
    'debugMode': False,  # whether to record the debug info
    'parallelMode': True  # whether to leverage multiprocessing for speedup
}

startTime = time.time()  # start timing
utils.setConfig(para)  # set configuration
logger.info('==============================================')
logger.info('PMF: Probabilistic Matrix Factorization')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' +
            utils.formatElapsedTime(time.time() - startTime))  # end timing
logger.info('==============================================')
Example #23
0
def load(para):
    if para['dataName'] == 'dataset#1':
        datafile = para['dataPath'] + para['dataName'] + '/' + para[
            'dataType'] + 'Matrix.txt'
        logger.info('Loading data: %s' % os.path.abspath(datafile))
        dataMatrix = np.loadtxt(datafile)
        logger.info('Data size: %d users * %d services'\
            %(dataMatrix.shape[0], dataMatrix.shape[1]))
    elif para['dataName'] == 'dataset#2':
        datafile = para['dataPath'] + para['dataName'] + '/' + para[
            'dataType'] + 'data.txt'
        logger.info('Loading data: %s' % os.path.abspath(datafile))
        dataMatrix = -1 * np.ones((142, 4500, 64))
        fid = open(datafile, 'r')
        for line in fid:
            data = line.split(' ')
            rt = float(data[3])
            if rt > 0:
                dataMatrix[int(data[0]), int(data[1]), int(data[2])] = rt
        fid.close()
        logger.info('Data size: %d users * %d services * %d timeslices'\
            %(dataMatrix.shape[0], dataMatrix.shape[1], dataMatrix.shape[2]))
        dataMatrix = preprocess(dataMatrix, para)
    logger.info('Loading data done.')
    logger.info('----------------------------------------------')
    return dataMatrix
Example #24
0
        'outPath': 'result/',
        'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NPRE'], # delete where appropriate      
        'density': np.arange(0.05, 0.31, 0.05), # matrix density
        'rounds': 20, # how many runs are performed at each matrix density
        'dimension': 10, # dimenisionality of the latent factors
        'eta': 0.8, # learning rate
        'lambda': 0.0002, # regularization parameter
        'maxIter': 50, # the max iterations
        'convergeThreshold': 5e-2, # stopping criteria for convergence
        'beta': 0.3, # the controlling weight of exponential moving average
        'saveTimeInfo': True, # whether to keep track of the running time
        'saveLog': True, # whether to save log into file
        'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('AMF: Adaptive Matrix Factorization [TPDS]')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')
Example #25
0
# parameter config area
para = {'dataPath': '../data/', # data path
        'dataName': 'google-cluster-data', # set the dataset name
        'dataType': 'cpu', # data type: cpu or memory
        'dataSample': 'day-sample', # choose 'day-sample', 'week-sample', or 'all-data'   
        'outPath': 'result/', # output path for results
        'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NNPRE', 'SNR'], # evaluation metrics  
        'samplingRate': np.arange(0.05, 0.95, 0.05), # sampling rate
        'rounds': 20, # how many runs to perform at each sampling rate
        'trainingPeriod': 12, # training time periods
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': True, # whether to save log into file
        'debugMode': False, #whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }

startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('Baseline approach.')

# load the dataset
dataMatrix = dataloader.load(para)
dataMatrix = dataMatrix[:,0:24]
# evaluate compressive monitoring algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #26
0
para = {'dataPath': '../../../data/',
		'dataName': 'dataset#2',
		'dataType': 'rt', # set the dataType as 'rt' or 'tp'
		'outPath': 'result/',
		'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NPRE'], # delete where appropriate		
		'density': np.arange(0.05, 0.31, 0.05), # matrix density
		'rounds': 20, # how many runs are performed at each matrix density
		'topK': 10, # the parameter of TopK similar users or services
        'lambda': 0.8, # the combination coefficient of UPCC and IPCC
		'saveTimeInfo': False, # whether to keep track of the running time
		'saveLog': True, # whether to save log into file
		'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
		}


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('Approach: [UPCC, IPCC, UIPCC][TSC 2011]')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

# parameter config area
para = {'dataPath': '../data/', # data path
        'dataName': 'Orangelab_sense_temperature', # set the dataset name     
        'outPath': 'result/', # output path for results
        'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NNPRE', 'SNR'], # evaluation metrics  
        'samplingRate': np.arange(0.05, 0.96, 0.05), # sampling rate
        'rounds': 1, # how many runs to perform at each sampling rate
        'lmbda': 1e-5, # sparisty regularization parameter
        'trainingPeriod': 33, # training time periods
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': False, # whether to save log into file
        'debugMode': False, #whether to record the debug info
        'parallelMode': False # whether to leverage multiprocessing for speedup
        }

startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('CS-PCA: [Quer et al., TWC\'2012]')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate compressive monitoring algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #28
0
    'dataName': 'dataset#2',
    'dataType': 'tp',  # set the dataType as 'rt' or 'tp'
    'outPath': 'result/',
    'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE',
                'NPRE'],  # delete where appropriate		
    'density': np.arange(0.05, 0.31, 0.05),  # matrix density
    'rounds': 20,  # how many runs are performed at each matrix density
    'dimension': 10,  # dimenisionality of the latent factors
    'lambda': 6000,  # regularization parameter
    'maxIter': 300,  # the max iterations
    'saveTimeInfo': False,  # whether to keep track of the running time
    'saveLog': True,  # whether to save log into file
    'debugMode': False,  # whether to record the debug info
    'parallelMode': True  # whether to leverage multiprocessing for speedup
}

startTime = time.time()  # start timing
utils.setConfig(para)  # set configuration
logger.info('==============================================')
logger.info('NTF: Non-negative Tensor Factorization [WWW 2014]')

# load the dataset
dataTensor = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataTensor, para)

logger.info('All done. Elaspsed time: ' +
            utils.formatElapsedTime(time.time() - startTime))  # end timing
logger.info('==============================================')
Example #29
0
		'outPath': 'result/',
		'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NPRE'], # delete where appropriate
		'density': np.arange(0.05, 0.31, 0.05), # matrix density
		'rounds': 20, # how many runs are performed at each matrix density
		'dimension': 10, # dimenisionality of the latent factors
		'etaInit': 0.001, # inital learning rate. We use line search
						 # to find the best eta at each iteration
		'lambda': 500, # regularization parameter
		'maxIter': 300, # the max iterations
		'saveTimeInfo': False, # whether to keep track of the running time
		'saveLog': True, # whether to save log into file
		'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
		}


startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('BiasedMF: Biased Matrix Factorization')

# load the dataset
dataMatrix = dataloader.load(para)

# evaluate QoS prediction algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')

Example #30
0
para = {'dataPath': '../data/', # data path
        'dataName': 'google-cluster-data', # set the dataset name
        'dataType': 'cpu', # data type: cpu or memory
        'dataSample': 'day-sample', # choose 'day-sample', 'week-sample', or 'all'      
        'outPath': 'result/', # output path for results
        'metrics': ['MAE', 'NMAE', 'RMSE', 'MRE', 'NNPRE', 'SNR'], # delete where appropriate   
        'samplingRate': np.arange(0.05, 0.06, 0.05), # sampling rate
        'monitorSelection': 'topW-Update', # monitor selection algorithm
                             # select from 'random', 'topW', 'topW-Update', 'batch-selection'
        'trainingPeriod': 12, # training time periods
        'saveTimeInfo': False, # whether to keep track of the running time
        'saveLog': False, # whether to save log into file
        'debugMode': False, # whether to record the debug info
        'parallelMode': True # whether to leverage multiprocessing for speedup
        }

startTime = time.time() # start timing
utils.setConfig(para) # set configuration
logger.info('==============================================')
logger.info('JGD: [Silvestri et al., ICDCS\'2015].')

# load the dataset
dataMatrix = dataloader.load(para)
dataMatrix = dataMatrix[:,0:24]
# evaluate compressive monitoring algorithm
evaluator.execute(dataMatrix, para)

logger.info('All done. Elaspsed time: ' + utils.formatElapsedTime(time.time() - startTime)) # end timing
logger.info('==============================================')