コード例 #1
0
    def getParameters(cls):
        selectorIDs: List[str] = BatchDefMLFuzzyDHondt().getSelectorParameters(
        ).keys()
        negativeImplFeedback: List[
            str] = cls.getNegativeImplFeedbackParameters().keys()

        aDict: Dict[str, object] = {}
        for selectorIDH in selectorIDs:
            for nImplFeedbackI in negativeImplFeedback:
                for lrClickJ in cls.lrClicks:
                    for lrViewDivisorK in cls.lrViewDivisors:

                        keyIJ: str = str(selectorIDH) + "Clk" + str(
                            lrClickJ).replace(".", "") + "ViewDivisor" + str(
                                lrViewDivisorK).replace(".",
                                                        "") + nImplFeedbackI
                        lrViewIJK: float = lrClickJ / lrViewDivisorK
                        eTool: AEvalTool = EvalToolDHondt({
                            EvalToolDHondt.ARG_LEARNING_RATE_CLICKS:
                            lrClickJ,
                            EvalToolDHondt.ARG_LEARNING_RATE_VIEWS:
                            lrViewIJK
                        })
                        nImplFeedback: APenalization = cls.getNegativeImplFeedbackParameters(
                        )[nImplFeedbackI]
                        selectorH: ADHondtSelector = BatchDefMLFuzzyDHondt(
                        ).getSelectorParameters()[selectorIDH]

                        aDict[keyIJ] = (selectorH, nImplFeedback, eTool)
        return aDict
コード例 #2
0
 def getParameters(self):
     batchDefMLFuzzyDHondt = BatchDefMLFuzzyDHondt()
     batchDefMLFuzzyDHondt.lrClicks:List[float] = self.lrClicks
     batchDefMLFuzzyDHondt.lrViewDivisors:List[float] = self.lrViewDivisors
     batchDefMLFuzzyDHondt.normOfRespons:List[bool] = self.normOfRespons
     batchDefMLFuzzyDHondt.selectorIDs:List[str] = self.selectorIDs
     return batchDefMLFuzzyDHondt.getParameters()
    def getParameters(self):

        aDict: Dict[str, object] = BatchDefMLFuzzyDHondt().getAllSelectors()

        aSubDict: Dict[str, object] = {
            selIdI: aDict[selIdI]
            for selIdI in aDict.keys() if selIdI in self.selectorIDs
        }
        return aSubDict
    def getParameters2():
        selectorIDs: List[str] = BatchDefMLFuzzyDHondt().getSelectorParameters(
        ).keys()
        negativeImplFeedback: List[str] = BatchDefMLFuzzyDHondtINF(
        ).getNegativeImplFeedbackParameters().keys()

        aDict: dict = {}
        for selectorIDH in selectorIDs:
            for nImplFeedbackI in negativeImplFeedback:
                keyIJ: str = str(selectorIDH) + nImplFeedbackI

                nImplFeedback: APenalization = BatchDefMLFuzzyDHondtINF(
                ).getNegativeImplFeedbackParameters()[nImplFeedbackI]
                selectorH: ADHondtSelector = BatchDefMLFuzzyDHondt(
                ).getSelectorParameters()[selectorIDH]

                aDict[keyIJ] = (selectorH, nImplFeedback)
        return aDict
コード例 #5
0
    def getParameters(self):

        aDict: Dict[str, object] = {}
        for selectorIDI in self.selectorIDs:
            for discFactorsI in self.discFactors:
                keyIJ: str = str(selectorIDI) + discFactorsI
                selectorIJK: ADHondtSelector = BatchDefMLFuzzyDHondt(
                ).getSelectorParameters()[selectorIDI]
                aDict[keyIJ] = (selectorIJK, discFactorsI)
        return aDict
    def getParameters(self):

        aDict: dict = {}
        for selectorIDI in self.selectorIDs:
            keyIJ: str = str(selectorIDI)
            eTool: AEvalTool = EvalToolDHondtBanditVotes({})
            selectorIJK: ADHondtSelector = BatchDefMLFuzzyDHondt(
            ).getSelectorParameters()[selectorIDI]
            aDict[keyIJ] = (selectorIJK, eTool)
        return aDict
コード例 #7
0
    def getParameters(self):

        aDict: Dict[str, object] = {}
        for selectorIDH in self.selectorIDs:
            for nImplFeedbackI in self.negativeImplFeedback:
                keyIJ: str = str(selectorIDH) + nImplFeedbackI

                nImplFeedback: APenalization = BatchDefMLFuzzyDHondtThompsonSamplingINF(
                ).getPenalFncs()[nImplFeedbackI]
                selectorH: ADHondtSelector = BatchDefMLFuzzyDHondt(
                ).getSelectorParameters()[selectorIDH]

                aDict[keyIJ] = (selectorH, nImplFeedback)
        return aDict
