Skip to content

Commit 73ad49a

Browse files
authored
Update LinearRegression.java
comments added
1 parent 08192cd commit 73ad49a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/com/thealgorithms/machinelearning/LinearRegression.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22

33
import java.util.ArrayList;
44

5+
/**
6+
* Author : Gowtham Kamalasekar
7+
* LinkedIn : https://www.linkedin.com/in/gowtham-kamalasekar/
8+
*
9+
* Linear Regression Machine Learning Algorithm is a regression algorithm.
10+
* This programs used for computing y = mx + c
11+
* Where m is slope and c is intercept
12+
* We can use this too predict for a given x.
13+
*/
14+
515
class LinearRegression {
616
private ArrayList<Double> dependentX = new ArrayList<Double>();
717
private ArrayList<Double> independentY = new ArrayList<Double>();
818
private double m;
919
private double c;
1020

21+
/**
22+
* @param : X (dependent variable), Y (independent variable) as ArrayList
23+
*/
1124
public LinearRegression(ArrayList<Double> dependentX, ArrayList<Double> independentY) {
1225
this.dependentX = dependentX;
1326
this.independentY = independentY;

0 commit comments

Comments
 (0)