Merge branch 'master' into sync-condition-2023Apr11
This commit is contained in:
commit
f645cf51c1
@ -931,7 +931,11 @@ class _SparkXGBEstimator(Estimator, _SparkXGBParams, MLReadable, MLWritable):
|
|||||||
result_xgb_model = self._convert_to_sklearn_model(
|
result_xgb_model = self._convert_to_sklearn_model(
|
||||||
bytearray(booster, "utf-8"), config
|
bytearray(booster, "utf-8"), config
|
||||||
)
|
)
|
||||||
return self._copyValues(self._create_pyspark_model(result_xgb_model))
|
spark_model = self._create_pyspark_model(result_xgb_model)
|
||||||
|
# According to pyspark ML convention, the model uid should be the same
|
||||||
|
# with estimator uid.
|
||||||
|
spark_model._resetUid(self.uid)
|
||||||
|
return self._copyValues(spark_model)
|
||||||
|
|
||||||
def write(self):
|
def write(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -12,7 +12,7 @@ steps:
|
|||||||
queue: pipeline-loader
|
queue: pipeline-loader
|
||||||
- wait
|
- wait
|
||||||
- block: ":rocket: Run this test job"
|
- block: ":rocket: Run this test job"
|
||||||
if: build.pull_request.repository.fork == true
|
if: build.pull_request.id != null
|
||||||
#### -------- CONTAINER BUILD --------
|
#### -------- CONTAINER BUILD --------
|
||||||
- label: ":docker: Build containers"
|
- label: ":docker: Build containers"
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
@ -6,7 +6,7 @@ steps:
|
|||||||
queue: pipeline-loader
|
queue: pipeline-loader
|
||||||
- wait
|
- wait
|
||||||
- block: ":rocket: Run this test job"
|
- block: ":rocket: Run this test job"
|
||||||
if: build.pull_request.repository.fork == true
|
if: build.pull_request.id != null
|
||||||
#### -------- BUILD --------
|
#### -------- BUILD --------
|
||||||
- label: ":windows: Build XGBoost for Windows with CUDA"
|
- label: ":windows: Build XGBoost for Windows with CUDA"
|
||||||
command: "tests/buildkite/build-win64-gpu.ps1"
|
command: "tests/buildkite/build-win64-gpu.ps1"
|
||||||
|
|||||||
@ -9,7 +9,7 @@ steps:
|
|||||||
queue: pipeline-loader
|
queue: pipeline-loader
|
||||||
- wait
|
- wait
|
||||||
- block: ":rocket: Run this test job"
|
- block: ":rocket: Run this test job"
|
||||||
if: build.pull_request.repository.fork == true
|
if: build.pull_request.id != null
|
||||||
#### -------- CONTAINER BUILD --------
|
#### -------- CONTAINER BUILD --------
|
||||||
- label: ":docker: Build containers"
|
- label: ":docker: Build containers"
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
@ -464,6 +464,7 @@ class TestPySparkLocal:
|
|||||||
def test_regressor_basic(self, reg_data: RegData) -> None:
|
def test_regressor_basic(self, reg_data: RegData) -> None:
|
||||||
regressor = SparkXGBRegressor(pred_contrib_col="pred_contribs")
|
regressor = SparkXGBRegressor(pred_contrib_col="pred_contribs")
|
||||||
model = regressor.fit(reg_data.reg_df_train)
|
model = regressor.fit(reg_data.reg_df_train)
|
||||||
|
assert regressor.uid == model.uid
|
||||||
pred_result = model.transform(reg_data.reg_df_test).collect()
|
pred_result = model.transform(reg_data.reg_df_test).collect()
|
||||||
for row in pred_result:
|
for row in pred_result:
|
||||||
np.testing.assert_equal(row.prediction, row.expected_prediction)
|
np.testing.assert_equal(row.prediction, row.expected_prediction)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user