Git Product home page Git Product logo

linear-regression-project-tutorial's Introduction

Linear regression - Step by step guide

  • Understand a new dataset.
  • Process it by applying exploratory data analysis (EDA).
  • Model the data using logistic regression.
  • Analyze the results and optimize the model if possible.

๐ŸŒฑ How to start this project

Follow the instructions below:

  1. Create a new repository based on machine learning project by clicking here.
  2. Open the newly created repository in Codespace using the Codespace button extension.
  3. Once the Codespace VSCode has finished opening, start your project by following the instructions below.

๐Ÿš› How to deliver this project

Once you have finished solving the exercises, be sure to commit your changes, push to your repository and go to 4Geeks.com to upload the repository link.

๐Ÿ“ Instructions

Predicting the cost of health insurance for a person

The important insurance company 4Geeks Insurance S.L. wants to calculate, based on physiological data of its customers what will be the premium (cost) to be borne by each of them. To do this, it has assembled a whole team of doctors and based on data from other companies and a particular study have managed to gather a set of data to train a predictive model.

Step 1: Loading the dataset

The dataset can be found in this project folder under the name medical_insurance_cost.csv. You can load it into the code directly from the link (https://raw.githubusercontent.com/4GeeksAcademy/linear-regression-project-tutorial/main/medical_insurance_cost.csv) or download it and add it by hand in your repository. In this dataset you will find the following variables:

  1. age. Age of primary beneficiary (numeric)
  2. sex. Gender of the primary beneficiary (categorical)
  3. bmi. Body mass index (numeric)
  4. children. Number of children/dependents covered by health insurance (numeric)
  5. smoker. smoker (categorical)
  6. region. Beneficiary's residential area in the U.S.: northeast, southeast, southwest, northwest (categorical)
  7. charges. Health insurance premium (numerical)

Step 2: Perform a full EDA

This second step is vital to ensure that we keep the variables that are strictly necessary and eliminate those that are not relevant or do not provide information. Use the example Notebook we worked on and adapt it to this use case.

Be sure to conveniently divide the data set into train and test as we have seen in previous lessons.

Step 3: Build a linear regression model

You do not need to optimize the hyperparameters. Start by using a default definition and improve it in the next step.

Step 4: Optimize the previous model

After training the model, if the results are not satisfactory, optimize it if possible.

NOTE: Solution: https://github.com/4GeeksAcademy/linear-regression-project-tutorial/blob/main/solution.ipynb

linear-regression-project-tutorial's People

Contributors

danielaaz04 avatar alesanchezr avatar cvazquezlos avatar tommygonzaleza avatar lorenagubaira avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.