parth-paradkar / LeastSquareMethod

This program plots(gives the points to be plotted) the best fitting linear graph from a set of readings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LeastSquareMethod


Plot a linear graph from a set of given coordinates that crosses the least number of squares on the graph.

How to install:

  1. Open a new terminal window and create a folder in the desired location
mkdir leastsquare
  1. Clone this repository in this directory
git clone https://github.com/parthmax99/LeastSquareMethod.git
  1. You are good to go!

Usage

  1. If the data is stored in a CSV file, enter the file path(filename in case the file is present in the current directory as an argument)

Terminal command for CSV file

  1. For a sample dataset the result will be as follows:

Example 1

  1. For a small number of points, you might prefer feeding the data through the terminal itself. The points must be in the format [x,y]

Terminal input

  1. Output:

Example 2

About

This program plots(gives the points to be plotted) the best fitting linear graph from a set of readings.

License:MIT License


Languages

Language:Python 100.0%