-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added linear regression #332
Conversation
Codecov Report
@@ Coverage Diff @@
## master #332 +/- ##
==========================================
+ Coverage 94.95% 96.33% +1.37%
==========================================
Files 55 57 +2
Lines 991 1009 +18
Branches 10 10
==========================================
+ Hits 941 972 +31
+ Misses 50 37 -13
Continue to review full report at Codecov.
|
def setEpsilon(value: Double): TypedLinearRegression[Inputs] = copy(lr.setEpsilon(value)) | ||
|
||
private def copy(newRf: LinearRegression): TypedLinearRegression[Inputs] = | ||
new TypedLinearRegression[Inputs](newRf, labelCol, featuresCol, weightCol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to lr
pDs.select(pDs.col('a), pDs.col('b)).collect.run() == Seq(x2.a -> x2.b) | ||
} | ||
val prop2 = forAll { x2: X2[Vector, Double] => | ||
val rf = TypedLinearRegression[X2[Vector, Double]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rf? -.-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to lr
) | ||
|
||
val ds2 = Seq( | ||
X3(new DenseVector(Array(1.0)): Vector,2: Float, 1.0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use 2F instead of 2: Float
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
model.transformer.getAggregationDepth == 10 && | ||
model.transformer.getElasticNetParam == 0.5 && | ||
model.transformer.getEpsilon == 4.0 && | ||
model.transformer.getFitIntercept == true && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could skip == true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
model.transformer.getLoss == lossStrategy.sparkValue && | ||
model.transformer.getMaxIter == 23 && | ||
model.transformer.getRegParam == 1.2 && | ||
model.transformer.getStandardization == true && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above, == true
is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
implicit val arbLossStrategy: Arbitrary[LossStrategy] = Arbitrary { | ||
Gen.oneOf( | ||
Gen.const(LossStrategy.SquaredError), | ||
Gen.const(LossStrategy.SquaredError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LossStrategy.Huber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
345d6cd
to
d03c5a8
Compare
@@ -0,0 +1,50 @@ | |||
package frameless.ml.regression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package frameless
package ml
package regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for all files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure as you wish
Thanks a lot for the PR! Merging 🎉 |
#215