Skip to content

Instantly share code, notes, and snippets.

@naught101
naught101 / mutual_info.py
Last active June 10, 2024 08:18 — forked from GaelVaroquaux/mutual_info.py
Estimating entropy and mutual information with scikit-learn
'''
Non-parametric computation of entropy and mutual-information
Adapted by G Varoquaux for code created by R Brette, itself
from several papers (see in the code).
These computations rely on nearest-neighbor statistics
'''
import numpy as np
@naught101
naught101 / modelbycluster.py
Last active November 9, 2017 11:20 — forked from jnothman/modelbycluster.py
Generic scikit-learn estimator to cluster data and build predictive models for each cluster.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Scikit-Learn Model-by-Cluster wrapper.
Original code by jnorthman: https://gist.github.com/jnothman/566ebde618ec18f2bea6
"""
import numpy as np
@naught101
naught101 / extractannotations.py
Last active August 29, 2015 14:20 — forked from compleatang/extractannotations.py
update to python 3
#!/usr/bin/env python3
import poppler
import sys
import urllib.request, urllib.parse, urllib.error
import os
def main():
input_filename = sys.argv[1]
# http://blog.hartwork.org/?p=612
@naught101
naught101 / .gitignore
Created July 9, 2012 02:17 — forked from kogakure/.gitignore
Git: .gitignore file for LaTeX projects
*-blx.bib
*.acn
*.acr
*.alg
*.aux
*.bbl
*.bcf
*.blg
*.dvi
*.fdb_latexmk