Skip to content

Commit ff0eda5

Browse files
committed
Merge branch 'master' into feature/searchable-snapshots
2 parents e43f8b2 + eeab098 commit ff0eda5

File tree

223 files changed

+10987
-1936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+10987
-1936
lines changed

buildSrc/version.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ supercsv = 2.4.0
1616
# when updating log4j, please update also docs/java-api/index.asciidoc
1717
log4j = 2.11.1
1818
slf4j = 1.6.2
19+
ecsLogging = 0.1.3
1920

2021
# when updating the JNA version, also update the version in buildSrc/build.gradle
2122
jna = 4.5.1

client/rest-high-level/src/main/java/org/elasticsearch/client/core/IndexerJobStats.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.Objects;
2525

2626
public abstract class IndexerJobStats {
27-
public static final String NAME = "data_frame_indexer_transform_stats";
2827
public static ParseField NUM_PAGES = new ParseField("pages_processed");
2928
public static ParseField NUM_INPUT_DOCUMENTS = new ParseField("documents_processed");
3029
public static ParseField NUM_OUTPUT_DOCUMENTS = new ParseField("documents_indexed");

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/Hyperparameters.java

Lines changed: 70 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,21 @@
3131
public class Hyperparameters implements ToXContentObject {
3232

3333
public static final ParseField CLASS_ASSIGNMENT_OBJECTIVE = new ParseField("class_assignment_objective");
34+
public static final ParseField ALPHA = new ParseField("alpha");
3435
public static final ParseField DOWNSAMPLE_FACTOR = new ParseField("downsample_factor");
3536
public static final ParseField ETA = new ParseField("eta");
3637
public static final ParseField ETA_GROWTH_RATE_PER_TREE = new ParseField("eta_growth_rate_per_tree");
3738
public static final ParseField FEATURE_BAG_FRACTION = new ParseField("feature_bag_fraction");
39+
public static final ParseField GAMMA = new ParseField("gamma");
40+
public static final ParseField LAMBDA = new ParseField("lambda");
3841
public static final ParseField MAX_ATTEMPTS_TO_ADD_TREE = new ParseField("max_attempts_to_add_tree");
3942
public static final ParseField MAX_OPTIMIZATION_ROUNDS_PER_HYPERPARAMETER = new ParseField(
4043
"max_optimization_rounds_per_hyperparameter");
4144
public static final ParseField MAX_TREES = new ParseField("max_trees");
4245
public static final ParseField NUM_FOLDS = new ParseField("num_folds");
4346
public static final ParseField NUM_SPLITS_PER_FEATURE = new ParseField("num_splits_per_feature");
44-
public static final ParseField REGULARIZATION_DEPTH_PENALTY_MULTIPLIER = new ParseField("regularization_depth_penalty_multiplier");
45-
public static final ParseField REGULARIZATION_LEAF_WEIGHT_PENALTY_MULTIPLIER
46-
= new ParseField("regularization_leaf_weight_penalty_multiplier");
47-
public static final ParseField REGULARIZATION_SOFT_TREE_DEPTH_LIMIT = new ParseField("regularization_soft_tree_depth_limit");
48-
public static final ParseField REGULARIZATION_SOFT_TREE_DEPTH_TOLERANCE = new ParseField("regularization_soft_tree_depth_tolerance");
49-
public static final ParseField REGULARIZATION_TREE_SIZE_PENALTY_MULTIPLIER =
50-
new ParseField("regularization_tree_size_penalty_multiplier");
47+
public static final ParseField SOFT_TREE_DEPTH_LIMIT = new ParseField("soft_tree_depth_limit");
48+
public static final ParseField SOFT_TREE_DEPTH_TOLERANCE = new ParseField("soft_tree_depth_tolerance");
5149

5250
public static ConstructingObjectParser<Hyperparameters, Void> PARSER = new ConstructingObjectParser<>("classification_hyperparameters",
5351
true,
@@ -57,88 +55,92 @@ public class Hyperparameters implements ToXContentObject {
5755
(Double) a[2],
5856
(Double) a[3],
5957
(Double) a[4],
60-
(Integer) a[5],
61-
(Integer) a[6],
62-
(Integer) a[7],
58+
(Double) a[5],
59+
(Double) a[6],
60+
(Double) a[7],
6361
(Integer) a[8],
6462
(Integer) a[9],
65-
(Double) a[10],
66-
(Double) a[11],
67-
(Double) a[12],
63+
(Integer) a[10],
64+
(Integer) a[11],
65+
(Integer) a[12],
6866
(Double) a[13],
6967
(Double) a[14]
7068
));
7169

7270
static {
7371
PARSER.declareString(optionalConstructorArg(), CLASS_ASSIGNMENT_OBJECTIVE);
72+
PARSER.declareDouble(optionalConstructorArg(), ALPHA);
7473
PARSER.declareDouble(optionalConstructorArg(), DOWNSAMPLE_FACTOR);
7574
PARSER.declareDouble(optionalConstructorArg(), ETA);
7675
PARSER.declareDouble(optionalConstructorArg(), ETA_GROWTH_RATE_PER_TREE);
7776
PARSER.declareDouble(optionalConstructorArg(), FEATURE_BAG_FRACTION);
77+
PARSER.declareDouble(optionalConstructorArg(), GAMMA);
78+
PARSER.declareDouble(optionalConstructorArg(), LAMBDA);
7879
PARSER.declareInt(optionalConstructorArg(), MAX_ATTEMPTS_TO_ADD_TREE);
7980
PARSER.declareInt(optionalConstructorArg(), MAX_OPTIMIZATION_ROUNDS_PER_HYPERPARAMETER);
8081
PARSER.declareInt(optionalConstructorArg(), MAX_TREES);
8182
PARSER.declareInt(optionalConstructorArg(), NUM_FOLDS);
8283
PARSER.declareInt(optionalConstructorArg(), NUM_SPLITS_PER_FEATURE);
83-
PARSER.declareDouble(optionalConstructorArg(), REGULARIZATION_DEPTH_PENALTY_MULTIPLIER);
84-
PARSER.declareDouble(optionalConstructorArg(), REGULARIZATION_LEAF_WEIGHT_PENALTY_MULTIPLIER);
85-
PARSER.declareDouble(optionalConstructorArg(), REGULARIZATION_SOFT_TREE_DEPTH_LIMIT);
86-
PARSER.declareDouble(optionalConstructorArg(), REGULARIZATION_SOFT_TREE_DEPTH_TOLERANCE);
87-
PARSER.declareDouble(optionalConstructorArg(), REGULARIZATION_TREE_SIZE_PENALTY_MULTIPLIER);
84+
PARSER.declareDouble(optionalConstructorArg(), SOFT_TREE_DEPTH_LIMIT);
85+
PARSER.declareDouble(optionalConstructorArg(), SOFT_TREE_DEPTH_TOLERANCE);
8886
}
8987

9088
private final String classAssignmentObjective;
89+
private final Double alpha;
9190
private final Double downsampleFactor;
9291
private final Double eta;
9392
private final Double etaGrowthRatePerTree;
9493
private final Double featureBagFraction;
94+
private final Double gamma;
95+
private final Double lambda;
9596
private final Integer maxAttemptsToAddTree;
9697
private final Integer maxOptimizationRoundsPerHyperparameter;
9798
private final Integer maxTrees;
9899
private final Integer numFolds;
99100
private final Integer numSplitsPerFeature;
100-
private final Double regularizationDepthPenaltyMultiplier;
101-
private final Double regularizationLeafWeightPenaltyMultiplier;
102-
private final Double regularizationSoftTreeDepthLimit;
103-
private final Double regularizationSoftTreeDepthTolerance;
104-
private final Double regularizationTreeSizePenaltyMultiplier;
101+
private final Double softTreeDepthLimit;
102+
private final Double softTreeDepthTolerance;
105103

106104
public Hyperparameters(String classAssignmentObjective,
105+
Double alpha,
107106
Double downsampleFactor,
108107
Double eta,
109108
Double etaGrowthRatePerTree,
110109
Double featureBagFraction,
110+
Double gamma,
111+
Double lambda,
111112
Integer maxAttemptsToAddTree,
112113
Integer maxOptimizationRoundsPerHyperparameter,
113114
Integer maxTrees,
114115
Integer numFolds,
115116
Integer numSplitsPerFeature,
116-
Double regularizationDepthPenaltyMultiplier,
117-
Double regularizationLeafWeightPenaltyMultiplier,
118-
Double regularizationSoftTreeDepthLimit,
119-
Double regularizationSoftTreeDepthTolerance,
120-
Double regularizationTreeSizePenaltyMultiplier) {
117+
Double softTreeDepthLimit,
118+
Double softTreeDepthTolerance) {
121119
this.classAssignmentObjective = classAssignmentObjective;
120+
this.alpha = alpha;
122121
this.downsampleFactor = downsampleFactor;
123122
this.eta = eta;
124123
this.etaGrowthRatePerTree = etaGrowthRatePerTree;
125124
this.featureBagFraction = featureBagFraction;
125+
this.gamma = gamma;
126+
this.lambda = lambda;
126127
this.maxAttemptsToAddTree = maxAttemptsToAddTree;
127128
this.maxOptimizationRoundsPerHyperparameter = maxOptimizationRoundsPerHyperparameter;
128129
this.maxTrees = maxTrees;
129130
this.numFolds = numFolds;
130131
this.numSplitsPerFeature = numSplitsPerFeature;
131-
this.regularizationDepthPenaltyMultiplier = regularizationDepthPenaltyMultiplier;
132-
this.regularizationLeafWeightPenaltyMultiplier = regularizationLeafWeightPenaltyMultiplier;
133-
this.regularizationSoftTreeDepthLimit = regularizationSoftTreeDepthLimit;
134-
this.regularizationSoftTreeDepthTolerance = regularizationSoftTreeDepthTolerance;
135-
this.regularizationTreeSizePenaltyMultiplier = regularizationTreeSizePenaltyMultiplier;
132+
this.softTreeDepthLimit = softTreeDepthLimit;
133+
this.softTreeDepthTolerance = softTreeDepthTolerance;
136134
}
137135

138136
public String getClassAssignmentObjective() {
139137
return classAssignmentObjective;
140138
}
141139

140+
public Double getAlpha() {
141+
return alpha;
142+
}
143+
142144
public Double getDownsampleFactor() {
143145
return downsampleFactor;
144146
}
@@ -155,6 +157,14 @@ public Double getFeatureBagFraction() {
155157
return featureBagFraction;
156158
}
157159

160+
public Double getGamma() {
161+
return gamma;
162+
}
163+
164+
public Double getLambda() {
165+
return lambda;
166+
}
167+
158168
public Integer getMaxAttemptsToAddTree() {
159169
return maxAttemptsToAddTree;
160170
}
@@ -175,24 +185,12 @@ public Integer getNumSplitsPerFeature() {
175185
return numSplitsPerFeature;
176186
}
177187

178-
public Double getRegularizationDepthPenaltyMultiplier() {
179-
return regularizationDepthPenaltyMultiplier;
180-
}
181-
182-
public Double getRegularizationLeafWeightPenaltyMultiplier() {
183-
return regularizationLeafWeightPenaltyMultiplier;
184-
}
185-
186-
public Double getRegularizationSoftTreeDepthLimit() {
187-
return regularizationSoftTreeDepthLimit;
188-
}
189-
190-
public Double getRegularizationSoftTreeDepthTolerance() {
191-
return regularizationSoftTreeDepthTolerance;
188+
public Double getSoftTreeDepthLimit() {
189+
return softTreeDepthLimit;
192190
}
193191

194-
public Double getRegularizationTreeSizePenaltyMultiplier() {
195-
return regularizationTreeSizePenaltyMultiplier;
192+
public Double getSoftTreeDepthTolerance() {
193+
return softTreeDepthTolerance;
196194
}
197195

198196
@Override
@@ -201,6 +199,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
201199
if (classAssignmentObjective != null) {
202200
builder.field(CLASS_ASSIGNMENT_OBJECTIVE.getPreferredName(), classAssignmentObjective);
203201
}
202+
if (alpha != null) {
203+
builder.field(ALPHA.getPreferredName(), alpha);
204+
}
204205
if (downsampleFactor != null) {
205206
builder.field(DOWNSAMPLE_FACTOR.getPreferredName(), downsampleFactor);
206207
}
@@ -213,6 +214,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
213214
if (featureBagFraction != null) {
214215
builder.field(FEATURE_BAG_FRACTION.getPreferredName(), featureBagFraction);
215216
}
217+
if (gamma != null) {
218+
builder.field(GAMMA.getPreferredName(), gamma);
219+
}
220+
if (lambda != null) {
221+
builder.field(LAMBDA.getPreferredName(), lambda);
222+
}
216223
if (maxAttemptsToAddTree != null) {
217224
builder.field(MAX_ATTEMPTS_TO_ADD_TREE.getPreferredName(), maxAttemptsToAddTree);
218225
}
@@ -228,20 +235,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
228235
if (numSplitsPerFeature != null) {
229236
builder.field(NUM_SPLITS_PER_FEATURE.getPreferredName(), numSplitsPerFeature);
230237
}
231-
if (regularizationDepthPenaltyMultiplier != null) {
232-
builder.field(REGULARIZATION_DEPTH_PENALTY_MULTIPLIER.getPreferredName(), regularizationDepthPenaltyMultiplier);
233-
}
234-
if (regularizationLeafWeightPenaltyMultiplier != null) {
235-
builder.field(REGULARIZATION_LEAF_WEIGHT_PENALTY_MULTIPLIER.getPreferredName(), regularizationLeafWeightPenaltyMultiplier);
236-
}
237-
if (regularizationSoftTreeDepthLimit != null) {
238-
builder.field(REGULARIZATION_SOFT_TREE_DEPTH_LIMIT.getPreferredName(), regularizationSoftTreeDepthLimit);
239-
}
240-
if (regularizationSoftTreeDepthTolerance != null) {
241-
builder.field(REGULARIZATION_SOFT_TREE_DEPTH_TOLERANCE.getPreferredName(), regularizationSoftTreeDepthTolerance);
238+
if (softTreeDepthLimit != null) {
239+
builder.field(SOFT_TREE_DEPTH_LIMIT.getPreferredName(), softTreeDepthLimit);
242240
}
243-
if (regularizationTreeSizePenaltyMultiplier != null) {
244-
builder.field(REGULARIZATION_TREE_SIZE_PENALTY_MULTIPLIER.getPreferredName(), regularizationTreeSizePenaltyMultiplier);
241+
if (softTreeDepthTolerance != null) {
242+
builder.field(SOFT_TREE_DEPTH_TOLERANCE.getPreferredName(), softTreeDepthTolerance);
245243
}
246244
builder.endObject();
247245
return builder;
@@ -254,40 +252,40 @@ public boolean equals(Object o) {
254252

255253
Hyperparameters that = (Hyperparameters) o;
256254
return Objects.equals(classAssignmentObjective, that.classAssignmentObjective)
255+
&& Objects.equals(alpha, that.alpha)
257256
&& Objects.equals(downsampleFactor, that.downsampleFactor)
258257
&& Objects.equals(eta, that.eta)
259258
&& Objects.equals(etaGrowthRatePerTree, that.etaGrowthRatePerTree)
260259
&& Objects.equals(featureBagFraction, that.featureBagFraction)
260+
&& Objects.equals(gamma, that.gamma)
261+
&& Objects.equals(lambda, that.lambda)
261262
&& Objects.equals(maxAttemptsToAddTree, that.maxAttemptsToAddTree)
262263
&& Objects.equals(maxOptimizationRoundsPerHyperparameter, that.maxOptimizationRoundsPerHyperparameter)
263264
&& Objects.equals(maxTrees, that.maxTrees)
264265
&& Objects.equals(numFolds, that.numFolds)
265266
&& Objects.equals(numSplitsPerFeature, that.numSplitsPerFeature)
266-
&& Objects.equals(regularizationDepthPenaltyMultiplier, that.regularizationDepthPenaltyMultiplier)
267-
&& Objects.equals(regularizationLeafWeightPenaltyMultiplier, that.regularizationLeafWeightPenaltyMultiplier)
268-
&& Objects.equals(regularizationSoftTreeDepthLimit, that.regularizationSoftTreeDepthLimit)
269-
&& Objects.equals(regularizationSoftTreeDepthTolerance, that.regularizationSoftTreeDepthTolerance)
270-
&& Objects.equals(regularizationTreeSizePenaltyMultiplier, that.regularizationTreeSizePenaltyMultiplier);
267+
&& Objects.equals(softTreeDepthLimit, that.softTreeDepthLimit)
268+
&& Objects.equals(softTreeDepthTolerance, that.softTreeDepthTolerance);
271269
}
272270

273271
@Override
274272
public int hashCode() {
275273
return Objects.hash(
276274
classAssignmentObjective,
275+
alpha,
277276
downsampleFactor,
278277
eta,
279278
etaGrowthRatePerTree,
280279
featureBagFraction,
280+
gamma,
281+
lambda,
281282
maxAttemptsToAddTree,
282283
maxOptimizationRoundsPerHyperparameter,
283284
maxTrees,
284285
numFolds,
285286
numSplitsPerFeature,
286-
regularizationDepthPenaltyMultiplier,
287-
regularizationLeafWeightPenaltyMultiplier,
288-
regularizationSoftTreeDepthLimit,
289-
regularizationSoftTreeDepthTolerance,
290-
regularizationTreeSizePenaltyMultiplier
287+
softTreeDepthLimit,
288+
softTreeDepthTolerance
291289
);
292290
}
293291
}

0 commit comments

Comments
 (0)