lindong28 commented on a change in pull request #28: URL: https://github.com/apache/flink-ml/pull/28#discussion_r771390383
########## File path: flink-ml-core/src/main/java/org/apache/flink/ml/common/feature/LabeledPointWithWeight.java ########## @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.ml.common.feature; + +import org.apache.flink.ml.linalg.DenseVector; + +/** Utility class to represent a data point that contains features, label and weight. */ +public class LabeledPointWithWeight { + + private DenseVector features; + + private double label; + + private double weight; + + public LabeledPointWithWeight(DenseVector features, double label, double weight) { + this.features = features; + this.label = label; + this.weight = weight; + } + + public LabeledPointWithWeight() {} + + public DenseVector getFeatures() { Review comment: The addition of these `getXXX(...)` and `setXXX(...)` seems very verbose. Since we don't expect these `setXXX(...)` to be called, would it be simpler to just make these fields `public`? We can add comment above saying `These fields' values are not expected to be updated. They are not final in order to make this class POJO`. Same for other `XXXModelData` classes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
