-
Notifications
You must be signed in to change notification settings - Fork 108
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
add gbdt transfer learning #545
base: develop
Are you sure you want to change the base?
Conversation
@Override | ||
public MLData call() { | ||
MLData result = tltm.compute(rawNsDataMap); | ||
return result; |
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.
could you change to one line like 'return tltm.compute(rawNsDataMap);'
for(FileStatus fst: modelFileStats) { | ||
models.add(loadModel(modelConfig, fst.getPath(), fs, gbtConvertToProb, gbtScoreConvertStrategy)); | ||
for(FileStatus f: modelFileStats) { | ||
tmpModels.add(loadModel(modelConfig, f.getPath(), fs, gbtConvertToProb, gbtScoreConvertStrategy)); |
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.
better not use variable name like 'f'
List<String> baseModelPaths = | ||
(List<String>) modelConfig.getTrain().getParams().get(CommonConstants.GBDT_BASE_MODEL_PATHS); | ||
if (!CollectionUtils.isEmpty(baseModelPaths)) { | ||
// if there config base model in traning config, it means user want to eval transfer-learning model |
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.
isNotEmpty?
*/ | ||
public static double[] merge(double[] a, double[] b) { | ||
if (a == null || b == null || a.length != b.length) { | ||
throw new RuntimeException("Input is invalid. a is " + Arrays.toString(a) + |
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.
IllegalArgumentException is better than RuntimeException.
Best practice should not use RuntimeException instread of a cutomized RuntimeException
No description provided.