[incubator-hivemall] Git Push Summary [forced push!] [Forced Update!]

2018-02-08 Thread myui
Repository: incubator-hivemall
Updated Branches:
  refs/heads/v0.5.0 ef0fe1064 -> f51a64375 (forced update)


[1/2] incubator-hivemall git commit: Inserted comments to follow 4-b of http://www.apache.org/licenses/LICENSE-2.0#redistribution

2018-02-08 Thread myui
Repository: incubator-hivemall
Updated Branches:
  refs/heads/v0.5.0 c742ce58e -> ef0fe1064


Inserted comments to follow 4-b of 
http://www.apache.org/licenses/LICENSE-2.0#redistribution


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/f51a6437
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/f51a6437
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/f51a6437

Branch: refs/heads/v0.5.0
Commit: f51a643757d3f005ac1dc69709103cafcc6fb1a4
Parents: c742ce5
Author: Makoto Yui 
Authored: Fri Feb 9 13:14:31 2018 +0900
Committer: Makoto Yui 
Committed: Fri Feb 9 13:14:31 2018 +0900

--
 core/src/main/java/hivemall/smile/classification/DecisionTree.java | 2 ++
 core/src/main/java/hivemall/smile/regression/RegressionTree.java   | 2 ++
 core/src/main/java/hivemall/utils/codec/Base91.java| 2 ++
 core/src/main/java/hivemall/utils/math/FastMath.java   | 2 ++
 4 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/f51a6437/core/src/main/java/hivemall/smile/classification/DecisionTree.java
--
diff --git a/core/src/main/java/hivemall/smile/classification/DecisionTree.java 
b/core/src/main/java/hivemall/smile/classification/DecisionTree.java
index f6ed45f..e6160d2 100644
--- a/core/src/main/java/hivemall/smile/classification/DecisionTree.java
+++ b/core/src/main/java/hivemall/smile/classification/DecisionTree.java
@@ -13,6 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+// This file includes a modified version of Smile:
+// 
https://github.com/haifengl/smile/blob/master/core/src/main/java/smile/classification/DecisionTree.java
 package hivemall.smile.classification;
 
 import static hivemall.smile.utils.SmileExtUtils.resolveFeatureName;

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/f51a6437/core/src/main/java/hivemall/smile/regression/RegressionTree.java
--
diff --git a/core/src/main/java/hivemall/smile/regression/RegressionTree.java 
b/core/src/main/java/hivemall/smile/regression/RegressionTree.java
index dadabe7..b085734 100755
--- a/core/src/main/java/hivemall/smile/regression/RegressionTree.java
+++ b/core/src/main/java/hivemall/smile/regression/RegressionTree.java
@@ -13,6 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+// This file includes a modified version of Smile:
+// 
https://github.com/haifengl/smile/blob/master/core/src/main/java/smile/regression/RegressionTree.java
 package hivemall.smile.regression;
 
 import static hivemall.smile.utils.SmileExtUtils.resolveFeatureName;

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/f51a6437/core/src/main/java/hivemall/utils/codec/Base91.java
--
diff --git a/core/src/main/java/hivemall/utils/codec/Base91.java 
b/core/src/main/java/hivemall/utils/codec/Base91.java
index 46a0b14..3e996be 100644
--- a/core/src/main/java/hivemall/utils/codec/Base91.java
+++ b/core/src/main/java/hivemall/utils/codec/Base91.java
@@ -28,6 +28,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+// This file contains a modified version of Jochaim Henke's Base91:
+// 
https://github.com/bwaldvogel/base91/blob/master/src/main/java/de/bwaldvogel/base91/Base91.java
 package hivemall.utils.codec;
 
 import hivemall.utils.io.FastByteArrayOutputStream;

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/f51a6437/core/src/main/java/hivemall/utils/math/FastMath.java
--
diff --git a/core/src/main/java/hivemall/utils/math/FastMath.java 
b/core/src/main/java/hivemall/utils/math/FastMath.java
index 1486c48..09f7a16 100644
--- a/core/src/main/java/hivemall/utils/math/FastMath.java
+++ b/core/src/main/java/hivemall/utils/math/FastMath.java
@@ -25,6 +25,8 @@
  * is preserved.
  * 
=
  */
+// This file contains a modified version of Jafama's FastMath:
+// 
https://github.com/jeffhain/jafama/blob/master/src/main/java/net/jafama/FastMath.java
 package hivemall.utils.math;
 
 import hivemall.annotations.Experimental;



[2/2] incubator-hivemall git commit: Reverted to include copyrights in NOTICE for binary/jar distribution

2018-02-08 Thread myui
Reverted to include copyrights in NOTICE for binary/jar distribution


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/ef0fe106
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/ef0fe106
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/ef0fe106

Branch: refs/heads/v0.5.0
Commit: ef0fe106464848e3daa560ac5f9613162827968c
Parents: f51a643
Author: Makoto Yui 
Authored: Fri Feb 9 16:37:37 2018 +0900
Committer: Makoto Yui 
Committed: Fri Feb 9 16:37:37 2018 +0900

