Skip to content

Infer gender

inferencemodel

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.

Usage


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

Step signature
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.

Example

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

Example call (in recipe editor)
infer_gender(ds.first_name) -> (ds.gender)
More examples

To use labels "M" and "F" instead

Example call (in recipe editor)
infer_gender(ds.first_name), "labels": {"male": "M", "female": "F"}) -> (ds.gender)

Inputs


first_name: column:category

Column containing first names.

Outputs


gender: column:sex

Predicted gender for each name.

Parameters


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.