コード例 #8
0
    def getParameters(self):
        aDict:Dict[str,object] = {}
        for selectorIDI in self.selectorIDs:
            for lrClickJ in self.lrClicks:
                for lrViewDivisorK in self.lrViewDivisors:
                    for normOfResponsL in self.normOfRespons:

                        keyIJ:str = selectorIDI + "Clk" + str(lrClickJ).replace(".", "") + "ViewDivisor" + str(lrViewDivisorK).replace(".", "") + "NR" + str(normOfResponsL)
                        lrViewIJK:float = lrClickJ / lrViewDivisorK
                        eToolIJK:AEvalTool = EvalToolDHondtPersonal({
                                        EvalToolDHondtPersonal.ARG_LEARNING_RATE_CLICKS: lrClickJ,
                                        EvalToolDHondtPersonal.ARG_LEARNING_RATE_VIEWS: lrViewIJK,
                                        EvalToolDHondtPersonal.ARG_NORMALIZATION_OF_RESPONSIBILITY: normOfResponsL})
                        selectorIJK:ADHondtSelector = BatchDefMLFuzzyDHondt().getAllSelectors()[selectorIDI]
                        aDict[keyIJ] = (selectorIJK, eToolIJK)
        return aDict
コード例 #9
0
    def getParameters(self):
        aDict: Dict[str, object] = {}
        for selectorIDI in self.selectorIDs:
            for gLrClickJ in self.mGlobalLrClicks:
                for gLrViewDivisorK in self.mGlobalLrViewDivisors:
                    for gNormOfResponsL in self.mGlobalNormOfRespons:
                        for pLrClickM in self.mPersonLrClicks:
                            for pLrViewDivisorN in self.mPersonLrViewDivisors:
                                for pLrViewDivisorO in self.mPersonNormOfRespons:

                                    gjk: str = "Clk" + str(gLrClickJ).replace(
                                        ".", "") + "ViewDivisor" + str(
                                            gLrViewDivisorK).replace(
                                                ".", "") + "NR" + str(
                                                    gNormOfResponsL)
                                    pjk: str = "Clk" + str(pLrClickM).replace(
                                        ".", "") + "ViewDivisor" + str(
                                            pLrViewDivisorN).replace(
                                                ".", "") + "NR" + str(
                                                    pLrViewDivisorO)
                                    keyIJ: str = selectorIDI + gjk + pjk
                                    lrViewJK: float = gLrClickJ / gLrViewDivisorK
                                    lrViewLM: float = pLrClickM / pLrViewDivisorN
                                    evalToolMGlobal: EvalToolDHondt = EvalToolDHondt({
                                        EvalToolDHondt.ARG_LEARNING_RATE_CLICKS:
                                        gLrClickJ,
                                        EvalToolDHondt.ARG_LEARNING_RATE_VIEWS:
                                        lrViewJK,
                                        EvalToolDHondt.ARG_NORMALIZATION_OF_RESPONSIBILITY:
                                        gNormOfResponsL
                                    })
                                    evalToolMPerson: EvalToolDHondt = EvalToolDHondtPersonal({
                                        EvalToolDHondtPersonal.ARG_LEARNING_RATE_CLICKS:
                                        pLrClickM,
                                        EvalToolDHondtPersonal.ARG_LEARNING_RATE_VIEWS:
                                        lrViewLM,
                                        EvalToolDHondtPersonal.ARG_NORMALIZATION_OF_RESPONSIBILITY:
                                        pLrViewDivisorO
                                    })
                                    eToolIJK: AEvalTool = EToolHybrid(
                                        evalToolMGlobal, evalToolMPerson, {})
                                    selectorIJK: ADHondtSelector = BatchDefMLFuzzyDHondt(
                                    ).getSelectorParameters()[selectorIDI]
                                    aDict[keyIJ] = (selectorIJK, eToolIJK)
        return aDict
コード例 #10
0
    def getParameters(self):
        negativeImplFeedbackDict: Dict[
            str,
            object] = BatchDefMLFuzzyDHondtINF.getNegativeImplFeedbackParameters(
            )
        selectorDict: Dict[
            str, object] = BatchDefMLFuzzyDHondt().getSelectorParameters()

        aDict: Dict[str, object] = {}
        for selectorIdI in selectorDict.keys():
            for nImplFeedbackIdJ in negativeImplFeedbackDict.keys():

                selectorI = selectorDict[selectorIdI]
                negativeImplFeedbackJ = negativeImplFeedbackDict[
                    nImplFeedbackIdJ]

                keyIJ: str = str(selectorIdI) + nImplFeedbackIdJ
                aDict[keyIJ] = (selectorI, negativeImplFeedbackJ)
        return aDict
 def getParameters(self):
     batchDefMLFuzzyDHondt = BatchDefMLFuzzyDHondt()
     batchDefMLFuzzyDHondt.selectorIDs = self.selectorIDs
     return batchDefMLFuzzyDHondt.getSelectorParameters()
