Update 8_2_Bias_Variance_Trade_Off.ipynb
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
" for i in range(n_data):\n",
|
||||
" x[i] = np.random.uniform(i/n_data, (i+1)/n_data, 1)\n",
|
||||
"\n",
|
||||
" # y value from running through functoin and adding noise\n",
|
||||
" # y value from running through function and adding noise\n",
|
||||
" y = np.ones(n_data)\n",
|
||||
" for i in range(n_data):\n",
|
||||
" y[i] = true_function(x[i])\n",
|
||||
@@ -229,7 +229,7 @@
|
||||
" y_model_all = np.zeros((n_datasets, x_model.shape[0]))\n",
|
||||
"\n",
|
||||
" for c_dataset in range(n_datasets):\n",
|
||||
" # TODO -- Generate n_data x,y, pairs with standard divation sigma_func\n",
|
||||
" # TODO -- Generate n_data x,y, pairs with standard deviation sigma_func\n",
|
||||
" # Replace this line\n",
|
||||
" x_data,y_data = np.zeros([1,n_data]),np.zeros([1,n_data])\n",
|
||||
"\n",
|
||||
@@ -316,7 +316,7 @@
|
||||
"\n",
|
||||
" # Compute variance -- average of the model variance (average squared deviation of fitted models around mean fitted model)\n",
|
||||
" variance[c_hidden] = 0\n",
|
||||
" # Compute bias (average squared deviaton of mean fitted model around true function)\n",
|
||||
" # Compute bias (average squared deviation of mean fitted model around true function)\n",
|
||||
" bias[c_hidden] = 0\n",
|
||||
"\n",
|
||||
"# Plot the results\n",
|
||||
|
||||
Reference in New Issue
Block a user