Skip to content

Instantly share code, notes, and snippets.

View kennethjmyers's full-sized avatar

Ken kennethjmyers

  • NYC
View GitHub Profile
@kennethjmyers
kennethjmyers / conda_env_export.py
Created April 27, 2023 03:20 — forked from gwerbin/conda_env_export.py
Export a Conda environment with --from-history, but also append Pip-installed dependencies
"""
Adapted from:
https://gist.github.com/gwerbin/dab3cf5f8db07611c6e0aeec177916d8
Export a Conda environment with --from-history, but also append
Pip-installed dependencies
Exports only manually-installed dependencies, excluding build versions, but
including Pip-installed dependencies.
@kennethjmyers
kennethjmyers / install_nltk_corpora
Last active March 5, 2016 23:50 — forked from michaelgodshall/install_textblob_corpora
How to Install Texblob NLTK Corpora on Heroku
#!/usr/bin/env bash
# Put this file in the `bin` directory at the root of your project
source $BIN_DIR/utils
echo "-----> Starting corpora installation"
# Assumes NLTK_DATA environment variable is already set
# $ heroku config:set NLTK_DATA='/app/nltk_data'
@kennethjmyers
kennethjmyers / gap.py
Last active February 26, 2016 21:57 — forked from michiexile/gap.py
A Python implementation of the Gap Statistic from Tibshirani, Walther, Hastie to determine the inherent number of clusters in a dataset with k-means clustering.
# gap.py
# (c) 2013 Mikael Vejdemo-Johansson
# BSD License
#
# SciPy function to compute the gap statistic for evaluating k-means clustering.
# Gap statistic defined in
# Tibshirani, Walther, Hastie:
# Estimating the number of clusters in a data set via the gap statistic
# J. R. Statist. Soc. B (2001) 63, Part 2, pp 411-423