Exemplo n.º 1
0
def developerRec(challenge):
    data = []
    # tashid, title,detail, duration, tec, lan, prize, startdate, diffdeg, tasktype
    data.append(challenge.chId)
    data.append(challenge.title)
    data.append(challenge.requirment)
    data.append(10)
    tec = str(challenge.technology).replace(' ', ',')
    data.append(tec)
    data.append(tec)
    data.append(challenge.award)
    data.append(2996)
    data.append(0.01600)
    data.append(challenge.chtype)

    # modelType = data[9]
    dataType = data[9]
    dataSet = initDataSet(data, tasktype=dataType)
    dataSet.encodingFeature(1)
    saveTaskData(dataSet)

    genDataSet(dataType, mode=2, testInst=True)
    data = TopcoderWin(dataType, testratio=1, validateratio=0)
    data.setParameter(dataType, 2, True)
    data.loadData()
    data.WinClassificationData()

    model = PolicyModel(dataType)
    regYs, subYs, winYs, top_r, top_s = model.TuneTempResults(data.testX, False)  # 测试数据
    username = model.predictUsers(regYs[0], subYs[0], winYs[0], top_r, top_s)
    print(username)
    return username
Exemplo n.º 2
0
def recommend(challenge):
    data = []
    # tashid, title,detail, duration, tec, lan, prize, startdate, diffdeg, tasktype
    data.append(challenge.id)
    data.append(challenge.title)
    data.append(challenge.requirment)
    data.append(10)
    data.append(challenge.technology)
    data.append(challenge.technology)
    data.append(challenge.award)
    data.append(2996)
    data.append(0.01600)
    data.append(challenge.chtype)

    # modelType = data[9]
    dataType = data[9]
    dataSet = initDataSet(data, tasktype=dataType)
    dataSet.encodingFeature(1)
    saveTaskData(dataSet)

    genDataSet(dataType, mode=2, testInst=True)
    data = TopcoderWin(dataType, testratio=1, validateratio=0)
    data.setParameter(dataType, 2, True)
    data.loadData()
    data.WinClassificationData()
    # search
    model = PolicyModel(dataType)
    regYs, subYs, winYs = model.TuneTempResults(data.testX)  # 测试数据
    username = generateSearchData(False, dataType, regYs, subYs, winYs)
    print(username)
    return username
Exemplo n.º 3
0
def transferLearningTest(tasktypes, datatype):
    data = TopcoderWin(datatype, testratio=1, validateratio=0)
    data.setParameter(datatype, 2, True)
    data.loadData()
    data.WinClassificationData()
    mymetric = TopKMetrics(tasktype=datatype, testMode=True)

    for tasktype in tasktypes["keeped"]:

        model = DNNCLassifier()
        model.name = tasktype + "-classifier" + ModeTag[mode]
        model.loadModel()

        testAcc(mymetric=mymetric, model=model, data=data, testK=(1, 2))

    exit(10)
Exemplo n.º 4
0
    from DataPrepare.TaskUserInstances import *
    data = []
    # tashid, title,detail, duration, tec, lan, prize, startdate, diffdeg, tasktype
    data.append(300267)
    data.append('BCMS Web Bug Hunt 3 - Firefox on PC')
    detail = 'The client is looking for a solution for key teams within our company to keep critical services working in the event of a major disaster (ranging from major technical infrastructure failures to fires and other local environmental disasters). The Business Continuity Mobility Solution should allow them to manage at least three key functions:This bug hunt will attempt to identify as many issues as possible in a short amount of time, across all aspects of the application.The scope of this contest is only Firefox on PC. See below for how to log the bugs correctly so they count for the bug hunt.'
    data.append(detail)
    data.append(2)
    data.append('HTML,JavaScript')
    data.append('HTML,JavaScript')
    data.append(5002)
    data.append(2996)
    data.append(0.01600)
    data.append('Bug Hunt')

    dataType = data[9]
    dataSet = initDataSet(data, tasktype=dataType)
    dataSet.encodingFeature(1)
    data = getTaskData(dataSet)

    genDataSet(dataType, mode=2, testInst=True)
    data = TopcoderWin(dataType, testratio=1, validateratio=0)
    data.setParameter(dataType, 2, True)
    data.loadData()
    data.WinClassificationData()

    model = PolicyModel(dataType)
    regYs, subYs, winYs, top_r, top_s = model.TuneTempResults(
        data.testX, False)  # 测试数据
    username = model.predictUsers(regYs[0], subYs[0], winYs[0], top_r, top_s)
    print(username)
def loadTestData(tasktype,clipratio=1.0,dropratio=0.0):
    data=TopcoderWin(tasktype,testratio=clipratio,validateratio=dropratio)
    data.setParameter(tasktype,2,True)
    data.loadData()
    data.WinClassificationData()
    return data