Created using Colaboratory
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"colab": {
|
"colab": {
|
||||||
"provenance": [],
|
"provenance": [],
|
||||||
"collapsed_sections": [],
|
"collapsed_sections": [],
|
||||||
"authorship_tag": "ABX9TyPBGTxs29MOs80wv5LpyIcV",
|
"authorship_tag": "ABX9TyOE0qm8aIpEaNh/aI9gnlkY",
|
||||||
"include_colab_link": true
|
"include_colab_link": true
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
@@ -244,24 +244,6 @@
|
|||||||
"id": "R5z_0dzQMF35"
|
"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 normal probabilities for each data point\n",
|
|
||||||
" # Top line of equation 5.3 in the notes\n",
|
|
||||||
" # You will need np.prod() and the normal_distribution function you used above\n",
|
|
||||||
" # Replace the line below\n",
|
|
||||||
" likelihood = 0\n",
|
|
||||||
" return likelihood"
|
|
||||||
],
|
|
||||||
"metadata": {
|
|
||||||
"id": "zpS7o6liCx7f"
|
|
||||||
},
|
|
||||||
"execution_count": null,
|
|
||||||
"outputs": []
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"source": [
|
"source": [
|
||||||
@@ -339,6 +321,24 @@
|
|||||||
"id": "OgcRojvPWh4V"
|
"id": "OgcRojvPWh4V"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"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 Bernoulli 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": "zpS7o6liCx7f"
|
||||||
|
},
|
||||||
|
"execution_count": null,
|
||||||
|
"outputs": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"source": [
|
"source": [
|
||||||
|
|||||||
Reference in New Issue
Block a user