コード例 #12
0
def getBatchesUSA():
    print("Get USA Batches")

    # dataset ML
    batchDefMLFuzzyDHondt = BatchDefMLFuzzyDHondt()
    batchDefMLFuzzyDHondt.lrClicks:List[float] = [0.03]
    batchDefMLFuzzyDHondt.lrViewDivisors:List[float] = [250]
    batchDefMLFuzzyDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefMLPersonalFuzzyDHondt = BatchDefMLPersonalFuzzyDHondt()
    batchDefMLPersonalFuzzyDHondt.lrClicks: List[float] = [0.2]
    batchDefMLPersonalFuzzyDHondt.lrViewDivisors:List[float] = [1000]
    batchDefMLPersonalFuzzyDHondt.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefMLPersonalStatFuzzyDHondt = BatchDefMLPersonalStatFuzzyDHondt()
    batchDefMLPersonalStatFuzzyDHondt.lrClicks: List[float] = [0.2]
    batchDefMLPersonalStatFuzzyDHondt.lrViewDivisors:List[float] = [1000]
    batchDefMLPersonalStatFuzzyDHondt.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]


    batchDefMLHybrid = BatchDefMLHybrid()
    batchDefMLHybrid.mGlobalLrClicks:List[float] = [0.03]
    batchDefMLHybrid.mGlobalLrViewDivisors:List[float] = [250]
    batchDefMLHybrid.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefMLHybrid.mPersonLrClicks: List[float] = [0.03]
    batchDefMLHybrid.mPersonLrViewDivisors: List[float] = [250]
    batchDefMLHybrid.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefMLHybrid.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefMLHybridSkip = BatchDefMLHybridSkip()
    batchDefMLHybridSkip.mGlobalLrClicks:List[float] = [0.03]
    batchDefMLHybridSkip.mGlobalLrViewDivisors:List[float] = [250]
    batchDefMLHybridSkip.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefMLHybridSkip.mPersonLrClicks: List[float] = [0.03]
    batchDefMLHybridSkip.mPersonLrViewDivisors: List[float] = [250]
    batchDefMLHybridSkip.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefMLHybridSkip.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]


    batchesDefML:List[ABatchDefinition] = []
    batchesDefML.append(batchDefMLFuzzyDHondt)
    batchesDefML.append(batchDefMLPersonalFuzzyDHondt)
    batchesDefML.append(batchDefMLPersonalStatFuzzyDHondt)
    batchesDefML.append(batchDefMLHybrid)
    batchesDefML.append(batchDefMLHybridSkip)

    # dataset RR
    batchDefRRFuzzyDHondt = BatchDefRRFuzzyDHondt()
    batchDefRRFuzzyDHondt.lrClicks:List[float] = [0.03]
    batchDefRRFuzzyDHondt.lrViewDivisors:List[float] = [250]
    batchDefRRFuzzyDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefRRPersonalFuzzyDHondt = BatchDefRRPersonalFuzzyDHondt()
    batchDefRRPersonalFuzzyDHondt.lrClicks: List[float] = [0.2]
    batchDefRRPersonalFuzzyDHondt.lrViewDivisors:List[float] = [1000]
    batchDefRRPersonalFuzzyDHondt.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefRRPersonalStatFuzzyDHondt = BatchDefRRPersonalStatFuzzyDHondt()
    batchDefRRPersonalStatFuzzyDHondt.lrClicks: List[float] = [0.03]
    batchDefRRPersonalStatFuzzyDHondt.lrViewDivisors:List[float] = [250]
    batchDefRRPersonalStatFuzzyDHondt.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    #batchDefRRDynamic = BatchDefRRDynamic()
    #batchDefRRDynamic.lrClicks: List[float] = [0.03]
    #batchDefRRDynamic.lrViewDivisors:List[float] = [250]
    #batchDefRRDynamic.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefRRHybrid = BatchDefRRHybrid()
    batchDefRRHybrid.mGlobalLrClicks:List[float] = [0.03]
    batchDefRRHybrid.mGlobalLrViewDivisors:List[float] = [250]
    batchDefRRHybrid.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefRRHybrid.mPersonLrClicks: List[float] = [0.03]
    batchDefRRHybrid.mPersonLrViewDivisors: List[float] = [250]
    batchDefRRHybrid.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefRRHybrid.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefRRHybridSkip = BatchDefRRHybridSkip()
    batchDefRRHybridSkip.mGlobalLrClicks:List[float] = [0.03]
    batchDefRRHybridSkip.mGlobalLrViewDivisors:List[float] = [250]
    batchDefRRHybridSkip.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefRRHybridSkip.mPersonLrClicks: List[float] = [0.03]
    batchDefRRHybridSkip.mPersonLrViewDivisors: List[float] = [250]
    batchDefRRHybridSkip.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefRRHybridSkip.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchesDefRR:List[ABatchDefinition] = []
    batchesDefRR.append(batchDefRRFuzzyDHondt)
    batchesDefRR.append(batchDefRRPersonalFuzzyDHondt)
    batchesDefRR.append(batchDefRRPersonalStatFuzzyDHondt)
    #batchesDefRR.append(batchDefRRDynamic)
    batchesDefRR.append(batchDefRRHybrid)
    batchesDefRR.append(batchDefRRHybridSkip)


    # dataset ST
    batchDefSTFuzzyDHondt = BatchDefSTFuzzyDHondt()
    batchDefSTFuzzyDHondt.lrClicks:List[float] = [0.03]
    batchDefSTFuzzyDHondt.lrViewDivisors:List[float] = [250]
    batchDefSTFuzzyDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefSTPersonalFuzzyDHondt = BatchDefSTPersonalFuzzyDHondt()
    batchDefSTPersonalFuzzyDHondt.lrClicks: List[float] = [0.2]
    batchDefSTPersonalFuzzyDHondt.lrViewDivisors:List[float] = [1000]
    batchDefSTPersonalFuzzyDHondt.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefSTPersonalStatFuzzyDHondt = BatchDefSTPersonalStatFuzzyDHondt()
    batchDefSTPersonalStatFuzzyDHondt.lrClicks: List[float] = [0.2]
    batchDefSTPersonalStatFuzzyDHondt.lrViewDivisors:List[float] = [1000]
    batchDefSTPersonalStatFuzzyDHondt.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefSTHybrid = BatchDefSTHybrid()
    batchDefSTHybrid.mGlobalLrClicks:List[float] = [0.03]
    batchDefSTHybrid.mGlobalLrViewDivisors:List[float] = [250]
    batchDefSTHybrid.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefSTHybrid.mPersonLrClicks: List[float] = [0.03]
    batchDefSTHybrid.mPersonLrViewDivisors: List[float] = [250]
    batchDefSTHybrid.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefSTHybrid.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefSTHybridSkip = BatchDefSTHybridSkip()
    batchDefSTHybridSkip.mGlobalLrClicks:List[float] = [0.03]
    batchDefSTHybridSkip.mGlobalLrViewDivisors:List[float] = [250]
    batchDefSTHybridSkip.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefSTHybridSkip.mPersonLrClicks: List[float] = [0.03]
    batchDefSTHybridSkip.mPersonLrViewDivisors: List[float] = [250]
    batchDefSTHybridSkip.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefSTHybridSkip.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]


    batchDefSTHybridStat = BatchDefSTHybridStat()
    batchDefSTHybridStat.mGlobalLrClicks:List[float] = [0.03]
    batchDefSTHybridStat.mGlobalLrViewDivisors:List[float] = [250]
    batchDefSTHybridStat.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefSTHybridStat.mPersonLrClicks: List[float] = [0.03]
    batchDefSTHybridStat.mPersonLrViewDivisors: List[float] = [250]
    batchDefSTHybridStat.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefSTHybridStat.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefSTHybridStatSkip = BatchDefSTHybridStatSkip()
    batchDefSTHybridStatSkip.mGlobalLrClicks:List[float] = [0.03]
    batchDefSTHybridStatSkip.mGlobalLrViewDivisors:List[float] = [250]
    batchDefSTHybridStatSkip.mGlobalNormOfRespons:List[bool] = [True, False]
    batchDefSTHybridStatSkip.mPersonLrClicks: List[float] = [0.03]
    batchDefSTHybridStatSkip.mPersonLrViewDivisors: List[float] = [250]
    batchDefSTHybridStatSkip.mPersonNormOfRespons:List[bool] = [True, False]
    batchDefSTHybridStatSkip.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]



    batchesDefST:List[ABatchDefinition] = []
    batchesDefST.append(batchDefSTFuzzyDHondt)
    batchesDefST.append(batchDefSTPersonalFuzzyDHondt)
    batchesDefST.append(batchDefSTPersonalStatFuzzyDHondt)
    batchesDefST.append(batchDefSTHybrid)
    batchesDefST.append(batchDefSTHybridSkip)
    batchesDefST.append(batchDefSTHybridStat)
    batchesDefST.append(batchDefSTHybridStatSkip)

    return batchesDefML + batchesDefRR + batchesDefST
