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) labels = np.array(labels) #shuffle features/labels index = np.arange(len(labels)) np.random.shuffle(index) features = features[index] labels = labels[index] #initialize regressors with default parameters regressors = { LinearRegression(): 'LinearRegression', Lasso(): 'Lasso', RandomForestRegressor(): 'RandomForestRegressor',
#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) labels = np.array(labels) #shuffle features/labels index = np.arange(len(labels)) np.random.shuffle(index) features = features[index] labels = labels[index] #initialize regressors with default parameters regressors = {LinearRegression(): 'LinearRegression', Lasso(): 'Lasso', RandomForestRegressor(): 'RandomForestRegressor', GradientBoostingRegressor(): 'GradientBoostingRegressor'}