Skip to main content

Prediction of gender probabilities for English names.

Project description

Prediction of genders of english names based on US Social Security data. The gender probability of each name is computed based on the number of male and female babies that were given this name between 1880 and 2017.

The full data can be found at https://www.ssa.gov/oact/babynames/limits.html

Description

The main function returns the probability for a given english name to be a male name. There are optional arguments start_year (default 1880) and end_year (default 2018) to use a specific period of time for calculation. For instance, for gender prediction of babyboomers, the period can be set to 1946-1965. If the name is absent from the database, None is returned.

Installation

Requires package sqlite3. The code was only tested with Python 3.7.

$ pip install NameGenderPredictor

Basic Usage

Function predict_gender is case insensitive for names (see below).

>>> from NameGenderPredictor import predict_gender
>>> print(predict_gender('john'))
0.9957852975260119
>>> print(predict_gender('Avi'))
0.8783253379851723
>>> print(predict_gender('chris'))
0.8632186721917374
>>> print(predict_gender('chris'),start_year=2000,end_year=2010)
0.9833235466823254
>>> print(predict_gender('chris'),start_year=1950,end_year=1965)
0.8111958317448215

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NameGenderPredictor-0.0.1.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NameGenderPredictor-0.0.1-py3-none-any.whl (5.3 MB view details)

Uploaded Python 3

File details

Details for the file NameGenderPredictor-0.0.1.tar.gz.

File metadata

  • Download URL: NameGenderPredictor-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

File hashes

Hashes for NameGenderPredictor-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d6a34f697c93fa0588dd1b1e68dc0163da08dab06bf7d898b420e60252ed05a6
MD5 399ce83dbaab5324218ef7a35ebd9b3c
BLAKE2b-256 a94357aafaff00c5b84abde2879a61187d2f54b114d4f6a28c37377d0ecf1aae

See more details on using hashes here.

File details

Details for the file NameGenderPredictor-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: NameGenderPredictor-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

File hashes

Hashes for NameGenderPredictor-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 229a21645134a8c6ac7c32df8d48c2d03d6241cee2736c2aec99819139160ec4
MD5 db7e8065d1d905997eff74f1c3f6d41e
BLAKE2b-256 c2e601e10e0721fc6190252e4cd89743950c93f3551605ff309c8d247d65c363

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page