This is a simple implementation of MDS. Dragging an item constrains it; double-clicking removes the constraint. The cost is shown in the top left.
The data is eurodist
from R.
This is a simple implementation of MDS. Dragging an item constrains it; double-clicking removes the constraint. The cost is shown in the top left.
The data is eurodist
from R.
Compare colors by hue, saturation, or lightness. The sliders adjust the weights. It seems like the main effect is whether the weight is 0 or not.
The embedding is simply links to the 5 nearest neighbors, according to that metric.
This is a simple demo of affinity propagation. Drag the slider to adjust the 'preference' or self-affinity level.
References:
import numpy as np | |
class IncrementalMoments(object): | |
'''Knuth's incremental mean and variance computation, applied elementwise.''' | |
def __init__(self, shape, initial_items=[]): | |
self.n = 0 | |
self.mean = np.zeros(shape) | |
self.m2 = np.zeros(shape) | |
self.update_seq(initial_items) |
# https://black.readthedocs.io/en/stable/ | |
import json | |
import black | |
import re | |
magic_re = re.compile(r'^%', flags=re.MULTILINE) | |
ipymagic = '##IpyMagic##' | |
filename = 'notebook.ipynb' |
on run {input, parameters} | |
set PDFs to input | |
set msubject to "to print: " | |
repeat with aFile in PDFs | |
tell application "Finder" | |
set filename to ((name of aFile) as string) | |
end tell | |
set msubject to msubject & filename & "," | |
end repeat | |
tell application "Microsoft Outlook" |
class VecPile: | |
"""An attribute-accesed collection that asserts that all of its elements have the same length. | |
Useful for keeping several collections together, such as vectors with labels, or several different representations of the same data.""" | |
def __init__(self, **kw): | |
for k, v in kw.items(): | |
setattr(self, k, v) | |
@staticmethod |
print( | |
', '.join( | |
sorted( | |
subprocess.check_output('pbpaste').decode('utf-8').split('\n'), | |
key=lambda name: name.split()[-1]) | |
) | |
) |
import sched | |
import time | |
import asyncio | |
import datetime | |
start_time = time.time() | |
def tick(a='default'): | |
print("From tick", time.time() - start_time, a) |