Uh oh!
There was an error while loading. Please reload this page.
[SPARK-20862][MLLIB][PYTHON] Avoid passing float to ndarray.reshape in LogisticRegressionModel - #18081
[SPARK-20862][MLLIB][PYTHON] Avoid passing float to ndarray.reshape in LogisticRegressionModel#18081MrBago wants to merge 1 commit into
Conversation
SparkQA
commented
May 24, 2017
Test build #77275 has finished for PR 18081 at commit
|
viirya
commented
May 24, 2017
LGTM Do we have similar cases in MLlib? |
viirya
commented
May 24, 2017
To test it in jenkins might need a specified numpy version, but the code change looks ok. |
srowen
commented
May 24, 2017
Dumb question but this still works in Python 2.6+ right? |
viirya
commented
May 24, 2017
I think so. |
viirya
commented
May 24, 2017
Nit: usually we won't specially tag it is a BugFix in the title. |
MrBago
commented
May 24, 2017
@srowen floor divide has been in python since 2.2, https://www.python.org/download/releases/2.2/. |
MrBago
commented
May 24, 2017
@viirya I was running python tests for pyspark-ml and pyspark-mllib and this was the only place where the python3/numpy interaction caused a test failure. There might be other places where floor int division might be preferable to float division, but if they exist they're not causing any of the tests to fail. |
viirya
commented
May 24, 2017
@MrBago Yeah, after a quick scan, seems other |
…n LogisticRegressionModel ## What changes were proposed in this pull request? Fixed TypeError with python3 and numpy 1.12.1. Numpy's `reshape` no longer takes floats as arguments as of 1.12. Also, python3 uses float division for `/`, we should be using `//` to ensure that `_dataWithBiasSize` doesn't get set to a float. ## How was this patch tested? Existing tests run using python3 and numpy 1.12. Author: Bago Amirbekian <bago@databricks.com> Closes#18081 from MrBago/BF-py3floatbug. (cherry picked from commit bc66a77) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
LGTM, merged into master/branch-2.2/branch-2.1/branch-2.0. Thanks for all. |
…n LogisticRegressionModel ## What changes were proposed in this pull request? Fixed TypeError with python3 and numpy 1.12.1. Numpy's `reshape` no longer takes floats as arguments as of 1.12. Also, python3 uses float division for `/`, we should be using `//` to ensure that `_dataWithBiasSize` doesn't get set to a float. ## How was this patch tested? Existing tests run using python3 and numpy 1.12. Author: Bago Amirbekian <bago@databricks.com> Closes#18081 from MrBago/BF-py3floatbug. (cherry picked from commit bc66a77) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
…n LogisticRegressionModel ## What changes were proposed in this pull request? Fixed TypeError with python3 and numpy 1.12.1. Numpy's `reshape` no longer takes floats as arguments as of 1.12. Also, python3 uses float division for `/`, we should be using `//` to ensure that `_dataWithBiasSize` doesn't get set to a float. ## How was this patch tested? Existing tests run using python3 and numpy 1.12. Author: Bago Amirbekian <bago@databricks.com> Closes#18081 from MrBago/BF-py3floatbug. (cherry picked from commit bc66a77) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
…n LogisticRegressionModel ## What changes were proposed in this pull request? Fixed TypeError with python3 and numpy 1.12.1. Numpy's `reshape` no longer takes floats as arguments as of 1.12. Also, python3 uses float division for `/`, we should be using `//` to ensure that `_dataWithBiasSize` doesn't get set to a float. ## How was this patch tested? Existing tests run using python3 and numpy 1.12. Author: Bago Amirbekian <bago@databricks.com> Closesapache#18081 from MrBago/BF-py3floatbug.
…n LogisticRegressionModel Fixed TypeError with python3 and numpy 1.12.1. Numpy's `reshape` no longer takes floats as arguments as of 1.12. Also, python3 uses float division for `/`, we should be using `//` to ensure that `_dataWithBiasSize` doesn't get set to a float. Existing tests run using python3 and numpy 1.12. Author: Bago Amirbekian <bago@databricks.com> Closesapache#18081 from MrBago/BF-py3floatbug. (cherry picked from commit bc66a77) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
What changes were proposed in this pull request?
Fixed TypeError with python3 and numpy 1.12.1. Numpy's
reshapeno longer takes floats as arguments as of 1.12. Also, python3 uses float division for/, we should be using//to ensure that_dataWithBiasSizedoesn't get set to a float.How was this patch tested?
Existing tests run using python3 and numpy 1.12.