コード例 #13
0
def getBatchesJournal():
    print("Get Journal Batches")

    jobIdML01:str = "FixedReduceOLin07500HLin07500"
    jobIdML02:str = "FixedReduceOLin10075HLin0500"
    jobIdML03:str = "FixedReduceOLin1000HLin1005"
    jobIdML04:str = "FixedReduceOLin1005HLin1005"

    jobIdML05:str = "FixedReduceProbOLin07500HLin07500"
    jobIdML06:str = "FixedReduceProbOLin075025HLin05025"
    jobIdML07:str = "FixedReduceProbOLin1000HLin1005"
    jobIdML08:str = "FixedReduceProbOLin1005HLin1005"


    jobIdST01:str = "FixedReduceOLin07500HLin05025"
    jobIdST02:str = "FixedReduceOLin0500HLin1005"
    jobIdST03:str = "FixedReduceOLin1000HLin1005"
    jobIdST04:str = "FixedReduceOLin1005HLin1005"

    jobIdST05:str = "FixedReduceProbOLin07500HLin07500"
    jobIdST06:str = "FixedReduceProbOLin07500HLin075025"
    jobIdST07:str = "FixedReduceProbOLin1000HLin1005"
    jobIdST08:str = "FixedReduceProbOLin1005HLin1005"

    batchesDef:List[ABatchDefinition] = []

    # ML #############################################################################
    batchDefMLSingle = BatchDefMLSingle()
