In [3]:
import pandas as pd
Classifying Experiments¶
Again let's use the Toy Dataset:
In [4]:
toy_dataset = pd.read_csv('toy_dataset.csv')
toy_dataset.head()
Out[4]:
For the following experiments you will have to decide whether it is a random experiment or a deterministic one. You can either deduce it by reading the code or you can try running the experiment and seeing what happens!
How many times should you try an experiment to be confident it is deterministic?
Once yo have your answer, assign the string 'random' or 'deterministic' to the variable experiment_n_is (where n is the experiment number). The first one will be done as an example.
In [5]:
def experiment_1():
person = toy_dataset.sample(1)
if person['Gender'].values[0] == 'Male':
return person['Income'].values[0]
else:
return person['Age'].values[0]
In [6]:
experiment_1_is = 'random'
--- How to assert the right answers? Should we do this with learn? Or import a different notebook with the answers?---
In [7]:
def experiment_2():
person = toy_dataset.sample(1)
if person['Income'].values[0] < 35000:
return person['Gender'].values[0]
else:
return 'Male'
In [8]:
experiment_2_is =
In [ ]:
def experiment_3():
person = toy_dataset.sample(1)
if person['Gender'].values[0] == 'Male':
return person['Gender'].values[0]
else:
return 'Male'
In [ ]:
experiment_3_is =
In [ ]:
def experiment_4():
person = toy_dataset.sample(1)
In [ ]:
In [ ]: