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
"""Illustration for various types of namespace scopes in TensorFlow. | |
> python tf_scopes.py | |
foo_name_scoped : | |
v.name= v:0 | |
v2.name= foo_name_scoped/v2:0 | |
a.name= Variable:0 | |
b.name= Variable_1:0 | |
result_op.name= foo_name_scoped/Add:0 | |
foo_op_scoped : |
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/env python | |
# see http://socialdatablog.com/extract-pdf-annotations.html | |
myxkfolder="/home/steve/xk/" #you need to set this to where you want your to-dos to appear | |
import poppler, os.path, os, time, datetime | |
for root, dirs, files in os.walk('./'): | |
for lpath in files: |
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(mvtnorm) # to draw multivariate normal outcomes | |
library(R2jags) # JAGS-R interface | |
# function that makes distance matrix for a side*side 2D array | |
dist.matrix <- function(side) | |
{ | |
row.coords <- rep(1:side, times=side) | |
col.coords <- rep(1:side, each=side) | |
row.col <- data.frame(row.coords, col.coords) | |
D <- dist(row.col, method="euclidean", diag=TRUE, upper=TRUE) |
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
############################################################################# | |
# Full Imports | |
from __future__ import division | |
import math | |
import random | |
""" | |
This is a pure Python implementation of the K-means Clustering algorithmn. The | |
original can be found here: |
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
Show hidden characters
[ | |
// Remapping of *some* SublimeREPL shortcuts | |
{ "keys": ["ctrl+super+s"], "command": "repl_transfer_current", "args": {"scope": "selection"}}, | |
{ "keys": ["ctrl+shift+,", "s"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}}, | |
{ "keys": ["ctrl+shift+super+f"], "command": "repl_transfer_current", "args": {"scope": "file"}}, | |
{ "keys": ["shift+ctrl+,", "f"], "command": "repl_transfer_current", "args": {"scope": "file", "action":"view_write"}}, | |
{ "keys": ["ctrl+super+l"], "command": "repl_transfer_current", "args": {"scope": "lines"}}, | |
{ "keys": ["shift+ctrl+,", "l"], "command": "repl_transfer_current", "args": {"scope": "lines", "action":"view_write"}}, | |
{ "keys": ["ctrl+super+b"], "command": "repl_transfer_current", "args": {"scope": "block"}}, | |
{ "keys": ["shift+ctrl+,", "b"], "command": "repl_transfer_current", "args": {"scope": "block", "action":"view_write"}} |
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
""" | |
Implementation of pairwise ranking using scikit-learn LinearSVC | |
Reference: | |
"Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich, | |
T. Graepel, K. Obermayer 1999 | |
"Learning to rank from medical imaging data." Pedregosa, Fabian, et al., | |
Machine Learning in Medical Imaging 2012. |