Published
Edited
Nov 17, 2021
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
model.save("localstorage://my-model-1")
Insert cell
model.save("")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7], [7, 1])
Insert cell
inputTensor = tf.tensor2d(
cars.map((d) => d.horsepower),
[cars.length, 1]
)
Insert cell
labelTensor = tf.tensor2d(
cars.map((d) => d.mpg),
[cars.length, 1]
)
Insert cell
inputMax = inputTensor.max()
Insert cell
inputMin = inputTensor.min()
Insert cell
[stats.max(cars.map((d) => d.horsepower)), stats.max(cars.map((d) => d.mpg))]
Insert cell
normalizedInputs = inputTensor.sub(inputMin).div(inputMax.sub(inputMin))
Insert cell
normalizedInputs.data()
Insert cell
Plotly.newPlot(DOM.element("div"), [
{
x: (await normalizedInputs.array()).map((d) => d[0]),
type: "histogram"
}
])
Insert cell
arr = (await normalizedInputs.array()).map((d) => d[0])
Insert cell
arr.slice(0, 4).map
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