Skip to content

Infer gender

inference ยท model

Try to infer a person's gender given a first name.

Uses a machine learning model trained on a large database of names and the frequencies of associated genders.


To use the default labels "male" and "female" in the resulting output simply use

infer_gender(ds.first_name) -> (ds.gender)
More examples

To use labels "M" and "F" instead

infer_gender(ds.first_name), "labels": {"male": "M", "female": "F"}) -> (ds.gender)


The following are the step's expected inputs and outputs and their specific types.

infer_gender(first_name: category, {"param": value}) -> (gender: sex)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.


first_name: column:category

Column containing first names.


gender: column:sex

Predicted gender for each name.


labels: object

Labels for the male and female categories. An object mapping the "male" and "female" categories to custom labels.

Items in labels

male: string = "male"

Label for the "male" category.

female: string = "female"

Label for the "female" category.