--
 NOTICE | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/ef0fe106/NOTICE
--
diff --git a/NOTICE b/NOTICE
index a89a954..1d10ebe 100644
--- a/NOTICE
+++ b/NOTICE
@@ -10,3 +10,10 @@ AIST and Treasure Data, Inc.
 * Copyright 2013-2015 National Institute of Advanced Industrial Science and 
Technology (AIST)
 * Copyright 2015-2016 Makoto Yui
 * Copyright 2015-2016 Treasure Data, Inc.
+
+This software contains code derived from the following projects:
+
+* Copyright 2010 Haifeng Li
+* Copyright 2000-2006 Joachim Henke
+* Copyright 2012-2015 Jeff Hain
+* Copyright 1993 Sun Microsystems, Inc.



incubator-hivemall git commit: [HIVEMALL-172] Change tree_predict 3rd argument to accept string options

2018-02-08 Thread myui
Repository: incubator-hivemall
Updated Branches:
  refs/heads/v0.5.0 2958af0af -> c742ce58e


[HIVEMALL-172] Change tree_predict 3rd argument to accept string options


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/c742ce58
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/c742ce58
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/c742ce58

Branch: refs/heads/v0.5.0
Commit: c742ce58e94913bf446c3b296a24415676f9ac3b
Parents: 2958af0
Author: Makoto Yui 
Authored: Thu Feb 8 17:36:50 2018 +0900
Committer: Makoto Yui 
Committed: Thu Feb 8 17:36:50 2018 +0900

--
 .../hivemall/smile/tools/TreePredictUDF.java| 63 ++--
 docs/gitbook/binaryclass/news20_rf.md   |  5 +-
 docs/gitbook/binaryclass/titanic_rf.md  | 10 ++--
 docs/gitbook/multiclass/iris_randomforest.md|  8 ++-
 4 files changed, 60 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/c742ce58/core/src/main/java/hivemall/smile/tools/TreePredictUDF.java
--
diff --git a/core/src/main/java/hivemall/smile/tools/TreePredictUDF.java 
b/core/src/main/java/hivemall/smile/tools/TreePredictUDF.java
index 46b8758..ea3bc29 100644
--- a/core/src/main/java/hivemall/smile/tools/TreePredictUDF.java
+++ b/core/src/main/java/hivemall/smile/tools/TreePredictUDF.java
@@ -18,6 +18,7 @@
  */
 package hivemall.smile.tools;
 
+import hivemall.UDFWithOptions;
 import hivemall.math.vector.DenseVector;
 import hivemall.math.vector.SparseVector;
 import hivemall.math.vector.Vector;
@@ -37,11 +38,12 @@ import java.util.List;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Options;
 import org.apache.hadoop.hive.ql.exec.Description;
 import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.udf.UDFType;
-import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
 import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
@@ -53,12 +55,12 @@ import 
org.apache.hadoop.hive.serde2.objectinspector.primitive.StringObjectInspe
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.Text;
 
-@Description(
-name = "tree_predict",
-value = "_FUNC_(string modelId, string model, array 
features [, const boolean classification])"
-+ " - Returns a prediction result of a random forest")
+@Description(name = "tree_predict",
+value = "_FUNC_(string modelId, string model, array 
features [, const string options | const boolean classification=false])"
++ " - Returns a prediction result of a random forest"
++ " in  posteriori> for 
classification and  for regression")
 @UDFType(deterministic = true, stateful = false)
-public final class TreePredictUDF extends GenericUDF {
+public final class TreePredictUDF extends UDFWithOptions {
 
 private boolean classification;
 private StringObjectInspector modelOI;
@@ -72,9 +74,25 @@ public final class TreePredictUDF extends GenericUDF {
 private transient Evaluator evaluator;
 
 @Override
+protected Options getOptions() {
+Options opts = new Options();
+opts.addOption("c", "classification", false,
+"Predict as classification [default: not enabled]");
+return opts;
+}
+
+@Override
+protected CommandLine processOptions(@Nonnull String optionValue) throws 
UDFArgumentException {
+CommandLine cl = parseOptions(optionValue);
+
+this.classification = cl.hasOption("classification");
+return cl;
+}
+
+@Override
 public ObjectInspector initialize(ObjectInspector[] argOIs) throws 
UDFArgumentException {
 if (argOIs.length != 3 && argOIs.length != 4) {
-throw new UDFArgumentException("_FUNC_ takes 3 or 4 arguments");
+throw new UDFArgumentException("tree_predict takes 3 or 4 
arguments");
 }
 
 this.modelOI = HiveUtils.asStringOI(argOIs[1]);
@@ -89,15 +107,25 @@ public final class TreePredictUDF extends GenericUDF {
 this.denseInput = false;
 } else {
 throw new UDFArgumentException(
-"_FUNC_ takes array or array for the second 
argument: "
+"tree_predict takes array or array for the 
second argument: "
 + listOI.getTypeName());
 }
 
-boolean classification = false;
 if (argOIs.length