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.
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 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.
| import numpy as np | |
| import sys | |
| def read_stored(num_dims, names_filename, data_filename): | |
| import pandas as pd | |
| names = pd.Index(line.strip() for line in open(names_filename)) | |
| num_terms = len(names) | |
| data = np.memmap(data_filename, dtype=np.float32, mode='r', shape=(num_terms, num_dims)) | |
| return names, data |
| .mturk-ari { | |
| border: 1px solid black; | |
| padding: 4px; | |
| } | |
| .mturk-ari th { | |
| padding-right: 5px; | |
| text-align: right; | |
| } |
| def reconstruct_lkj_cholesky(ell, R2): | |
| num_items = len(R2) + 1 | |
| L = np.zeros((num_items, num_items)) | |
| L[0, 0] = 1. | |
| L[1, 0] = 2. * R2[0] - 1.0 | |
| L[1, 1] = np.sqrt(1.0 - L[1, 0]) | |
| start = 0 | |
| for i in range(2, num_items): | |
| ell_row = ell[start:start+i] |
| import pandas as pd | |
| import sys | |
| filename, outfile = sys.argv[1:3] | |
| responses = pd.read_csv(filename) | |
| def format_row(row): | |
| return '\n'.join(["<p><b>{}</b><br>{}</p>".format(k, v.replace('\n', '<br>')) for k, v in row.iteritems()]) | |
| # | |
| # SPI driver (using spidev device) | |
| # | |
| # Copyright (c) 2013 Kenneth Arnold <[email protected]> | |
| # Copyright (c) 2007 MontaVista Software, Inc. | |
| # Copyright (c) 2007 Anton Vorontsov <[email protected]> | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 2 of the License. |
| #!/usr/bin/env python | |
| import numpy as np | |
| import sys | |
| from six import iteritems | |
| from six.moves import zip as izip | |
| from six.moves import xrange | |
| from itertools import chain, repeat, islice |
| from collections import OrderedDict | |
| from boto.mturk.connection import MTurkConnection | |
| from dateutil.parser import parse as dateparse | |
| mtc = MTurkConnection(host='mechanicalturk.amazonaws.com') | |
| def responses(hit_group_id): | |
| responses = [] | |
| for hit in mtc.get_all_hits(): |
| import numpy as np | |
| from sklearn.covariance import graph_lasso | |
| from sklearn.utils.extmath import pinvh | |
| def compute_K(n, S, D): | |
| K = np.zeros((n,n)) | |
| for a, b in S: | |
| K[a,b] = 1 | |
| #K[b,a] = 1 | |
| for a, b in D: |