运行 ❯
获取您
的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Machine Learning</h2> <p>Calculate the Standard Deviation.</p> <div id="demo"></div> <script> // Calulate the Mean (m) let m = (7+8+8+9+9+9+9+10+11+14+15)/11; // Calculate the Sum of Sqares (ss) let ss = (7-m)**2 + (8-m)**2 + (8-m)**2 + (9-m)**2 + (9-m)**2 + (9-m)**2 + (9-m)**2 + (10-m)**2 + (11-m)**2 + (14-m)**2 + (15-m)**2; // Calculate the Variance let variance = ss / 11; // Diplay the Standard Deviation document.getElementById("demo").innerHTML = Math.sqrt(variance); </script> </body> </html>