This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class memstate: | |
""" | |
Takes a function with input:int and output:int | |
creates memory | |
""" | |
def __init__(self,func): | |
self.func=func | |
self.memory = {} | |
def __call__(self,inp): | |
if inp in self.memory.keys(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################################################## | |
## All below code is just calculation for each player type in game and there ELO from the training data ## | |
########################################################################################################## | |
################################################################ | |
## General ELO rating functions ################################ | |
################################################################ | |
def expected_score(own_rating,opp_rating): | |
return 1.0/(1.0+10.0**((float(opp_rating)-float(own_rating))/400.0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import random | |
n_games = int(raw_input()) | |
def parse_game_data(): | |
dict_temp = {} | |
dict_temp['game'] = i | |
dict_temp['dice_prob'] = [float(x) for x in raw_input().strip().split(',')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats.stats import pearsonr | |
n_tests = int(raw_input()) | |
def parse(): | |
n_cases = int(raw_input()) | |
#print n_cases | |
final_data = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import htmlmin | |
import json | |
from bs4 import BeautifulSoup | |
from datetime import datetime, date, timedelta ##Basic Python | |
##define unique function | |
def uniq(seq): | |
# order preserving |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
require(rCharts) | |
library(reshape2) | |
cluster.data <- read.csv("./data/cluster_data.csv") | |
graphoptions<-as.list(colnames(cluster.data)) | |
names(graphoptions)<-colnames(cluster.data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(rCharts) | |
library(reshape2) | |
cluster.data <- read.csv("./data/cluster_data.csv") | |
graphoptions<-as.list(colnames(cluster.data)) | |
names(graphoptions)<-colnames(cluster.data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install.packages("XML") | |
library(XML) | |
#install.package("caret") | |
library(caret) | |
#install.packages("lpSolve") | |
library(lpSolve) | |
################################### | |
## Take data from premier league website## | |
################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install.package("caret") | |
library(caret) | |
#install.packages("lpSolve") | |
library(lpSolve) | |
Opt.squad<-function(dat,cost,n.gk=2,n.df=5,n.md=5,n.fd=3) { | |
#dat<-footy.data | |
#cost<-100 | |
#n.gk=2 | |
#n.df=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Change zero 9 part 1</name> | |
<identifier>private.changezerotowierds1</identifier> | |
<autogen> | |
--KeyToKey-- | |
KeyCode::KEY_9, ModifierFlag::CONTROL_L, | |
KeyCode::KEY_0 | |
</autogen> |
NewerOlder