Platform
Resources
Pricing
Sign in
Contact us
Charles Redmond
Workspace
Fork
Published
Fall21CalcApp
By
Charles Redmond
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
w
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
b
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
X
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Y
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mse
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML