Skip to content

A python implementation of Linear Regression (Gradient Descent and Normal Equation)

License

Notifications You must be signed in to change notification settings

guillemalomar/LinearRegression

Repository files navigation

Linear Regression

  • Title: Linear Regression
  • Author: Guillem Alomar
  • Initial release: June 4th, 2019
  • Code version: 0.1
  • Availability: Public

Index

Requirements

  • Python +3.5
  • matplotlib +3.1.1

Documentation

Explanation

This application consists in a Linear Regression implementation in python3.

It can be calculated by Gradient Descent or with the Normal Equation.

Using the application

First of all

Execution parameters

You can modify the execution parameters in src/settings.py

You should also add your training set csv to the input folder.

Executing

This is done by typing the following command:

$ python3 LinearRegression.py

Additional Parameters

-> % python LinearRegression.py -h
usage: LinearRegression.py [-h] [-f FILE] [-m MODE] [-i INPUT]

Linear Regression

optional arguments:
  -h, --help                show this help message and exit
  -f FILE, --file FILE      CSV input file. If not specified it will use a default one.
  -m MODE, --mode MODE      Application mode: GD (Gradient Descent)| NM (Normal Equation). Default: GD
  -i INPUT, --input INPUT   Input values to process. Between 's. Example: '2.2 3.3'. Default: Random

The output

Once the execution has finished, the resulting images will be stored in output/. These images should look similar to the following ones:

alt text

alt text

The names of the images follow the next syntax:

$inputname_output.png

Logs can be found both in the execution terminal and in src/execution.log

About

A python implementation of Linear Regression (Gradient Descent and Normal Equation)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages