Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18385][ML] Make the transformer's natively in ml framework to avoid extra conversion - #15831
[SPARK-18385][ML] Make the transformer's natively in ml framework to avoid extra conversion#15831techaddict wants to merge 5 commits into
Conversation
techaddict
commented
Nov 9, 2016
SparkQA
commented
Nov 9, 2016
Test build #68410 has finished for PR 15831 at commit
|
SparkQA
commented
Nov 9, 2016
Test build #68411 has finished for PR 15831 at commit
|
I see this patch was created as a result of the PR that separated the ml/mllib linalg packages, to avoid some inefficiencies in conversion. However, it also is a partial step toward feature parity. Typically, we would port full algorithms all at once, instead of just porting the transformer functionality as is done here, but I understand that this is not just about parity. I would suggest one of the following:
For an example of option 2, for private[spark] defcompressDense(
selectedFeatures: Array[Int],
values: Array[Double]):Array[Double] = {
selectedFeatures.map(i => values(i))
}
private[spark] defcompressSparse(
compressedSize: Int,
selectedFeatures: Array[Int],
indices: Array[Int],
values: Array[Double]): (Array[Int], Array[Double]) = {
...
}then in the actual model classes we can just do something like: privatedefcompress(features: Vector):Vector= {
features match {
caseSparseVector(_, indices, values) =>valnewSize= selectedFeatures.length
val (newIndices, newValues) =ChiSqSelectorModel.compressSparse(newSize, selectedFeatures, indices, values)
Vectors.sparse(newSize, newIndices, newValues)
caseDenseVector(values) =>Vectors.dense(ChiSqSelectorModel.compressDense(selectedFeatures, values))
}
}This approach would allow us to avoid copying a lot of code until we do full feature ports. What are others opinions? I lean towards the second option since it keeps the scope reasonable. |
| case DenseVector(values) => | ||
| val values = features.toArray | ||
| Vectors.dense(selectedFeatures.map(i => values(i))) | ||
| case other => |
There was a problem hiding this comment.
btw there is no reason to have this case since Vector is a sealed trait
techaddict
commented
Nov 17, 2016
@sethah I agree, 2nd approach is much more reasonable. |
yanboliang
commented
Nov 21, 2016
@techaddict@sethah I'm more prefer option 1, since we would like to remove spark.mllib package in a future release(may be 3.0) and we wouldn't like to make any change to it except bug fix. Could you make this improvement separately for relevant algorithms? Thanks. |
techaddict
commented
Dec 1, 2016
@sethah@yanboliang I've started with migrating |
I'm also generally supportive of (1) - porting the code to I guess we can start doing this for some transformers like these - but ideally we should focus on porting stuff that's still missing in I'd prefer that we create a top-level JIRA to track all the components that need to be done, and link everything appropriately. We also need to decide on priority - we may realistically be working on it over a 1-1.5 year time frame (of course hopefully it will take a lot shorter). |
techaddict
commented
Dec 2, 2016
@MLnick I will create a umbrella jira and start adding jira's for things I'm aware of of and you can start prioritising 👍 sounds like a plan ? |
zhengruifeng
commented
Jan 10, 2017
the same TODO also appear in |
sethah
commented
Jan 10, 2017
I think we decided to go a different direction than what is proposed here? Actually, I still think there's merit in fixing the problem without having to do full feature ports. Either way, I'm not sure anyone is still taking on this task, so @zhengruifeng or @techaddict it would be great if you wanted to either revive this PR/help review, or start working on the larger umbrella JIRA and sub tasks... |
techaddict
commented
Jan 10, 2017
@sethah I will revive this pr thanks 👍 |
zhengruifeng
commented
Jan 10, 2017
@techaddict@sethah I have some time to work on the porting, but I dont find the umbrella JIRA |
HyukjinKwon
commented
May 11, 2017
Hi @@techaddict, how is this PR going? |
techaddict
commented
May 17, 2017
@HyukjinKwon was busy, will restart this week. |
SparkQA
commented
May 27, 2017
Test build #77448 has finished for PR 15831 at commit
|
# What changes were proposed in this pull request? This PR proposes to close stale PRs, mostly the same instances with apache#18017Closesapache#11459Closesapache#13833Closesapache#13720Closesapache#12506Closesapache#12456Closesapache#12252Closesapache#17689Closesapache#17791Closesapache#18163Closesapache#17640Closesapache#17926Closesapache#18163Closesapache#12506Closesapache#18044Closesapache#14036Closesapache#15831Closesapache#14461Closesapache#17638Closesapache#18222 Added: Closesapache#18045Closesapache#18061Closesapache#18010Closesapache#18041Closesapache#18124Closesapache#18130Closesapache#12217 Added: Closesapache#16291Closesapache#17480Closesapache#14995 Added: Closesapache#12835Closesapache#17141 ## How was this patch tested? N/A Author: hyukjinkwon <gurwls223@gmail.com> Closesapache#18223 from HyukjinKwon/close-stale-prs.
What changes were proposed in this pull request?
Follow Up of
SPARK-14615Transformer's added in ml framework to avoid extra conversion for:
ChiSqSelector
IDF
StandardScaler
PCA
How was this patch tested?
Existing Tests