📜  模型显示 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:45.351000             🧑  作者: Mango

代码示例1
ctx = document.getElementById('regressionChart');
  var mixedChart = new Chart(ctx, {
    data: {
        datasets: [{
            type: 'line',
            label: 'Line of Best Fit (r2: '+String(r2)+')',
            data: y_hat,
      borderColor: 'rgb(255, 99, 132)',
        backgroundColor: 'rgba(255, 99, 132, 0.2)'
        }, {
            type: 'scatter',
            label: 'True Values',
            data: y_values,
       backgroundColor: 'rgb(0, 0, 0)',
        }],
        labels: x_values
    }
});

//Write the regression equation to the screen
document.getElementById('regressionEquation').innerHTML = "Regression Equation:  "+String(regressor['slope'])+"*x + "+String(regressor['intercept']);