Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparkxgb import for PySpark #5683

Closed
Ben-Epstein opened this issue May 19, 2020 · 1 comment
Closed

sparkxgb import for PySpark #5683

Ben-Epstein opened this issue May 19, 2020 · 1 comment

Comments

@Ben-Epstein
Copy link

Ben-Epstein commented May 19, 2020

I've been following the threads for PySpark support and see here that adding the jars as pyFiles does the trick.

Unfortunately I'm unable to import from sparkxgb after following those steps on 1.0.0

from pyspark.sql import SparkSession
spark = SparkSession.builder.config('spark.jars','xgboost4j-spark_2.12-1.0.0.jar').config('spark.jars', 'xgboost4j_2.12-1.0.0.jar').getOrCreate()

spark.sparkContext.addPyFile("xgboost4j-spark_2.12-1.0.0.jar")
spark.sparkContext.addPyFile("./xgboost4j_2.12-1.0.0.jar")
from sparkxgb import XGBoostClassifier, XGBoostClassificationModel
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-9-8a1823de6207> in <module>
----> 1 from sparkxgb import XGBoostClassifier, XGBoostClassificationModel

ModuleNotFoundError: No module named 'sparkxgb'

I'm running this on Jupyter, not sure if it matters or not.

Any suggestions?

Thanks!

@hcho3
Copy link
Collaborator

hcho3 commented May 19, 2020

There is a new thread for PySpark: #5658.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants