Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Commit

Permalink
7205de1 replay starts
Browse files Browse the repository at this point in the history
  • Loading branch information
DrRacket committed Dec 6, 2017
1 parent 6c1c33f commit 895ddeb
Show file tree
Hide file tree
Showing 68 changed files with 525 additions and 514 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/hivemall/regression/AdaDeltaUDTF.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* ADADELTA: AN ADAPTIVE LEARNING RATE METHOD.
*
* @deprecated Use {@link hivemall.regression.GeneralRegressionUDTF} instead
* @deprecated Use {@link hivemall.regression.GeneralRegressorUDTF} instead
*/
@Deprecated
@Description(
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hivemall/regression/AdaGradUDTF.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* ADAGRAD algorithm with element-wise adaptive learning rates.
*
* @deprecated Use {@link hivemall.regression.GeneralRegressionUDTF} instead
* @deprecated Use {@link hivemall.regression.GeneralRegressorUDTF} instead
*/
@Deprecated
@Description(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
/**
* A general regression class with replaceable optimization functions.
*/
@Description(name = "train_regression",
@Description(name = "train_regressor",
value = "_FUNC_(list<string|int|bigint> features, double label [, const string options])"
+ " - Returns a relation consists of <string|int|bigint feature, float weight>",
extended = "Build a prediction model by a generic regressor")
@Since(version = "0.5-rc.1")
public final class GeneralRegressionUDTF extends GeneralLearnerBaseUDTF {
public final class GeneralRegressorUDTF extends GeneralLearnerBaseUDTF {

@Override
protected String getLossOptionDescription() {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hivemall/regression/LogressUDTF.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* Logistic regression using SGD.
*
* @deprecated Use {@link hivemall.regression.GeneralRegressionUDTF} instead
* @deprecated Use {@link hivemall.regression.GeneralRegressorUDTF} instead
*/
@Deprecated
@Description(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
import org.junit.Assert;
import org.junit.Test;

public class GeneralRegressionUDTFTest {
public class GeneralRegressorUDTFTest {
private static final boolean DEBUG = false;

@Test(expected = UDFArgumentException.class)
public void testUnsupportedOptimizer() throws Exception {
GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector floatOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;
ListObjectInspector stringListOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);
Expand All @@ -64,7 +64,7 @@ public void testUnsupportedOptimizer() throws Exception {

@Test(expected = UDFArgumentException.class)
public void testUnsupportedLossFunction() throws Exception {
GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector floatOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;
ListObjectInspector stringListOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);
Expand All @@ -76,7 +76,7 @@ public void testUnsupportedLossFunction() throws Exception {

@Test(expected = UDFArgumentException.class)
public void testInvalidLossFunction() throws Exception {
GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector floatOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;
ListObjectInspector stringListOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);
Expand All @@ -88,7 +88,7 @@ public void testInvalidLossFunction() throws Exception {

@Test(expected = UDFArgumentException.class)
public void testUnsupportedRegularization() throws Exception {
GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector floatOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;
ListObjectInspector stringListOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);
Expand All @@ -103,7 +103,7 @@ public void testNoOptions() throws Exception {
List<String> x = Arrays.asList("1:-2", "2:-1");
float y = 0.f;

GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector intOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;
ListObjectInspector stringListOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);
Expand All @@ -122,7 +122,7 @@ private <T> void testFeature(@Nonnull List<T> x, @Nonnull ObjectInspector featur
@Nonnull Class<T> featureClass, @Nonnull Class<?> modelFeatureClass) throws Exception {
float y = 0.f;

GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector valueOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ListObjectInspector featureListOI = ObjectInspectorFactory.getStandardListObjectInspector(featureOI);

Expand Down Expand Up @@ -244,7 +244,7 @@ private void run(@Nonnull String options) throws Exception {
x2 += x2Step;
}

GeneralRegressionUDTF udtf = new GeneralRegressionUDTF();
GeneralRegressorUDTF udtf = new GeneralRegressorUDTF();
ObjectInspector floatOI = PrimitiveObjectInspectorFactory.javaFloatObjectInspector;
ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;
ListObjectInspector stringListOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);
Expand Down
2 changes: 1 addition & 1 deletion docs/gitbook/FOOTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

<sub><font color="gray">
Apache Hivemall is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator.
</font></sub>
</font></sub>
2 changes: 1 addition & 1 deletion docs/gitbook/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* [Input Format](getting_started/input-format.md)

* [Tips for Effective Hivemall](tips/README.md)
* [Explicit addBias() for better prediction](tips/addbias.md)
* [Explicit add_bias() for better prediction](tips/addbias.md)
* [Use rand_amplify() to better prediction results](tips/rand_amplify.md)
* [Real-time Prediction on RDBMS](tips/rt_prediction.md)
* [Ensemble learning for stable prediction](tips/ensemble_learning.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/gitbook/anomaly/sst.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ For instance, partial outputs obtained as a result of this query are:
|7560 | {"changepoint_score":0.0010629833145070489,"is_changepoint":false}|
|...|...|

Obviously, the 7555-th sample is detected as a change-point in this example.
Obviously, the 7555-th sample is detected as a change-point in this example.
2 changes: 1 addition & 1 deletion docs/gitbook/binaryclass/a9a_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ create external table a9atest (
label float,
features ARRAY<STRING>
) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' COLLECTION ITEMS TERMINATED BY "," STORED AS TEXTFILE LOCATION '/dataset/a9a/test';
```
```
4 changes: 2 additions & 2 deletions docs/gitbook/binaryclass/a9a_lr.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ select
avg(weight) as weight
from
(select
logress(addBias(features),label,"-total_steps ${total_steps}") as (feature,weight)
logress(add_bias(features),label,"-total_steps ${total_steps}") as (feature,weight)
from
a9atrain
) t
Expand All @@ -59,7 +59,7 @@ select
extract_feature(feature) as feature,
extract_weight(feature) as value
from
a9atest LATERAL VIEW explode(addBias(features)) t AS feature
a9atest LATERAL VIEW explode(add_bias(features)) t AS feature
)
select
t.rowid,
Expand Down
4 changes: 2 additions & 2 deletions docs/gitbook/binaryclass/a9a_minibatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ select
avg(weight) as weight
from
(select
logress(addBias(features),label,"-total_steps ${total_steps} -mini_batch ${mini_batch_size}") as (feature,weight)
logress(add_bias(features),label,"-total_steps ${total_steps} -mini_batch ${mini_batch_size}") as (feature,weight)
from
a9atrain
) t
Expand All @@ -52,4 +52,4 @@ where actual == predicted;

| Stochastic Gradient Descent | Minibatch Gradient Descent |
| ------------- | ------------- |
| 0.8430071862907684 | 0.8463239358761747 |
| 0.8430071862907684 | 0.8463239358761747 |
2 changes: 1 addition & 1 deletion docs/gitbook/binaryclass/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ from
a9a_train
```

Likewise, you can generate many different classifiers based on its options.
Likewise, you can generate many different classifiers based on its options.
4 changes: 2 additions & 2 deletions docs/gitbook/binaryclass/kdd2010a_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ select
split(feature,":")[0] as feature,
cast(split(feature,":")[1] as float) as value
from
kdd10a_test LATERAL VIEW explode(addBias(features)) t AS feature;
kdd10a_test LATERAL VIEW explode(add_bias(features)) t AS feature;

set hivevar:xtimes=3;
set hivevar:shufflebuffersize=1000;
Expand All @@ -88,4 +88,4 @@ select
rand_amplify(${xtimes}, ${shufflebuffersize}, *) as (rowid, label, features)
from
kdd10a_train_orcfile;
```
```
12 changes: 6 additions & 6 deletions docs/gitbook/binaryclass/kdd2010a_scw.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ select
voted_avg(weight) as weight
from
(select
train_pa1(addBias(features),label) as (feature,weight)
train_pa1(add_bias(features),label) as (feature,weight)
from
kdd10a_train_x3
) t
Expand Down Expand Up @@ -76,7 +76,7 @@ select
argmin_kld(weight, covar) as weight
from
(select
train_cw(addBias(features),label) as (feature,weight,covar)
train_cw(add_bias(features),label) as (feature,weight,covar)
from
kdd10a_train_x3
) t
Expand Down Expand Up @@ -119,8 +119,8 @@ select
argmin_kld(weight, covar) as weight -- [hivemall v0.2alpha3 or later]
from
(select
-- train_arow(addBias(features),label) as (feature,weight) -- [hivemall v0.1]
train_arow(addBias(features),label) as (feature,weight,covar) -- [hivemall v0.2 or later]
-- train_arow(add_bias(features),label) as (feature,weight) -- [hivemall v0.1]
train_arow(add_bias(features),label) as (feature,weight,covar) -- [hivemall v0.2 or later]
from
kdd10a_train_x3
) t
Expand Down Expand Up @@ -162,7 +162,7 @@ select
argmin_kld(weight, covar) as weight
from
(select
train_scw(addBias(features),label) as (feature,weight,covar)
train_scw(add_bias(features),label) as (feature,weight,covar)
from
kdd10a_train_x3
) t
Expand Down Expand Up @@ -201,4 +201,4 @@ where actual = predicted;
| AROW | 0.8676038894615345 |
| PA1 | 0.8677782959894337 |
| CW | 0.8678037711002504 |
| SCW1 | 0.8678096499719774 |
| SCW1 | 0.8678096499719774 |
6 changes: 3 additions & 3 deletions docs/gitbook/binaryclass/kdd2010b_arow.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ select
argmin_kld(weight, covar) as weight -- [hivemall v0.2alpha3 or later]
from
(select
-- train_arow(addBias(features),label) as (feature,weight) -- [hivemall v0.1]
train_arow(addBias(features),label) as (feature,weight,covar) -- [hivemall v0.2 or later]
-- train_arow(add_bias(features),label) as (feature,weight) -- [hivemall v0.1]
train_arow(add_bias(features),label) as (feature,weight,covar) -- [hivemall v0.2 or later]
from
kdd10b_train_x3
) t
Expand Down Expand Up @@ -67,4 +67,4 @@ from
select count(1)/748401 from kdd10b_arow_submit1
where actual = predicted;
```
> 0.8565808971393678
> 0.8565808971393678
2 changes: 1 addition & 1 deletion docs/gitbook/binaryclass/kdd2010b_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ select
split(feature,":")[0] as feature,
cast(split(feature,":")[1] as float) as value
from
kdd10b_test LATERAL VIEW explode(addBias(features)) t AS feature;
kdd10b_test LATERAL VIEW explode(add_bias(features)) t AS feature;

set hivevar:xtimes=3;
set hivevar:shufflebuffersize=1000;
Expand Down
Loading

0 comments on commit 895ddeb

Please sign in to comment.