hivemall-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myui <...@git.apache.org>
Subject [GitHub] incubator-hivemall pull request #93: [WIP][HIVEMALL-126] Maximum Entropy Mod...
Date Wed, 05 Jul 2017 02:34:00 GMT
Github user myui commented on a diff in the pull request:

    https://github.com/apache/incubator-hivemall/pull/93#discussion_r125543784
  
    --- Diff: core/src/main/java/hivemall/smile/classification/MaxEntUDTF.java ---
    @@ -0,0 +1,440 @@
    +package hivemall.smile.classification;
    +
    +import java.io.FileNotFoundException;
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.BitSet;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.concurrent.Callable;
    +import java.util.concurrent.atomic.AtomicInteger;
    +
    +import javax.annotation.Nonnegative;
    +import javax.annotation.Nonnull;
    +import javax.annotation.Nullable;
    +import javax.annotation.concurrent.GuardedBy;
    +
    +import org.apache.commons.cli.CommandLine;
    +import org.apache.commons.cli.Options;
    +import org.apache.commons.logging.Log;
    +import org.apache.commons.logging.LogFactory;
    +import org.apache.hadoop.hive.ql.exec.MapredContext;
    +import org.apache.hadoop.hive.ql.exec.MapredContextAccessor;
    +import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
    +import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
    +import org.apache.hadoop.hive.ql.metadata.HiveException;
    +import org.apache.hadoop.hive.serde2.io.DoubleWritable;
    +import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
    +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
    +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
    +import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
    +import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
    +import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
    +import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
    +import org.apache.hadoop.io.IntWritable;
    +import org.apache.hadoop.io.Text;
    +import org.apache.hadoop.mapred.Reporter;
    +import org.apache.hadoop.mapred.Counters.Counter;
    +
    +import hivemall.UDTFWithOptions;
    +import hivemall.math.matrix.Matrix;
    +import hivemall.math.matrix.MatrixUtils;
    +import hivemall.math.matrix.builders.CSRMatrixBuilder;
    +import hivemall.math.matrix.builders.MatrixBuilder;
    +import hivemall.math.matrix.builders.RowMajorDenseMatrixBuilder;
    +import hivemall.math.matrix.ints.ColumnMajorIntMatrix;
    +import hivemall.math.matrix.ints.DoKIntMatrix;
    +import hivemall.math.matrix.ints.IntMatrix;
    +import hivemall.math.random.PRNG;
    +import hivemall.math.random.RandomNumberGeneratorFactory;
    +import hivemall.math.vector.Vector;
    +import hivemall.math.vector.VectorProcedure;
    +import hivemall.smile.classification.DecisionTree.SplitRule;
    +import hivemall.smile.data.Attribute;
    +import hivemall.smile.tools.MatrixEventStream;
    +import hivemall.smile.tools.SepDelimitedTextGISModelWriter;
    +import hivemall.smile.utils.SmileExtUtils;
    +import hivemall.smile.utils.SmileTaskExecutor;
    +import hivemall.utils.codec.Base91;
    +import hivemall.utils.collections.lists.IntArrayList;
    +import hivemall.utils.hadoop.HiveUtils;
    +import hivemall.utils.hadoop.WritableUtils;
    +import hivemall.utils.lang.Preconditions;
    +import hivemall.utils.lang.Primitives;
    +import hivemall.utils.lang.RandomUtils;
    +
    +import opennlp.maxent.GIS;
    +import opennlp.maxent.io.GISModelWriter;
    +import opennlp.model.AbstractModel;
    +import opennlp.model.Event;
    +import opennlp.model.EventStream;
    +import opennlp.model.OnePassRealValueDataIndexer;
    +
    +@Description(
    +        name = "train_maxent_classifier",
    +        value = "_FUNC_(array<double> features, int label [, const boolean classification])"
    +                + " - Returns a maximum entropy model per subset of data.")
    +@UDFType(deterministic = true, stateful = false)
    +public class MaxEntUDTF extends UDTFWithOptions{
    +	private static final Log logger = LogFactory.getLog(MaxEntUDTF.class);
    +	
    +	private ListObjectInspector featureListOI;
    --- End diff --
    
    Inconsistent indentation. Formatter should be applied.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message