File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/com/thealgorithms/machinelearning Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .util .ArrayList ;
4
4
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
+
5
15
class LinearRegression {
6
16
private ArrayList <Double > dependentX = new ArrayList <Double >();
7
17
private ArrayList <Double > independentY = new ArrayList <Double >();
8
18
private double m ;
9
19
private double c ;
10
20
21
+ /**
22
+ * @param : X (dependent variable), Y (independent variable) as ArrayList
23
+ */
11
24
public LinearRegression (ArrayList <Double > dependentX , ArrayList <Double > independentY ) {
12
25
this .dependentX = dependentX ;
13
26
this .independentY = independentY ;
You can’t perform that action at this time.
0 commit comments