Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for labs 03 and 04 of 8.2X (updated with new project) #4

Open
wants to merge 1 commit into
base: project_lab_changes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
581 changes: 581 additions & 0 deletions materials/x19/lab/2/lab03_new/causes_of_death.csv

Large diffs are not rendered by default.

3,843 changes: 3,843 additions & 0 deletions materials/x19/lab/2/lab03_new/framingham.csv

Large diffs are not rendered by default.

717 changes: 717 additions & 0 deletions materials/x19/lab/2/lab03_new/lab03.ipynb

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions materials/x19/lab/2/lab03_new/project2.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Project 2: Diet and Disease",
"endpoint": "cal/data8/fa18/project2",
"src": [
"project2.ipynb"
],
"tests": {
"tests/q*.py": "ok_test"
},
"protocols": [
"file_contents",
"grading",
"backup"
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 23 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q1_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
test = {
'name': 'Question 1.1',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> # Make sure answer is the right type
>>> type(all_unique_causes) in [np.ndarray, list]
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
23 changes: 23 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q1_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
test = {
'name': 'Question 1.2',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> # Make sure the columns are correct
>>> list(causes_for_plotting.labels) == ['Year'] + sorted(all_unique_causes)
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_1_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.1.1',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> -1 <= observed_diabetes_distance <= 1
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_1_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.1.2',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> len(diabetes_simulated_stats) == 5000
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_1_5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.1.5',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> type(framingham_diabetes_possibilities) in [np.ndarray, list]
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_2_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.2.1',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> isinstance(reasonable_test, (float, int, np.integer))
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_2_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.2.3',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> isinstance(compute_framingham_test_statistic(framingham), (float, int, np.integer))
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_2_4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.2.4',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> isinstance(framingham_observed_statistic, (float, int, np.integer))
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
26 changes: 26 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_2_5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
test = {
'name': 'Question 2.2.5',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> _framingham_sim1 = simulate_framingham_null()
>>> _framingham_sim2 = simulate_framingham_null()
>>> _framingham_sim1 != _framingham_sim2
True
>>> _framingham_sim1 < framingham_observed_statistic and _framingham_sim2 < framingham_observed_statistic
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
22 changes: 22 additions & 0 deletions materials/x19/lab/2/lab03_new/tests/q2_2_7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test = {
'name': 'Question 2.2.7',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> 0.0 <= framingham_p_value <= 0.05
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'
}
]
}
Loading