Exemple #1
0
        print 'Must install matplotlib to run this demo.\n'

    t = Table(smallBlind=1, bigBlind=2, maxBuyIn=200)

    players = []
    for i in range(6):

        #create BasicPlayer that uses GradientBoostingRegressor as machine learning model
        #with wealth of 1 million and 10 discrete choices for raising,
        #with each raise choice .7 times the next largest raise choice
        #Player forgets training samples older than 100,000
        r = GradientBoostingRegressor()
        name = 'Player ' + str(i + 1)
        p = BasicPlayer(name=name,
                        reg=r,
                        bankroll=10000,
                        nRaises=4,
                        rFactor=.7,
                        memory=10**5)
        p.stopTraining()
        players.append(p)

    for p in players:
        t.addPlayer(p)

    #train Player 1 for 1000 hands, training once
    players[0].startTraining()
    simulate(t, nHands=2000, nTrain=100, nBuyIn=10)
    players[0].stopTraining()

    #for p in players: p.setBankroll(10**6)
Exemple #2
0
        print('Must install matplotlib to run this demo.\n')

    t = Table(smallBlind=1, bigBlind=2, maxBuyIn=200)

    players = []
    for i in range(6):

        #create BasicPlayer that uses GradientBoostingRegressor as machine learning model
        #with wealth of 1 million and 10 discrete choices for raising,
        #with each raise choice .7 times the next largest raise choice
        #Player forgets training samples older than 100,000
        r = GradientBoostingRegressor()
        name = 'Player ' + str(i + 1)
        p = BasicPlayer(name=name,
                        reg=r,
                        bankroll=10**6,
                        nRaises=10,
                        rFactor=.7,
                        memory=10**5)
        p.stopTraining()
        players.append(p)

    for p in players:
        t.addPlayer(p)

    #train Player 1 for 1000 hands, training once
    players[0].startTraining()
    simulate(t, nHands=5000, nTrain=1000, nBuyIn=10)
    players[0].stopTraining()

    #train Player 2 for 10000 hands, training every 1000 hands
    players[1].startTraining()
        # with wealth of 1 million and 10 discrete choices for raising,
        # with each raise choice .7 times the next largest raise choice
        # Player forgets training samples older than 100,000
        r = GradientBoostingRegressor()
        name = 'Player ' + str(i + 1)
        if i == 0:
            p = SmartPlayer(name=name,
                            reg=r,
                            bankroll=10**6,
                            nRaises=10,
                            rFactor=.7,
                            memory=10**5)
        else:
            p = BasicPlayer(name=name,
                            reg=r,
                            bankroll=10**6,
                            nRaises=10,
                            rFactor=.7,
                            memory=10**5)
        p.stopTraining()
        players.append(p)

    for p in players:
        t.addPlayer(p)

    # train Player 1 for 1000 hands, training once
    players[0].startTraining()
    simulate(t, nHands=5000, nTrain=1000, nBuyIn=10)
    players[0].stopTraining()

    # train Player 2 for 10000 hands, training every 1000 hands
    players[1].startTraining()
Exemple #4
0
    except:
        print 'Must install matplotlib to run this demo.\n'

    t = Table(smallBlind=1, bigBlind=2, maxBuyIn=200)

    players = []
    for i in range(6):

        #create BasicPlayer without a machine learning model
        #with wealth of 1 million and 10 discrete choices for raising,
        #with each raise choice .7 times the next largest raise choice
        #Player forgets training samples older than 100,000
        name = 'Player ' + str(i + 1)
        p = BasicPlayer(name=name,
                        bankroll=10**6,
                        nRaises=10,
                        rFactor=.7,
                        memory=10**5)
        players.append(p)

    for p in players:
        t.addPlayer(p)

    #simulate 1,000 hands, cashing out/buying in every 10 hands, without training or narrating
    simulate(t, nHands=1000, nBuyIn=10, nTrain=0, vocal=False)

    features = []
    labels = []

    for p in players:
        features.extend(p.getFeatures())
if __name__ == '__main__':

    try: import matplotlib.pyplot as plt
    except: print 'Must install matplotlib to run this demo.\n'

    t = Table(smallBlind=1, bigBlind=2, maxBuyIn=200)

    players = []
    for i in range(6):
        
        #create BasicPlayer without a machine learning model
        #with wealth of 1 million and 10 discrete choices for raising,
        #with each raise choice .7 times the next largest raise choice 
        #Player forgets training samples older than 100,000
        name = 'Player ' + str(i+1)
        p = BasicPlayer(name=name, bankroll=10**6, nRaises=10, rFactor=.7, memory=10**5)
        players.append(p)

    for p in players: t.addPlayer(p)

    #simulate 1,000 hands, cashing out/buying in every 10 hands, without training or narrating
    simulate(t, nHands=1000, nBuyIn=10, nTrain=0, vocal=False)

    features = []
    labels = []

    for p in players:
        features.extend(p.getFeatures())
        labels.extend(p.getLabels())

    features = np.array(features)
    try: import matplotlib.pyplot as plt
    except: print 'Must install matplotlib to run this demo.\n'

    t = Table(smallBlind=1, bigBlind=2, maxBuyIn=200)

    players = []
    for i in range(6):
        
        #create BasicPlayer that uses GradientBoostingRegressor as machine learning model
        #with wealth of 1 million and 10 discrete choices for raising,
        #with each raise choice .7 times the next largest raise choice
        #Player forgets training samples older than 100,000
        r = GradientBoostingRegressor()
        name = 'Player ' + str(i+1)
        p = BasicPlayer(name=name, reg=r, bankroll=10**6, nRaises=10, rFactor=.7, memory=10**5)
        p.stopTraining()
        players.append(p)

    for p in players: t.addPlayer(p)

    #train Player 1 for 1000 hands, training once
    players[0].startTraining()
    simulate(t, nHands=1000, nTrain=1000, nBuyIn=10)   
    players[0].stopTraining()
    
    #train Player 2 for 10000 hands, training every 1000 hands
    players[1].startTraining()
    simulate(t, nHands=10000, nTrain=1000, nBuyIn=10)   
    players[1].stopTraining()