#
    batchDefMLBanditTS = BatchDefMLBanditTS()
    batchDefMLBanditTS.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefMLWeightedAVG = BatchDefMLWeightedAVG()
    batchDefMLWeightedAVG.lrClicks:List[float] = [0.03]
    batchDefMLWeightedAVG.lrViewDivisors:List[float] = [250]
#
    batchDefMLWeightedAVGMMR = BatchDefMLWeightedAVGMMR()
    batchDefMLWeightedAVGMMR.lrClicks:List[float] = [0.03]
    batchDefMLWeightedAVGMMR.lrViewDivisors:List[float] = [250]

    batchDefMLFAI = BatchDefMLFAI()
#
    batchDefMLRandomRecsSwitching = BatchDefMLRandomRecsSwitching()
#
    batchDefMLRandomKfromN = BatchDefMLRandomKfromN()
#
    batchDefMLFuzzyDHondt = BatchDefMLFuzzyDHondt()
    batchDefMLFuzzyDHondt.lrClicks:List[float] = [0.03]
    batchDefMLFuzzyDHondt.lrViewDivisors:List[float] = [250]
    batchDefMLFuzzyDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

#
    batchDefMLFuzzyDHondtThompsonSampling = BatchDefMLFuzzyDHondtThompsonSampling()
    batchDefMLFuzzyDHondtThompsonSampling.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefMLContextDHondt = BatchDefMLContextDHondt()
    batchDefMLContextDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefMLFuzzyDHondtDirectOptimize = BatchDefMLFuzzyDHondtDirectOptimize()
    batchDefMLFuzzyDHondtDirectOptimize.lrClicks:List[float] = [0.03]
    batchDefMLFuzzyDHondtDirectOptimize.lrViewDivisors:List[float] = [250]
    batchDefMLFuzzyDHondtDirectOptimize.selectorIds = [
        BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_FIXED, BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE1,
        BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE2, BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE3,
        BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE4, BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE5]
#
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSampling = BatchDefMLFuzzyDHondtDirectOptimizeThompsonSampling()
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSampling.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingMMR = BatchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingMMR()
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingMMR.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefMLContextFuzzyDHondtDirectOptimize = BatchDefMLContextFuzzyDHondtDirectOptimize()

#
    # INF
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingINF = BatchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingINF()
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingINF.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
    batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingINF.jobIDs = [
        jobIdML01, jobIdML02, jobIdML03, jobIdML04, jobIdML05, jobIdML06, jobIdML07, jobIdML08]
#
    batchDefMLContextDHondtINF = BatchDefMLContextDHondtINF()
    batchDefMLContextDHondtINF.jobIDs = [
        jobIdML01, jobIdML02, jobIdML03, jobIdML04, jobIdML05, jobIdML06, jobIdML07, jobIdML08]
