Here’s Best Example of ML to Know Person’s Marital Status

In this post, I have shared a process to build a model using Machine Learning.

Here are three layers of ML Model

  1. Data
  2. Modeling
  3. Prediction

Every project you need flow. In this ML modelling, a hidden process involved.

ML Modelling
Flowchart on ML model building

I am explaining the steps involved in building the ML model. There is a total of three steps to developing a model.

1). Historical Data

The first thing is you need the right kind of data. The data can be your old data that acts as an input to a machine learning model.

S.NoNameAgeIncomeTarget
1Ramu2350,000Unmarried
2Krishna2780,000Married

2). Model Building

The concept of model building is you need to assign your data to your algorithm.

Data ==> Model

3). Internal Mechanism of Algorithm

data = load_data("data/people.csv")
model = build_model(data, target="Marital status")
new_data = load_data("data/new_people.csv")
predictions = model.predict(new_data)

Model Evaluation

data = load_data(...)
training_data, testing_data = split_data(data)
model = build_model(training_data, target="Marital status")
true_values = testing_data.extract_column("Marital status")
predictions = model.predict(testing_data)
accuracy = compare_predictions(predictions, true_values)

In the model evaluation, feed only some of your data to algorithm. The remaining data you can use it for evaluation/testing.

Feed input and get answers from the model, then compare these results to actual/true values. Then you will know how your model is working.

Summary

In the testing for the given input, it should tell about a person’s marital status. The accuracy of the model will be calculated based on right or wrong answers.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.