Skip to content
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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

WenkaiBai
Copy link
Collaborator

No description provided.

@Override
public MLData call() {
MLData result = tltm.compute(rawNsDataMap);
return result;
Copy link
Contributor

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));
Copy link
Contributor

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
Copy link
Contributor

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) +
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants