Skip to content

Commit fa2676c

Browse files
committed
doctest ml
1 parent 65abef4 commit fa2676c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/pyspark/ml/classification.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ class LinearSVC(
699699
>>> model_path = temp_path + "/svm_model"
700700
>>> model.save(model_path)
701701
>>> model2 = LinearSVCModel.load(model_path)
702-
>>> model.coefficients[0] == model2.coefficients[0]
702+
>>> bool(model.coefficients[0] == model2.coefficients[0])
703703
True
704704
>>> model.intercept == model2.intercept
705705
True
@@ -1210,7 +1210,7 @@ class LogisticRegression(
12101210
>>> model_path = temp_path + "/lr_model"
12111211
>>> blorModel.save(model_path)
12121212
>>> model2 = LogisticRegressionModel.load(model_path)
1213-
>>> blorModel.coefficients[0] == model2.coefficients[0]
1213+
>>> bool(blorModel.coefficients[0] == model2.coefficients[0])
12141214
True
12151215
>>> blorModel.intercept == model2.intercept
12161216
True
@@ -2038,9 +2038,9 @@ class RandomForestClassifier(
20382038
>>> result = model.transform(test0).head()
20392039
>>> result.prediction
20402040
0.0
2041-
>>> numpy.argmax(result.probability)
2041+
>>> int(numpy.argmax(result.probability))
20422042
0
2043-
>>> numpy.argmax(result.newRawPrediction)
2043+
>>> int(numpy.argmax(result.newRawPrediction))
20442044
0
20452045
>>> result.leafId
20462046
DenseVector([0.0, 0.0, 0.0])

0 commit comments

Comments
 (0)