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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more