Skip to content

Commit

Permalink
Use less specific ignores in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zero323 committed Sep 7, 2020
1 parent 5b2ec19 commit 8f9ef95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/src/main/python/ml/fm_classifier_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
accuracy = evaluator.evaluate(predictions)
print("Test set accuracy = %g" % accuracy)

fmModel: FMClassificationModel = model.stages[2] # type: ignore[assignment]
fmModel: FMClassificationModel = model.stages[2] # type: ignore
print("Factors: " + str(fmModel.factors))
print("Linear: " + str(fmModel.linear))
print("Intercept: " + str(fmModel.intercept))
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/ml/fm_regressor_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
rmse = evaluator.evaluate(predictions)
print("Root Mean Squared Error (RMSE) on test data = %g" % rmse)

fmModel: FMRegressionModel = model.stages[1] # type: ignore[assignment]
fmModel: FMRegressionModel = model.stages[1] # type: ignore
print("Factors: " + str(fmModel.factors))
print("Linear: " + str(fmModel.linear))
print("Intercept: " + str(fmModel.intercept))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# in the earlier example
trainingSummary: BinaryLogisticRegressionTrainingSummary = (
lrModel.summary
) # type: ignore[assignment]
) # type: ignore

# Obtain the objective per iteration
objectiveHistory = trainingSummary.objectiveHistory
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/ml/pipeline_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
prediction = model.transform(test)
selected = prediction.select("id", "text", "probability", "prediction")
for row in selected.collect():
rid, text, prob, prediction = row # type: ignore[no-redef]
rid, text, prob, prediction = row # type: ignore
print(
"(%d, %s) --> prob=%s, prediction=%f" % (
rid, text, str(prob), prediction # type: ignore
Expand Down

0 comments on commit 8f9ef95

Please sign in to comment.