Skip to content

Instantly share code, notes, and snippets.

@benjaminmgross
benjaminmgross / conda_env_vars.md
Created August 11, 2015 15:56
`conda` env variables

conda env vars

Quick gist to setup conda env variables

I try to keep virtualenv and conda going to ensure I stay versed in both virtual environment methodologies. In virtualenv I can simply moding the script located in $PATH/bin/activate where $PATH is the path to the virtual environment I'm working on. However, the process in conda is a little more involved (but also straightforward, as all things conda seem to be).

Create activate / deactivate directories

@benjaminmgross
benjaminmgross / stats.py
Last active July 25, 2023 23:45
Predicted R-Squared (r2, r^2) Calculation in `python`
def press_statistic(y_true, y_pred, xs):
"""
Calculation of the `Press Statistics <https://www.otexts.org/1580>`_
"""
res = y_pred - y_true
hat = xs.dot(np.linalg.pinv(xs))
den = (1 - np.diagonal(hat))
sqr = np.square(res/den)
return sqr.sum()
@benjaminmgross
benjaminmgross / screen_commands.md
Created December 18, 2018 14:18
Commands I Can't Remember
# create a new screen called sumpTin & nutTin
$ screen -S sumpTin
$ screen -S nutTin

# Exit sumpTin in detached state
# Ctrl A, Ctrl D

# list existing screens
$ screen -ls