Published
Edited
Nov 11, 2021
1 fork
Insert cell
Insert cell
viewof w = Inputs.range([0,3],{step:.01,label:"w"})
Insert cell
viewof b = Inputs.range([-10,10],{step:.01,label:"b"})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mse = (w,b)=>{
const Yhat =X.map(x => w*x+b)
const differences = X.map((x,i)=>Y[i]-Yhat[i])
const squares = differences.map(d => d*d)
const mse = d3.mean(squares)
return mse
}
Insert cell
mse(2.4,-3)
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