#
    batchDefMLContextFuzzyDHondtDirectOptimizeINF = BatchDefMLContextFuzzyDHondtDirectOptimizeINF()
    batchDefMLContextFuzzyDHondtDirectOptimizeINF.jobIDs = [
        jobIdML01, jobIdML02, jobIdML03, jobIdML04, jobIdML05, jobIdML06, jobIdML07, jobIdML08]

    batchDefMLFuzzyDHondtThompsonSamplingINF = BatchDefMLFuzzyDHondtThompsonSamplingINF()
    batchDefMLFuzzyDHondtThompsonSamplingINF.jobIDs = [
        jobIdML01, jobIdML02, jobIdML03, jobIdML04, jobIdML05, jobIdML06, jobIdML07, jobIdML08]
#
    batchesDef.append(batchDefMLSingle)
    batchesDef.append(batchDefMLBanditTS)
    batchesDef.append(batchDefMLWeightedAVG)
    batchesDef.append(batchDefMLWeightedAVGMMR)
    batchesDef.append(batchDefMLWeightedAVGMMR)
    batchesDef.append(batchDefMLFAI)
    batchesDef.append(batchDefMLRandomRecsSwitching)
    batchesDef.append(batchDefMLRandomKfromN)
    batchesDef.append(batchDefMLFuzzyDHondt)
    batchesDef.append(batchDefMLFuzzyDHondtThompsonSampling)
    batchesDef.append(batchDefMLContextDHondt)
    batchesDef.append(batchDefMLFuzzyDHondtDirectOptimize)
    batchesDef.append(batchDefMLFuzzyDHondtDirectOptimizeThompsonSampling)
    batchesDef.append(batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingMMR)
    batchesDef.append(batchDefMLContextFuzzyDHondtDirectOptimize)

    batchesDef.append(batchDefMLFuzzyDHondtDirectOptimizeThompsonSamplingINF)
    batchesDef.append(batchDefMLContextDHondtINF)
    batchesDef.append(batchDefMLContextFuzzyDHondtDirectOptimizeINF)
    batchesDef.append(batchDefMLFuzzyDHondtThompsonSamplingINF)

    # RR #############################################################################
    batchDefRRSingle = BatchDefRRSingle()
    batchDefRRSingleW2VHT = BatchDefRRSingleW2VHT()
    batchDefRRSingleVMContextKNNHT = BatchDefRRSingleVMContextKNNHT()
    batchDefRRSingleCosineCBHT = BatchDefRRSingleCosineCBHT()

    #batchesDef.append(batchDefRRSingle)
    #batchesDef.append(batchDefRRSingleW2VHT)
    #batchesDef.append(batchDefRRSingleVMContextKNNHT)
    #batchesDef.append(batchDefRRSingleCosineCBHT)


    # ST #############################################################################
    batchDefSTSingle = BatchDefSTSingle()
#
    batchDefSTBanditTS = BatchDefSTBanditTS()
    batchDefSTBanditTS.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

    batchDefSTWeightedAVG = BatchDefSTWeightedAVG()
    batchDefSTWeightedAVG.lrClicks:List[float] = [0.03]
    batchDefSTWeightedAVG.lrViewDivisors:List[float] = [250]

    batchDefSTFAI = BatchDefSTFAI()

#
    batchDefSTRandomRecsSwitching = BatchDefSTRandomRecsSwitching()
    batchDefSTRandomKfromN = BatchDefSTRandomKfromN()
#
    batchDefSTFuzzyDHondt = BatchDefSTFuzzyDHondt()
    batchDefSTFuzzyDHondt.lrClicks:List[float] = [0.03]
    batchDefSTFuzzyDHondt.lrViewDivisors:List[float] = [250]
    batchDefSTFuzzyDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]

#
    batchDefSTFuzzyDHondtThompsonSampling = BatchDefSTFuzzyDHondtThompsonSampling()
    batchDefSTContextDHondt = BatchDefSTContextDHondt()
    batchDefSTContextDHondt.selectorIDs:List[str] = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefSTContextFuzzyDHondtDirectOptimize = BatchDefSTContextFuzzyDHondtDirectOptimize()
#
    batchDefSTFuzzyDHondtDirectOptimize = BatchDefSTFuzzyDHondtDirectOptimize()
    batchDefSTFuzzyDHondtDirectOptimize.lrClicks:List[float] = [0.03]
    batchDefSTFuzzyDHondtDirectOptimize.lrViewDivisors:List[float] = [250]
    batchDefSTFuzzyDHondtDirectOptimize.selectorIDs = [
        BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_FIXED, BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE1,
        BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE2, BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE3,
        BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE4, BatchDefMLFuzzyDHondtDirectOptimize.SLCTR_ROULETTE5]
#
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSampling = BatchDefSTFuzzyDHondtDirectOptimizeThompsonSampling()
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSampling.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
#
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingMMR = BatchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingMMR()
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingMMR.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]


