diff --git a/CM20315_Loss_II.ipynb b/CM20315_Loss_II.ipynb index b3ff145..ce2b348 100644 --- a/CM20315_Loss_II.ipynb +++ b/CM20315_Loss_II.ipynb @@ -5,7 +5,7 @@ "colab": { "provenance": [], "collapsed_sections": [], - "authorship_tag": "ABX9TyOE0qm8aIpEaNh/aI9gnlkY", + "authorship_tag": "ABX9TyMLgMUtCcJHjIzHTTqjKVt1", "include_colab_link": true }, "kernelspec": { @@ -244,6 +244,24 @@ "id": "R5z_0dzQMF35" } }, + { + "cell_type": "code", + "source": [ + "# Return the likelihood of all of the data under the model\n", + "def compute_likelihood(y_train, lambda_param):\n", + " # TODO -- compute the likelihood of the data -- the product of the Bernoullis probabilities for each data point\n", + " # Top line of equation 5.3 in the notes\n", + " # You will need np.prod() and the bernoulli_distribution function you used above\n", + " # Replace the line below\n", + " likelihood = 0\n", + " return likelihood" + ], + "metadata": { + "id": "sk4EJSPQ41CK" + }, + "execution_count": null, + "outputs": [] + }, { "cell_type": "code", "source": [