... human learn: titanic


Before running the code, make sure you've installed the package.

python -m pip install human-learn

The fare_based function defined below can be used to make predictions.

from hulearn.datasets import load_titanic

df = load_titanic(as_frame=True)
X, y = df.drop(columns=['survived']), df['survived']

def fare_based(dataf, threshold=10):
    return np.array(dataf['fare'] > threshold).astype(int)

In the next video we'll explore how to make it into a scikit-learn compatible classifier.

Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider signing up for the newsletter.