Gender Guesser (i2tutorials)

Gender Prediction Using Machine Learning

Gender Guesser is a tool used to predict the gender of a person just by seeing Name. To find gender of enormous number of people, it is impossible to analyze each person’s gender manually. Frequently in Business Analysis, it is significant to know the gender of a person for Endorsing the business. Gender Guesser plays a key role in these circumstances. It finds out the gender of every single person in a given list by using different classification models.

Data Extraction:

Data required for training of the classification model should contain abundant names with their gender declared. Data in CSV format will be easy for Extraction. Names with Gender data can be downloaded from https://data.world/howarder/gender-by-name , https://data.world/arunbabu/gender-by-names , http://www.indianhindunames.com/find-gender-from-names.htm. This downloaded data is saved in CSV file format.

By Importing Pandas in Python, we can extract the downloaded data into the algorithm.

Feature Extraction:

The words or Names required to be encoded as integers or Floating-Point Values to use as an input to a Machine Learning Algorithm, called Feature Extraction or Vectorization. The Count Vectorizer provides a simple way to both tokenize a collection of text documents and build a vocabulary of known words, but also to encode new documents using that vocabulary.

Create the Count Vectorizer class. Call the fit () function in order to learn a vocabulary from the document. Call the transform () function to encode each as a vector. The vectors returned from a call to transform () will be sparse vectors, and you can transform them back to NumPy arrays to look and better understand what is going on by calling the toarray() function.

Data Splitting:

For Training the Machine Learning model, Data should be split into Training and Testing Data sets. X is taken as Names in Data set whereas y is taken as gender of respective name signified in the Data set. So that we have Two training and Two testing Data sets. Data can be split by using train_test_split.

Training the Model:

After Splitting the Data, we have to find the algorithms that are appropriate and practical to implement in a reasonable time. While Selecting the Algorithm we have to consider the accuracy of the model, complexity of a model, Processing time to Build, Train, and Testing the model. To get the better model accuracy for a model, we can perform hyper parameter Tuning in order to find out the finest Parameters of a model which will give the more model accuracy.

There are three methods of Hyper Parameter Tuning:

Grid Search

Random Search

Bayesian Optimization

By considering above conditions we have to pick the best classification model to our data.

 

Testing the Model:

After Training the Data, We Test the Data by giving a list of Names which the Data may or may not comprise. It has to forecast or predict the gender of each Person Name in the List accurately.

Applications:

It is Mostly used in Business Analysis in order to know the person’s general Likes and Dislikes to promote their Products.

Conclusion:

This Gender Guesser will help to reduce time in identifying the gender of a person. It can distinguish enormous number of Names into Male or Female in Single Time, Precisely.

Leave a comment