Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMonks committed Sep 20, 2024
1 parent 697893a commit 8813b08
Show file tree
Hide file tree
Showing 320 changed files with 19,664 additions and 27,572 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 078edd53628af2d11d0ae886ac4b415f
config: e906d2457507cec8a093e957d9d93bf5
tags: 645f666f9bcd5a90fca523b33c5a78b7
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file added _images/package_versus_project.png
Binary file added _images/release.png
Binary file added _images/test_pypi2.png
Binary file added _images/test_pypi3.png
Binary file added _images/testpypi.png
4 changes: 2 additions & 2 deletions _sources/content/001_setup/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ The book will evolve over time. I'd greatly welcome feedback, via Github issues,
For new content requests please

* Detail the requested content including description and lists of any relevant packages
* Provide a case why this content relevant to health data scientist
* Explain why this content is relevant to health data scientists
* Optional: provide an example
* Label the issue an an `enhancement`
* Label the issue as an `enhancement`

### General feedback

Expand Down
7 changes: 0 additions & 7 deletions _sources/content/001_setup/docker.md

This file was deleted.

4 changes: 2 additions & 2 deletions _sources/content/001_setup/prereq/02_dicts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"A few things to notice: \n",
"\n",
"* A `dict` uses `{}` \n",
"* Key and item pairs are separated by a semi colon\n",
"* Key and item pairs are separated by a colon\n",
"* The data type of the keys and items do not need to be consistent. It can be any type you require.\n",
"\n",
"> My recommendation is that you keep the data type for the **key** consistent. This simplification avoids silly mistakes. Flexibility isn't always your friend! \n",
Expand Down Expand Up @@ -333,7 +333,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions _sources/content/01_algorithms/03_numpy/01_performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"4.51 ms ± 195 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
"4.51 ms ± 145 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
]
}
],
Expand All @@ -156,7 +156,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"382 µs ± 2.41 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
"215 μs ± 16.2 μs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)\n"
]
}
],
Expand Down Expand Up @@ -205,7 +205,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-7-d7ebd5f93b3a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmy_arr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m7\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"Cell \u001b[0;32mIn[7], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mmy_arr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mappend\u001b[49m(\u001b[38;5;241m7\u001b[39m)\n",
"\u001b[0;31mAttributeError\u001b[0m: 'numpy.ndarray' object has no attribute 'append'"
]
}
Expand Down Expand Up @@ -237,7 +237,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-8-e9bed3bd39fc>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmy_arr\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'Zero'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"Cell \u001b[0;32mIn[8], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mmy_arr\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mZero\u001b[39m\u001b[38;5;124m'\u001b[39m\n",
"\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: 'Zero'"
]
}
Expand Down Expand Up @@ -297,7 +297,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -311,7 +311,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions _sources/content/01_algorithms/03_numpy/05_statistics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -768,7 +768,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
79 changes: 73 additions & 6 deletions _sources/content/01_algorithms/04_exercises/01_science_funcs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,79 @@
},
{
"cell_type": "markdown",
"id": "84b24f22",
"id": "fc913e7c-de34-4b5d-aa9e-91f0fbc3365a",
"metadata": {},
"source": [
"---\n",
"## Exercise 3\n",
"\n",
"A classic **M**arkovian model for representing the steady state performance of queuing and service system is the **M**/**M**/1. \n",
"\n",
"In the Markovian model \"customers\" arrive to the model following a Poisson process with rate parameter $\\lambda$ (e.g. an average of 5 arrivals per hour). The M/M/1 is a first come first served system with a single server. Service time is exponentially distributed with mean $1/\\mu$ i.e. customers are served at rate $\\mu$.\n",
"\n",
"The equation for calculating the average waiting time to be served ($W_q$) in an M/M/1 queue is:\n",
"\n",
"$$W_q = \\dfrac{\\lambda}{\\mu\\left(\\mu-\\lambda\\right)}$$\n",
"\n",
"While the probability that there are $n$ customers in the system ($P_n$) is given by:\n",
"\n",
"$$P_n = \\left(1 - \\dfrac{\\lambda}{\\mu}\\right)\\left(\\dfrac{\\lambda}{\\mu}\\right)^n$$\n",
"\n",
"\n",
"**Example:**\n",
"\n",
"Given:\n",
"\n",
"$$\\lambda = 2 \\textnormal{ per hour}$$\n",
"$$\\mu = 3 \\textnormal{ per hour}$$\n",
"\n",
"Calculate $W_q$ and $P_0, P_1$\n",
"\n",
"$$W_q = \\dfrac{2}{3\\left(3 - 2\\right)} = \\dfrac{2}{3} \\textnormal{ per hour}$$\n",
"\n",
"\n",
"$$P_0 = \\left(1 - \\dfrac{\\lambda}{\\mu}\\right) = 1 - \\dfrac{2}{3} = \\dfrac{1}{3}$$\n",
"\n",
"$$P_1 = \\left(\\dfrac{1}{3}\\right)\\left(\\dfrac{2}{3}\\right) = \\dfrac{2}{9}$$\n",
"\n",
"**Task:**\n",
"\n",
"Code functions in python to calculate $W_q$ and $P_n$ for the M/M/1 queue model.\n",
"\n",
"**Test data:**\n",
"\n",
"```python\n",
"arrival_rate = 2.0\n",
"service_rate = 3.0\n",
"expected_wq = 2/3\n",
"expected_p0 = 1/3\n",
"expected_p1 = 2/9\n",
"expected_p2 = 4/27\n",
"```\n",
"\n",
"\n",
"**Hints:**\n",
"* Note that the word \"lambda\" is a special word in Python and should not be used as a variable name. When naming a variable options are to use `_lambda` or `arrival_rate`\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5952f2c3-bc8a-43a7-a398-3c8068a53274",
"metadata": {},
"outputs": [],
"source": [
"# your code here..."
]
},
{
"cell_type": "markdown",
"id": "84b24f22",
"metadata": {},
"source": [
"---\n",
"## Exercise 4\n",
"\n",
"(source: hackerrank.com)\n",
"\n",
"A left rotation operation on an array shifts each of the array's elements unit to the left. \n",
Expand Down Expand Up @@ -222,7 +289,7 @@
"metadata": {},
"source": [
"---\n",
"## Exercise 4\n",
"## Exercise 5\n",
"\n",
"The Fibonacci numbers, denoted $F_n$, form a sequence, called the **Fibonacci sequence**, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is\n",
"\n",
Expand Down Expand Up @@ -261,7 +328,7 @@
"metadata": {},
"source": [
"---\n",
"## Exercise 5\n",
"## Exercise 6\n",
"\n",
"(source hackerrank.com)\n",
"\n",
Expand Down Expand Up @@ -339,7 +406,7 @@
"metadata": {},
"source": [
"---\n",
"## Exercise 6\n",
"## Exercise 7\n",
"\n",
"The longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence's elements are in sorted order, lowest to highest, and in which the subsequence is as long as possible.\n",
"\n",
Expand Down Expand Up @@ -372,7 +439,7 @@
"metadata": {},
"source": [
"---\n",
"## Exercise 7:\n",
"## Exercise 8:\n",
"\n",
"(source: hackerrank.com)\n",
"\n",
Expand Down Expand Up @@ -500,7 +567,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions _sources/content/01_algorithms/04_exercises/02_array.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
"source": [
"## Exercise 8\n",
"\n",
"You can think of the 3 dimensional array constructed in the last exercise as an array of two $10 \\times 2$ sub-matricies (indexed 0 to 1). Each matrix is comprised of 10 sub vectors (indexed 0 to 9).\n",
"Remember one way to get to grips with slicing a 3D array is to look at the shape and think about how it all links together. In the last exercise the array td has a shape $(2, 10, 5)$. I think of this as 2 rows, each of which contains 10 sub vectors of length 5\n",
"\n",
"Using the 3 dimensional array constructed in exercise 7 take the following **slices** and if necessary make the updates to the **original** data:\n",
"\n",
Expand Down Expand Up @@ -386,7 +386,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 8813b08

Please sign in to comment.