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
[FLINK-2157] [ml] Create evaluation framework for ML library #1849
Conversation
Closed the previous PR and opened this one for the evaluation framework, as I had some issues with rebasing. |
Are there going to be useage docs on this? |
Also two quick issues. pipelines val scaler = MinMaxScaler()
val pipeline = scaler.chainPredictor(mlr)
val evaluationDS = survivalLV.map(x => (x.vector, x.label))
pipeline.fit(survivalLV)
scorer.evaluate(evaluationDS, pipeline).collect().head When using this with a ChainedPredictor as the predictor I get the following error: MinMaxScaler() val scaler = MinMaxScaler()
val scaledSurvivalLV = scaler.transform(survivalLV) With the following error (omiting part of the stack trace) I'm looking for a work around. Just saying I found a regression. Other than that, looks/works AWESOME well done. |
Hello Trevor, Thanks for taking the time to look at this, I'll investigate these issues Sent from a mobile device. May contain autocorrect errors.
|
np, also RE: my comment on the docs- I think I can lend a hand there (I was actually testing functionality to make sure I understood how it worked). Let me know if I can be of assistance. Also, I did some more hacking this morning... import org.apache.flink.api.scala._
import org.apache.flink.ml.preprocessing.StandardScaler
val scaler = StandardScaler()//MinMaxScaler()
import org.apache.flink.ml.evaluation.{RegressionScores, Scorer}
val loss = RegressionScores.squaredLoss
val scorer = new Scorer(loss)
import org.apache.flink.ml.regression.MultipleLinearRegression
val mlr = MultipleLinearRegression()
.setIterations(10)
.setConvergenceThreshold(0.001)
val pipeline = scaler.chainPredictor(mlr)
val evaluationDS = survivalLV.map(x => (x.vector, x.label))
pipeline.fit(survivalLV)
//pipeline.evaluate(survivalLV).collect()
scorer.evaluate(evaluationDS, pipeline).collect().head This throws the |
Irrelevant as Breeze version still 0.11 in this branch. |
I did some testing and I think the problem has to do with the types that each scaler expects.
So this is a bug unrelated to this PR I think. The question becomes if we want to support all three of these types. My recommendation would be to have support for There is an argument to be whether some pre-processing steps are supervised (e.g. PCA vs. LDA) but in the strict definition of a transformer we shouldn't care about the label, only the features, so that operation can implemented at the |
The transformer needs to scale the label too... I might not be correctly understanding your last paragraph / what you are proposing. I agree with paragraph 1-3. |
Hi all, What is the status of this PR? Can I do anything to help resolving the issues you've been discussing here? |
@gaborhermann In terms of missing features, documentation is definitely missing, as @rawkintrevo mentioned. For the issues mentioned in the JIRA issue you linked I've replied on the dev list thread you started, all valid points re. adjusting this to handle recommendations. |
Hey @thvasilo is this under development? From what I see many other tasks depend on it right? |
* | ||
* @tparam PredictionType output type | ||
*/ | ||
trait Score[PredictionType] { |
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.
What is the benefit of having the scores independent of the models. For example each model could implement it's own score function within its implementation class. I may miss something here...
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.
The goal is to reduce code duplication, many models can share the same evaluation infrastructure.
@thvasilo thnx I will have a look |
Hi @skonto, I did not have time lately to finish up #2838, but I could clean it up next week. Although I believe this PR could be merged separately from mine. (Evaluating ranking recommendations is a bit more complicated.) As @thvasilo mentioned, the documentation is missing in his PR, but most of the work is already in place here. I could easily rebase my PR on top of this, if you don't modify much in the structure of classes. @thvasilo what do you think? |
Hello @gaborhermann. Personally I prefer to have PRs be as specific as possible, so I would recommend we try to get this merged before #2838, and then rebase that on master. Given the committer load however this could take a while. |
Closing since flink-ml is effectively frozen. |
Using this PR instead of #871 due to rebase issues.