File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Linear Regression/LinearRegression.playground Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ func predictedCarPrice(carAge: Double) -> Double {
13
13
14
14
// An iterative approach
15
15
16
- let numberOfCarAdvertsWeSaw = carPrice. count - 1
16
+ let numberOfCarAdvertsWeSaw = carPrice. count
17
17
let numberOfIterations = 100
18
18
let alpha = 0.0001
19
19
20
20
for n in 1 ... numberOfIterations {
21
- for i in 0 ... numberOfCarAdvertsWeSaw {
21
+ for i in 0 ..< numberOfCarAdvertsWeSaw {
22
22
let difference = carPrice [ i] - predictedCarPrice( carAge [ i] )
23
23
intercept += alpha * difference
24
24
slope += alpha * difference * carAge[ i]
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ Bad sorting algorithms (don't use these!):
104
104
105
105
- [ k-Means Clustering] ( K-Means/ ) . Unsupervised classifier that partitions data into * k* clusters.
106
106
- k-Nearest Neighbors
107
- - Linear Regression
107
+ - [ Linear Regression] (Linear Regression/)
108
108
- Logistic Regression
109
109
- Neural Networks
110
110
- PageRank
You can’t perform that action at this time.
0 commit comments