Skip to content

Instantly share code, notes, and snippets.

@dgleich
dgleich / load_file.m
Created June 18, 2013 14:19
Command to call Matlab as a script
1
2
3
4
@dgleich
dgleich / pprcd.py
Last active October 15, 2020 03:13
Personalized PageRank community detection
import collections
import sys
# setup the graph
G = {
1:set([ 2, 3, 5, 6,]),
2:set([ 1, 4,]),
3:set([ 1, 6, 7,]),
4:set([ 2, 5, 7, 8,]),
5:set([ 1, 4, 6, 8, 9, 10,]),
@dgleich
dgleich / netflix_svd.m
Last active January 3, 2017 04:21
SVD testing code for the netflix matrix, by David F. Gleich and Yangyang Hou.
%% Read Netflix dataset
A = readSMAT('/scratch/dgleich/netflix/netflix.smat');
k = [10 25 50 100 150 200];
l = size(k,2);
%% Matlab's SVDS
for i= 1:l
tic;
[U,S,V] = svds(A,k(i));
@dgleich
dgleich / hkrelax.py
Last active September 12, 2017 09:00
"""
hkrelax.py
A demonstration of a relaxation method for computing a heat-kernel based
community that implements the algorith from "Heat-kernel based community
detection" by Kloster & Gleich.
Written by Kyle Kloster and David F. Gleich
"""
@dgleich
dgleich / matlabmail.m
Last active June 12, 2023 12:23
A function to send an email from a gmail account in matlab
function recipient = matlabmail(recipient, message, subject, sender, psswd)
% MATLABMAIL Send an email from a predefined gmail account.
%
% MATLABMAIL( recipient, message, subject )
%
% sends the character string stored in 'message' with subjectline 'subject'
% to the address in 'recipient'.
% This requires that the sending address is a GMAIL email account.
%
% MATLABMAIL( recipient, message, subject, sender, passwd )
@dgleich
dgleich / gexpmq.py
Last active August 29, 2015 13:58
A Gauss-Seidel based method to approximate the matrix exponential of a stochastic matrix using a queue
"""
demo_gexpmq.py
A demonstration of the Gauss-Seidel coordinate relaxation scheme
to estimate a column of the matrix exponential that operates
only on significant entries.
Written by Kyle Kloster and David F. Gleich
"""
@dgleich
dgleich / hk_comm_demo.py
Created August 27, 2014 12:46
Heat Kernel Based Community Detection
# Heat Kernel Based Community Detection
# by Kyle Kloster and David F. Gleich
# supported by NSF award CCF-1149756.
#
# This demo shows our algorithm running on the Twitter graph.
# Our other codes are available from David's website:
#
# https://www.cs.purdue.edu/homes/dgleich/codes/hkgrow/
#
# To use this demo, you need pylibbvg graph by David Gleich, Wei-Yen Day, and

Keybase proof

I hereby claim:

  • I am dgleich on github.
  • I am dgleich (https://keybase.io/dgleich) on keybase.
  • I have a public key whose fingerprint is D734 F90F 005B 5BEB 993A EFA4 47D9 CBF5 CC13 99D7

To claim this, I am signing this object:

@dgleich
dgleich / failure.degs
Last active August 29, 2016 16:40
A set of degree that cause an underflow for a plfit command (https://github.com/ntamas/plfit/issues/13)
171
563
43
53
82
69
27
20
270
30
@dgleich
dgleich / triangle-law.jl
Last active September 25, 2018 20:44
Eigenvalues of Triangle Normalized Laplacian in Julia Code
##
using LinearAlgebra
using SparseArrays
using StatsBase
using Plots
using MatrixNetworks
# for Julia 1.0, you need to run
# using Pkg; Pkg.add("MatrixNetworks#2f5c59c")
# to get the latest 1.0 compatible version.
pyplot()