Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 6366e1f

Browse files
committed
Updating instances of model.extractParamMap to model.parent.extractParamMap, since the Params of the parent Estimator could possibly differ from thos of the Model.
1 parent d850e0e commit 6366e1f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/ml-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ val model1 = lr.fit(training.toDF)
207207
// we can view the parameters it used during fit().
208208
// This prints the parameter (name: value) pairs, where names are unique IDs for this
209209
// LogisticRegression instance.
210-
println("Model 1 was fit using parameters: " + model1.extractParamMap)
210+
println("Model 1 was fit using parameters: " + model1.parent.extractParamMap)
211211

212212
// We may alternatively specify parameters using a ParamMap,
213213
// which supports several methods for specifying parameters.
@@ -222,7 +222,7 @@ val paramMapCombined = paramMap ++ paramMap2
222222
// Now learn a new model using the paramMapCombined parameters.
223223
// paramMapCombined overrides all parameters set earlier via lr.set* methods.
224224
val model2 = lr.fit(training.toDF, paramMapCombined)
225-
println("Model 2 was fit using parameters: " + model2.extractParamMap)
225+
println("Model 2 was fit using parameters: " + model2.parent.extractParamMap)
226226

227227
// Prepare test data.
228228
val test = sc.parallelize(Seq(
@@ -289,7 +289,7 @@ LogisticRegressionModel model1 = lr.fit(training);
289289
// we can view the parameters it used during fit().
290290
// This prints the parameter (name: value) pairs, where names are unique IDs for this
291291
// LogisticRegression instance.
292-
System.out.println("Model 1 was fit using parameters: " + model1.extractParamMap());
292+
System.out.println("Model 1 was fit using parameters: " + model1.parent().extractParamMap());
293293

294294
// We may alternatively specify parameters using a ParamMap.
295295
ParamMap paramMap = new ParamMap();
@@ -305,7 +305,7 @@ ParamMap paramMapCombined = paramMap.$plus$plus(paramMap2);
305305
// Now learn a new model using the paramMapCombined parameters.
306306
// paramMapCombined overrides all parameters set earlier via lr.set* methods.
307307
LogisticRegressionModel model2 = lr.fit(training, paramMapCombined);
308-
System.out.println("Model 2 was fit using parameters: " + model2.extractParamMap());
308+
System.out.println("Model 2 was fit using parameters: " + model2.parent().extractParamMap());
309309

310310
// Prepare test documents.
311311
List<LabeledPoint> localTest = Lists.newArrayList(

0 commit comments

Comments
 (0)