#
    # INF
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingINF = BatchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingINF()
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingINF.selectorIDs = [BatchDefMLFuzzyDHondt.SLCTR_FIXED]
    batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingINF.jobIDs = [
        jobIdST01, jobIdST02, jobIdST03, jobIdST04, jobIdST05, jobIdST06, jobIdST07, jobIdST08]

    batchDefSTContextDHondtINF = BatchDefSTContextDHondtINF()
    batchDefSTContextDHondtINF.jobIDs = [
        jobIdST01, jobIdST02, jobIdST03, jobIdST04, jobIdST05, jobIdST06, jobIdST07, jobIdST08]

    batchDefSTContextFuzzyDHondtDirectOptimizeINF = BatchDefSTContextFuzzyDHondtDirectOptimizeINF()
    batchDefSTContextFuzzyDHondtDirectOptimizeINF.jobIDs = [
        jobIdST01, jobIdST02, jobIdST03, jobIdST04, jobIdST05, jobIdST06, jobIdST07, jobIdST08]

    batchDefSTDFuzzyHondtThompsonSamplingINF = BatchDefSTDFuzzyHondtThompsonSamplingINF()
    batchDefSTDFuzzyHondtThompsonSamplingINF.jobIDs = [
        jobIdST01, jobIdST02, jobIdST03, jobIdST04, jobIdST05, jobIdST06, jobIdST07, jobIdST08]


    batchesDef.append(batchDefSTSingle)
    batchesDef.append(batchDefSTBanditTS)
    batchesDef.append(batchDefSTWeightedAVG)
    batchesDef.append(batchDefSTFAI)
    batchesDef.append(batchDefSTRandomRecsSwitching)
    batchesDef.append(batchDefSTRandomKfromN)
    batchesDef.append(batchDefSTFuzzyDHondt)

    batchesDef.append(batchDefSTFuzzyDHondtThompsonSampling)
    batchesDef.append(batchDefSTContextDHondt)
    batchesDef.append(batchDefSTContextFuzzyDHondtDirectOptimize)

    batchesDef.append(batchDefSTFuzzyDHondtDirectOptimize)
    batchesDef.append(batchDefSTFuzzyDHondtDirectOptimizeThompsonSampling)
    batchesDef.append(batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingMMR)

    batchesDef.append(batchDefSTFuzzyDHondtDirectOptimizeThompsonSamplingINF)
    batchesDef.append(batchDefSTContextDHondtINF)
    batchesDef.append(batchDefSTContextFuzzyDHondtDirectOptimizeINF)
    batchesDef.append(batchDefSTDFuzzyHondtThompsonSamplingINF)

    return batchesDef
