We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c9e3a8 commit 087dc18Copy full SHA for 087dc18
Linear Regression/LinearRegression.playground/Contents.swift
@@ -34,7 +34,7 @@ func average(_ input: [Double]) -> Double {
34
}
35
36
func multiply(_ input1: [Double], _ input2: [Double]) -> [Double] {
37
- return input1.enumerated().map({ (index, element) in return element*input2[index] })
+ return zip(input1, input2).map { $0.0 * $0.1 }
38
39
40
func linearRegression(_ xVariable: [Double], _ yVariable: [Double]) -> ((Double) -> Double) {
0 commit comments