Public
Edited
Nov 13, 2022
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
url = await FileAttachment("pca-titel-bild-embeds.csv").url()
Insert cell
umapUrl = await FileAttachment("umap-bild-titel-neu.csv").url()
Insert cell
csv = d3.csv(url)
Insert cell
Insert cell
Insert cell
getDistancesForId = async id => {
const tensor = data.find(d => d.id == id).tensor.as2D(512,1)
const distance = await stackedTensors.matMul(tensor).data()
const sorted = data
.map((d,i) => ({ id: d.id, i, score: distance[i] }))
.sort((a,b) => b.score - a.score)
return sorted.map((d,rank) => ({ ...d, rank }))
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3")
Insert cell
tf = require("@tensorflow/tfjs")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more