コード例 #14
0
def getAllBatches():
    print("Get All Batches")

    batchesDef:List[ABatchDefinition] = []

    # ML
    batchDefMLBanditTS = BatchDefMLBanditTS()
    batchDefMLFuzzyDHondt = BatchDefMLFuzzyDHondt()
    batchMLFuzzyDHondtINF = BatchDefMLFuzzyDHondtINF()
    batchDefMLFuzzyDHondtThompsonSampling = BatchDefMLFuzzyDHondtThompsonSampling()
    batchDefMLFuzzyDHondtThompsonSamplingINF = BatchDefMLFuzzyDHondtThompsonSamplingINF()

    batchDefMLFuzzyDHondtDirectOptimize = BatchDefMLFuzzyDHondtDirectOptimize()
    batchDefMLFuzzyDHondtDirectOptimizeINF = BatchDefMLFuzzyDHondtDirectOptimizeINF()

    batchDefMLContextDHondt = BatchDefMLContextDHondt()

    batchDefMLWeightedAVG = BatchDefMLWeightedAVG()
    batchDefMLWeightedAVGMMR = BatchDefMLWeightedAVGMMR()
    batchDefMLFAI = BatchDefMLFAI()

    batchDefMLRandomRecsSwitching = BatchDefMLRandomRecsSwitching()
    batchDefMLRandomKfromN = BatchDefMLRandomKfromN()

    batchDefMLSingle = BatchDefMLSingle()
    batchDefMLSingleINF = BatchDefMLSingleINF()

    batchDefMLSingleBPRMFHT = BatchDefMLSingleBPRMFHT()
    batchDefMLSingleW2VHT = BatchDefMLSingleW2VHT()
    batchDefMLSingleCosineCBHT = BatchDefMLSingleCosineCBHT()
    batchDefMLSingleVMContextKNNHT = BatchDefMLSingleVMContextKNNHT()

    batchDefMLContextFuzzyDHondtDirectOptimize = BatchDefMLContextFuzzyDHondtDirectOptimize()


    batchesDef.append(batchDefMLBanditTS)
    batchesDef.append(batchDefMLFuzzyDHondt)
    batchesDef.append(batchMLFuzzyDHondtINF)
    batchesDef.append(batchDefMLFuzzyDHondtThompsonSampling)
    batchesDef.append(batchDefMLFuzzyDHondtThompsonSamplingINF)
    batchesDef.append(batchDefMLFuzzyDHondtDirectOptimize)
    batchesDef.append(batchDefMLFuzzyDHondtDirectOptimizeINF)
    batchesDef.append(batchDefMLContextDHondt)
    batchesDef.append(batchDefMLWeightedAVG)
    batchesDef.append(batchDefMLWeightedAVGMMR)
    batchesDef.append(batchDefMLFAI)
    batchesDef.append(batchDefMLRandomRecsSwitching)
    batchesDef.append(batchDefMLRandomKfromN)
    batchesDef.append(batchDefMLSingle)
    batchesDef.append(batchDefMLSingleINF)
    batchesDef.append(batchDefMLSingleBPRMFHT)
    batchesDef.append(batchDefMLSingleW2VHT)
    batchesDef.append(batchDefMLSingleCosineCBHT)
    batchesDef.append(batchDefMLSingleVMContextKNNHT)
    batchesDef.append(batchDefMLContextFuzzyDHondtDirectOptimize)

    # RR
    batchDefRRSingle = BatchDefRRSingle()
    batchDefRRSingleW2VHT = BatchDefRRSingleW2VHT()
    batchDefRRSingleCosineCBHT = BatchDefRRSingleCosineCBHT()

    batchesDef.append(batchDefRRSingle)
    batchesDef.append(batchDefRRSingleW2VHT)
    batchesDef.append(batchDefRRSingleCosineCBHT)


    #ST
    batchDefSTContextDHondtINF = BatchDefSTContextDHondtINF()
    batchDefSTContextDHondt = BatchDefSTContextDHondt()
    batchDefSTFuzzyDHondtThompsonSampling = BatchDefSTFuzzyDHondtThompsonSampling()
    batchDefSTDFuzzyHondtThompsonSamplingINF = BatchDefSTDFuzzyHondtThompsonSamplingINF()
    batchDefSTFuzzyDHondtDirectOptimize = BatchDefSTFuzzyDHondtDirectOptimize()
    batchDefSTFuzzyDHondt = BatchDefSTFuzzyDHondt()
    batchDefSTFuzzyDHondtINF = BatchDefSTFuzzyDHondtINF()
    batchDefSTWeightedAVG = BatchDefSTWeightedAVG()
    batchDefSTFAI = BatchDefSTFAI()

    batchDefSTBanditTS = BatchDefSTBanditTS()
    batchDefSTRandomRecsSwitching = BatchDefSTRandomRecsSwitching()
    batchDefSTRandomKfromN = BatchDefSTRandomKfromN()

    batchDefSTSingle = BatchDefSTSingle()
    batchDefSTSingleBPRMFHT = BatchDefSTSingleBPRMFHT()
    batchDefSTSingleW2VHT = BatchDefSTSingleW2VHT()
    batchDefSTSingleCosineCBHT = BatchDefSTSingleCosineCBHT()
    batchDefSTSingleVMContextKNNHT = BatchDefSTSingleVMContextKNNHT()

    batchDefSTContextFuzzyDHondtDirectOptimize = BatchDefSTContextFuzzyDHondtDirectOptimize()


    batchesDef.append(batchDefSTContextDHondtINF)
    batchesDef.append(batchDefSTContextDHondt)
    batchesDef.append(batchDefSTFuzzyDHondtThompsonSampling)
    batchesDef.append(batchDefSTDFuzzyHondtThompsonSamplingINF)
    batchesDef.append(batchDefSTFuzzyDHondtDirectOptimize)
    batchesDef.append(batchDefSTFuzzyDHondt)
    batchesDef.append(batchDefSTFuzzyDHondtINF)
    batchesDef.append(batchDefSTWeightedAVG)
    batchesDef.append(batchDefSTFAI)
    batchesDef.append(batchDefSTBanditTS)
    batchesDef.append(batchDefSTRandomRecsSwitching)
    batchesDef.append(batchDefSTRandomKfromN)
    batchesDef.append(batchDefSTSingle)
    batchesDef.append(batchDefSTSingleBPRMFHT)
    batchesDef.append(batchDefSTSingleW2VHT)
    batchesDef.append(batchDefSTSingleCosineCBHT)
    batchesDef.append(batchDefSTSingleVMContextKNNHT)
    batchesDef.append(batchDefSTContextFuzzyDHondtDirectOptimize)

    return batchesDef