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
def penalty(β): | |
""" | |
L: log-likelihood | |
n: number of data points | |
k: number of parameters | |
""" | |
return lambda L, n, k: β(n)*k - 2*L | |
AIC = penalty(lambda n: 2) | |
BIC = penalty(lambda n: np.log(n)) |
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
#!/usr/bin/python3 | |
import mmap | |
from collections import defaultdict | |
from sys import argv | |
# cb: control byte | |
# cs: control byte size | |
# dt: data type | |
# ps: payload size (or pointer size if ptr) | |
# pv: pointer value |
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
#!/usr/bin/python3 | |
from ipaddress import ip_address | |
import mmap | |
from sys import argv | |
import sys | |
DATA_SECTION_SEP = b"\x00" * 16 | |
META_SECTION_SEP = b"\xab\xcd\xefMaxMind.com" | |
if __name__ == "__main__": |