lindong28 commented on code in PR #83:
URL: https://github.com/apache/flink-ml/pull/83#discussion_r860633423


##########
flink-ml-lib/src/main/java/org/apache/flink/ml/common/param/HasL2.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.param;
+
+import org.apache.flink.ml.param.DoubleParam;
+import org.apache.flink.ml.param.Param;
+import org.apache.flink.ml.param.ParamValidators;
+import org.apache.flink.ml.param.WithParams;
+
+/** Interface for the shared L2 param. */
+public interface HasL2<T> extends WithParams<T> {
+    Param<Double> L_2 = new DoubleParam("l2", "The l2 param.", 0.1, 
ParamValidators.gt(0.0));

Review Comment:
   According to the Elastic net regularization wiki page [1], l1 and l2 could 
be theoretically translated to a regularization constant and the SVM 
regularization constant (i.e. the elastic net). Thus the regularization 
constant is different from l1 and l2 under this context
   
   As far as the mathematical formula is concerned, is the existing 
`HasReg::REG` the same as L2 or the regularization constant explained in [1]? 
If it is the same as L2, we probably should rename this class to e.g. `HasL2`. 
Otherwise, we probably should rename the variable `LogisticGradient::l2` as 
appropriate.
   
   [1] 
https://en.wikipedia.org/wiki/Elastic_net_regularization#:~:text=In%20statistics%20and%2C%20in%20particular,the%20lasso%20and%20ridge%20methods.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to