Github user myui commented on a diff in the pull request:
https://github.com/apache/incubator-hivemall/pull/149#discussion_r200604967
--- Diff: core/src/main/java/hivemall/fm/FactorizationMachineUDTF.java ---
@@ -351,19 +370,29 @@ private static void writeBuffer(@Nonnull ByteBuffer
srcBuf, @Nonnull NioStateful
srcBuf.clear();
}
- public void train(@Nonnull final Feature[] x, final double y,
- final boolean adaptiveRegularization) throws HiveException {
+ protected void checkInputVector(@Nonnull final Feature[] x) throws
HiveException {
_model.check(x);
+ }
+
+ protected void processValidationSample(@Nonnull final Feature[] x,
final double y)
+ throws HiveException {
+ if (_adaptiveRegularization) {
+ trainLambda(x, y); // adaptive regularization
+ }
+ if (_earlyStopping) {
--- End diff --
earlyStopping is better to be performed before adaptiveRegularization.
---