Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package xgboost for openSUSE:Factory checked 
in at 2023-10-12 23:44:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xgboost (Old)
 and      /work/SRC/openSUSE:Factory/.xgboost.new.1807 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xgboost"

Thu Oct 12 23:44:16 2023 rev:5 rq:1117471 version:2.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/xgboost/xgboost.changes  2023-10-04 
22:31:24.331541550 +0200
+++ /work/SRC/openSUSE:Factory/.xgboost.new.1807/xgboost.changes        
2023-10-12 23:47:28.160541078 +0200
@@ -1,0 +2,28 @@
+Thu Oct 12 11:38:22 UTC 2023 - Fridrich Strba <fst...@suse.com>
+
+- Upgrade to upstream version 2.0.0
+  * Changes:
+    + Stop using Rabit in prediction (#9054)
+    + Set feature_names and feature_types in jvm-packages.
+      This is to prepare support for categorical features (#9364)
+    + Scala 2.13 support. (#9099)
+    + Change training stage from ResultStage to ShuffleMapStage
+      (#9423)
+    + Automatically set the max/min direction for the best score
+      during early stopping. (#9404)
+    + Revised support for flink (#9046)
+  * Breaking changes:
+    + Scala-based tracker is removed. (#9078, #9045)
+    + Change DeviceQuantileDmatrix into QuantileDMatrix (#8461)
+- Added patches:
+  * no-hadoop.patch
+    + revert commit bringing in apache-hadoop dependency, since
+      we don't have that one
+  * xgboost-2.0.0-cmake.patch
+    + allow building with cmake versions we have in SLE-15 and
+      SLE-12-SP5
+  * xgboost-2.0.0-python34.patch
+    + allow running scripts with python 3.4 by removing the f""
+      that is 3.6+ feature
+
+-------------------------------------------------------------------

Old:
----
  xgboost-0.90.tar.xz

New:
----
  no-hadoop.patch
  xgboost-2.0.0-cmake.patch
  xgboost-2.0.0-python34.patch
  xgboost-2.0.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xgboost.spec ++++++
--- /var/tmp/diff_new_pack.zyIDJi/_old  2023-10-12 23:47:28.692560341 +0200
+++ /var/tmp/diff_new_pack.zyIDJi/_new  2023-10-12 23:47:28.696560486 +0200
@@ -16,11 +16,12 @@
 #
 
 
-%global scala_short_version 2.10
-%global scala_version %{scala_short_version}.7
+%global scala_short_version 2.13
+%global scala_version %{scala_short_version}.12
+%global groupId ml.dmlc
 %global artifactId xgboost4j
 Name:           xgboost
-Version:        0.90
+Version:        2.0.0
 Release:        0
 Summary:        Gradient Boosting (GBDT, GBRT or GBM) Library
 License:        Apache-2.0
@@ -28,19 +29,28 @@
 Source0:        %{name}-%{version}.tar.xz
 Source1:        %{artifactId}-build.xml
 Patch0:         xgboost-fix-big-endian.patch
+Patch1:         no-hadoop.patch
+Patch2:         xgboost-2.0.0-python34.patch
+Patch3:         xgboost-2.0.0-cmake.patch
 BuildRequires:  akka
 BuildRequires:  ant
-BuildRequires:  ant-scala
 BuildRequires:  apache-commons-logging
-BuildRequires:  cmake
+BuildRequires:  cmake >= 3.5
 BuildRequires:  fdupes
-BuildRequires:  gcc-c++
-BuildRequires:  javapackages-local >= 6
+BuildRequires:  javapackages-local
 BuildRequires:  kryo
 BuildRequires:  objenesis
 BuildRequires:  python3
 BuildRequires:  scala
+BuildRequires:  scala-ant
 BuildRequires:  typesafe-config
+BuildRequires:  xmvn-install
+BuildRequires:  xmvn-resolve
+%if 0%{?suse_version} <= 1500
+BuildRequires:  gcc8-c++ >= 8.1
+%else
+BuildRequires:  gcc-c++
+%endif
 
 %description
 Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or
@@ -60,14 +70,25 @@
 %ifarch s390x ppc64
 %patch0
 %endif
-pushd jvm-packages
-%pom_xpath_set pom:project/pom:properties/pom:scala.version %{scala_version}
-%pom_xpath_set pom:project/pom:properties/pom:scala.binary.version 
%{scala_short_version}
-popd
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%pom_xpath_set pom:project/pom:properties/pom:scala.version %{scala_version} 
jvm-packages
+%pom_xpath_set pom:project/pom:properties/pom:scala.binary.version 
%{scala_short_version} jvm-packages
+%pom_remove_dep ":scala-collection-compat_\${scala.binary.version}" 
jvm-packages/%{artifactId}
+
+%{mvn_alias} :{*}_{*} :@1
+%{mvn_package} :xgboost-jvm __noinstall
 
 %build
 pushd jvm-packages
+%if 0%{?suse_version} <= 1500
+export CC=gcc-8
+export CXX=g++-8
+%endif
+%ifarch x86_64 aarch64
 python3 create_jni.py
+%endif
 popd
 pushd jvm-packages/%{artifactId}
 mkdir -p lib
@@ -76,20 +97,18 @@
 popd
 
 %install
-pushd jvm-packages/%{artifactId}
 install -dm 0755 %{buildroot}%{_jnidir}/%{name}
-install -pm 0644 target/%{artifactId}-%{version}.jar 
%{buildroot}%{_jnidir}/%{name}/%{artifactId}.jar
+install -pm 0644 
jvm-packages/%{artifactId}/target/%{artifactId}-%{version}.jar 
%{buildroot}%{_jnidir}/%{name}/%{artifactId}_%{scala_short_version}.jar
 
 install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
-%{mvn_install_pom} pom.xml 
%{buildroot}%{_mavenpomdir}/%{name}/%{artifactId}.pom
-%add_maven_depmap %{name}/%{artifactId}.pom %{name}/%{artifactId}.jar
+%{mvn_install_pom} jvm-packages/%{artifactId}/pom.xml 
%{buildroot}%{_mavenpomdir}/%{name}/%{artifactId}_%{scala_short_version}.pom
+%add_maven_depmap %{name}/%{artifactId}_%{scala_short_version}.pom 
%{name}/%{artifactId}_%{scala_short_version}.jar -a %{groupId}:%{artifactId}
 
 install -dm 0755 %{buildroot}%{_javadocdir}
-cp -r target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
+cp -r jvm-packages/%{artifactId}/target/site/apidocs 
%{buildroot}%{_javadocdir}/%{name}
 %fdupes -s %{buildroot}%{_javadocdir}
-popd
 
-%files -f jvm-packages/%{artifactId}/.mfiles
+%files -f .mfiles
 %license LICENSE
 
 %files javadoc

++++++ _service ++++++
--- /var/tmp/diff_new_pack.zyIDJi/_old  2023-10-12 23:47:28.736561934 +0200
+++ /var/tmp/diff_new_pack.zyIDJi/_new  2023-10-12 23:47:28.740562079 +0200
@@ -2,8 +2,10 @@
        <service name="tar_scm" mode="disabled">
                <param name="scm">git</param>
                <param name="url">https://github.com/dmlc/xgboost.git</param>
-               <param name="revision">v0.90</param>
-               <param name="versionformat">0.90</param>
+               <param name="revision">v2.0.0</param>
+               <param name="match-tag">v*</param>
+               <param name="versionformat">@PARENT_TAG@</param>
+               <param name="versionrewrite-pattern">v(.*)</param>
                <param name="filename">xgboost</param>
        </service>
        <service name="recompress" mode="disabled">

++++++ no-hadoop.patch ++++++
diff --git a/jvm-packages/xgboost4j/pom.xml b/jvm-packages/xgboost4j/pom.xml
index 8d4f2c05..7649df65 100644
--- a/jvm-packages/xgboost4j/pom.xml
+++ b/jvm-packages/xgboost4j/pom.xml
@@ -29,18 +29,6 @@
             
<artifactId>scala-collection-compat_${scala.binary.version}</artifactId>
             <version>${scala-collection-compat.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.hadoop</groupId>
-            <artifactId>hadoop-hdfs</artifactId>
-            <version>${hadoop.version}</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.hadoop</groupId>
-            <artifactId>hadoop-common</artifactId>
-            <version>${hadoop.version}</version>
-            <scope>provided</scope>
-        </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
diff --git 
a/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/ExternalCheckpointManager.java
 
b/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/ExternalCheckpointManager.java
deleted file mode 100644
index 655b9902..00000000
--- 
a/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/ExternalCheckpointManager.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package ml.dmlc.xgboost4j.java;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-
-public class ExternalCheckpointManager {
-
-  private Log logger = LogFactory.getLog("ExternalCheckpointManager");
-  private String modelSuffix = ".model";
-  private Path checkpointPath;
-  private FileSystem fs;
-
-  public ExternalCheckpointManager(String checkpointPath, FileSystem fs) 
throws XGBoostError {
-    if (checkpointPath == null || checkpointPath.isEmpty()) {
-      throw new XGBoostError("cannot create ExternalCheckpointManager with 
null or" +
-              " empty checkpoint path");
-    }
-    this.checkpointPath = new Path(checkpointPath);
-    this.fs = fs;
-  }
-
-  private String getPath(int version) {
-    return checkpointPath.toUri().getPath() + "/" + version + modelSuffix;
-  }
-
-  private List<Integer> getExistingVersions() throws IOException {
-    if (!fs.exists(checkpointPath)) {
-      return new ArrayList<>();
-    } else {
-      return Arrays.stream(fs.listStatus(checkpointPath))
-              .map(path -> path.getPath().getName())
-              .filter(fileName -> fileName.endsWith(modelSuffix))
-              .map(fileName -> Integer.valueOf(
-                      fileName.substring(0, fileName.length() - 
modelSuffix.length())))
-              .collect(Collectors.toList());
-    }
-  }
-
-  public void cleanPath() throws IOException {
-    fs.delete(checkpointPath, true);
-  }
-
-  public Booster loadCheckpointAsBooster() throws IOException, XGBoostError {
-    List<Integer> versions = getExistingVersions();
-    if (versions.size() > 0) {
-      int latestVersion = 
versions.stream().max(Comparator.comparing(Integer::valueOf)).get();
-      String checkpointPath = getPath(latestVersion);
-      InputStream in = fs.open(new Path(checkpointPath));
-      logger.info("loaded checkpoint from " + checkpointPath);
-      Booster booster = XGBoost.loadModel(in);
-      booster.setVersion(latestVersion);
-      return booster;
-    } else {
-      return null;
-    }
-  }
-
-  public void updateCheckpoint(Booster boosterToCheckpoint) throws 
IOException, XGBoostError {
-    List<String> prevModelPaths = getExistingVersions().stream()
-            .map(this::getPath).collect(Collectors.toList());
-    String eventualPath = getPath(boosterToCheckpoint.getVersion());
-    String tempPath = eventualPath + "-" + UUID.randomUUID();
-    try (OutputStream out = fs.create(new Path(tempPath), true)) {
-      boosterToCheckpoint.saveModel(out);
-      fs.rename(new Path(tempPath), new Path(eventualPath));
-      logger.info("saving checkpoint with version " + 
boosterToCheckpoint.getVersion());
-      prevModelPaths.stream().forEach(path -> {
-        try {
-          fs.delete(new Path(path), true);
-        } catch (IOException e) {
-          logger.error("failed to delete outdated checkpoint at " + path, e);
-        }
-      });
-    }
-  }
-
-  public void cleanUpHigherVersions(int currentRound) throws IOException {
-    getExistingVersions().stream().filter(v -> v / 2 >= 
currentRound).forEach(v -> {
-      try {
-        fs.delete(new Path(getPath(v)), true);
-      } catch (IOException e) {
-        logger.error("failed to clean checkpoint from other training 
instance", e);
-      }
-    });
-  }
-
-  public List<Integer> getCheckpointRounds(int checkpointInterval, int 
numOfRounds)
-      throws IOException {
-    if (checkpointInterval > 0) {
-      List<Integer> prevRounds =
-              getExistingVersions().stream().map(v -> v / 
2).collect(Collectors.toList());
-      prevRounds.add(0);
-      int firstCheckpointRound = prevRounds.stream()
-              .max(Comparator.comparing(Integer::valueOf)).get() + 
checkpointInterval;
-      List<Integer> arr = new ArrayList<>();
-      for (int i = firstCheckpointRound; i <= numOfRounds; i += 
checkpointInterval) {
-        arr.add(i);
-      }
-      arr.add(numOfRounds);
-      return arr;
-    } else if (checkpointInterval <= 0) {
-      List<Integer> l = new ArrayList<Integer>();
-      l.add(numOfRounds);
-      return l;
-    } else {
-      throw new IllegalArgumentException("parameters \"checkpoint_path\" 
should also be set.");
-    }
-  }
-}
diff --git 
a/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java 
b/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java
index bcd0b1b1..3e23c15f 100644
--- a/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java
+++ b/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java
@@ -22,7 +22,6 @@ import java.util.regex.Pattern;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.fs.FileSystem;
 
 /**
  * trainer for xgboost
@@ -134,34 +133,35 @@ public class XGBoost {
     return train(dtrain, params, round, watches, metrics, obj, eval, 
earlyStoppingRound, null);
   }
 
-  private static void saveCheckpoint(
-          Booster booster,
-          int iter,
-          Set<Integer> checkpointIterations,
-          ExternalCheckpointManager ecm) throws XGBoostError {
-    try {
-      if (checkpointIterations.contains(iter)) {
-        ecm.updateCheckpoint(booster);
-      }
-    } catch (Exception e) {
-      logger.error("failed to save checkpoint in XGBoost4J at iteration " + 
iter, e);
-      throw new XGBoostError("failed to save checkpoint in XGBoost4J at 
iteration" + iter, e);
-    }
-  }
-
-  public static Booster trainAndSaveCheckpoint(
+  /**
+   * Train a booster given parameters.
+   *
+   * @param dtrain  Data to be trained.
+   * @param params  Parameters.
+   * @param round   Number of boosting iterations.
+   * @param watches a group of items to be evaluated during training, this 
allows user to watch
+   *                performance on the validation set.
+   * @param metrics array containing the evaluation metrics for each matrix in 
watches for each
+   *                iteration
+   * @param earlyStoppingRounds if non-zero, training would be stopped
+   *                           after a specified number of consecutive
+   *                           goes to the unexpected direction in any 
evaluation metric.
+   * @param obj     customized objective
+   * @param eval    customized evaluation
+   * @param booster train from scratch if set to null; train from an existing 
booster if not null.
+   * @return The trained booster.
+   */
+  public static Booster train(
       DMatrix dtrain,
       Map<String, Object> params,
-      int numRounds,
+          int round,
       Map<String, DMatrix> watches,
       float[][] metrics,
       IObjective obj,
       IEvaluation eval,
       int earlyStoppingRounds,
-      Booster booster,
-      int checkpointInterval,
-      String checkpointPath,
-      FileSystem fs) throws XGBoostError, IOException {
+          Booster booster) throws XGBoostError {
+
     //collect eval matrixs
     String[] evalNames;
     DMatrix[] evalMats;
@@ -169,11 +169,6 @@ public class XGBoost {
     int bestIteration;
     List<String> names = new ArrayList<String>();
     List<DMatrix> mats = new ArrayList<DMatrix>();
-    Set<Integer> checkpointIterations = new HashSet<>();
-    ExternalCheckpointManager ecm = null;
-    if (checkpointPath != null) {
-      ecm = new ExternalCheckpointManager(checkpointPath, fs);
-    }
 
     for (Map.Entry<String, DMatrix> evalEntry : watches.entrySet()) {
       names.add(evalEntry.getKey());
@@ -184,7 +179,7 @@ public class XGBoost {
     evalMats = mats.toArray(new DMatrix[mats.size()]);
 
     bestIteration = 0;
-    metrics = metrics == null ? new float[evalNames.length][numRounds] : 
metrics;
+    metrics = metrics == null ? new float[evalNames.length][round] : metrics;
 
     //collect all data matrixs
     DMatrix[] allMats;
@@ -209,22 +204,17 @@ public class XGBoost {
       booster.setParams(params);
     }
 
-    if (ecm != null) {
-      checkpointIterations = new 
HashSet<>(ecm.getCheckpointRounds(checkpointInterval, numRounds));
-    }
-
     boolean initial_best_score_flag = false;
     boolean max_direction = false;
 
     // begin to train
-    for (int iter = booster.getVersion() / 2; iter < numRounds; iter++) {
+    for (int iter = booster.getVersion() / 2; iter < round; iter++) {
       if (booster.getVersion() % 2 == 0) {
         if (obj != null) {
           booster.update(dtrain, obj);
         } else {
           booster.update(dtrain, iter);
         }
-        saveCheckpoint(booster, iter, checkpointIterations, ecm);
         booster.saveRabitCheckpoint();
       }
 
@@ -290,44 +280,6 @@ public class XGBoost {
     return booster;
   }
 
-  /**
-   * Train a booster given parameters.
-   *
-   * @param dtrain  Data to be trained.
-   * @param params  Parameters.
-   * @param round   Number of boosting iterations.
-   * @param watches a group of items to be evaluated during training, this 
allows user to watch
-   *                performance on the validation set.
-   * @param metrics array containing the evaluation metrics for each matrix in 
watches for each
-   *                iteration
-   * @param earlyStoppingRounds if non-zero, training would be stopped
-   *                           after a specified number of consecutive
-   *                           goes to the unexpected direction in any 
evaluation metric.
-   * @param obj     customized objective
-   * @param eval    customized evaluation
-   * @param booster train from scratch if set to null; train from an existing 
booster if not null.
-   * @return The trained booster.
-   */
-  public static Booster train(
-          DMatrix dtrain,
-          Map<String, Object> params,
-          int round,
-          Map<String, DMatrix> watches,
-          float[][] metrics,
-          IObjective obj,
-          IEvaluation eval,
-          int earlyStoppingRounds,
-          Booster booster) throws XGBoostError {
-    try {
-      return trainAndSaveCheckpoint(dtrain, params, round, watches, metrics, 
obj, eval,
-              earlyStoppingRounds, booster,
-              -1, null, null);
-    } catch (IOException e) {
-      logger.error("training failed in xgboost4j", e);
-      throw new XGBoostError("training failed in xgboost4j ", e);
-    }
-  }
-
   private static Integer tryGetIntFromObject(Object o) {
     if (o instanceof Integer) {
       return (int)o;
diff --git 
a/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/ExternalCheckpointManager.scala
 
b/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/ExternalCheckpointManager.scala
deleted file mode 100644
index 240c2387..00000000
--- 
a/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/ExternalCheckpointManager.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright (c) 2014 by Contributors
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-package ml.dmlc.xgboost4j.scala
-
-import ml.dmlc.xgboost4j.java.{ExternalCheckpointManager => JavaECM}
-import org.apache.hadoop.fs.FileSystem
-
-class ExternalCheckpointManager(checkpointPath: String, fs: FileSystem)
-  extends JavaECM(checkpointPath, fs) {
-
-  def updateCheckpoint(booster: Booster): Unit = {
-    super.updateCheckpoint(booster.booster)
-  }
-
-  def loadCheckpointAsScalaBooster(): Booster = {
-    val loadedBooster = super.loadCheckpointAsBooster()
-    if (loadedBooster == null) {
-      null
-    } else {
-      new Booster(loadedBooster)
-    }
-  }
-}
diff --git 
a/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/XGBoost.scala 
b/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/XGBoost.scala
index 50d86c89..49ce29d8 100644
--- 
a/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/XGBoost.scala
+++ 
b/jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/XGBoost.scala
@@ -20,61 +20,12 @@ import java.io.InputStream
 import ml.dmlc.xgboost4j.java.{XGBoostError, XGBoost => JXGBoost}
 
 import scala.jdk.CollectionConverters._
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.fs.Path
 
 /**
   * XGBoost Scala Training function.
   */
 object XGBoost {
 
-  private[scala] def trainAndSaveCheckpoint(
-      dtrain: DMatrix,
-      params: Map[String, Any],
-      numRounds: Int,
-      watches: Map[String, DMatrix] = Map(),
-      metrics: Array[Array[Float]] = null,
-      obj: ObjectiveTrait = null,
-      eval: EvalTrait = null,
-      earlyStoppingRound: Int = 0,
-      prevBooster: Booster,
-      checkpointParams: Option[ExternalCheckpointParams]): Booster = {
-
-    // we have to filter null value for customized obj and eval
-    val jParams: java.util.Map[String, AnyRef] =
-      params.filter(_._2 != 
null).mapValues(_.toString.asInstanceOf[AnyRef]).toMap.asJava
-
-    val jWatches = watches.mapValues(_.jDMatrix).toMap.asJava
-    val jBooster = if (prevBooster == null) {
-      null
-    } else {
-      prevBooster.booster
-    }
-
-    val xgboostInJava = checkpointParams.
-      map(cp => {
-          JXGBoost.trainAndSaveCheckpoint(
-            dtrain.jDMatrix,
-            jParams,
-            numRounds, jWatches, metrics, obj, eval, earlyStoppingRound, 
jBooster,
-            cp.checkpointInterval,
-            cp.checkpointPath,
-            new Path(cp.checkpointPath).getFileSystem(new Configuration()))
-        }).
-      getOrElse(
-        JXGBoost.train(
-          dtrain.jDMatrix,
-          jParams,
-          numRounds, jWatches, metrics, obj, eval, earlyStoppingRound, 
jBooster)
-      )
-    if (prevBooster == null) {
-      new Booster(xgboostInJava)
-    } else {
-      // Avoid creating a new SBooster with the same JBooster
-      prevBooster
-    }
-  }
-
   /**
     * Train a booster given parameters.
     *
@@ -104,8 +55,23 @@ object XGBoost {
       eval: EvalTrait = null,
       earlyStoppingRound: Int = 0,
       booster: Booster = null): Booster = {
-    trainAndSaveCheckpoint(dtrain, params, round, watches, metrics, obj, eval, 
earlyStoppingRound,
-      booster, None)
+    val jWatches = watches.mapValues(_.jDMatrix).toMap.asJava
+    val jBooster = if (booster == null) {
+      null
+    } else {
+      booster.booster
+    }
+    val xgboostInJava = JXGBoost.train(
+      dtrain.jDMatrix,
+      // we have to filter null value for customized obj and eval
+      params.filter(_._2 != 
null).mapValues(_.toString.asInstanceOf[AnyRef]).toMap.asJava,
+      round, jWatches, metrics, obj, eval, earlyStoppingRound, jBooster)
+    if (booster == null) {
+      new Booster(xgboostInJava)
+    } else {
+      // Avoid creating a new SBooster with the same JBooster
+      booster
+    }
   }
 
   /**
@@ -160,41 +126,3 @@ object XGBoost {
     new Booster(xgboostInJava)
   }
 }
-
-private[scala] case class ExternalCheckpointParams(
-    checkpointInterval: Int,
-    checkpointPath: String,
-    skipCleanCheckpoint: Boolean)
-
-private[scala] object ExternalCheckpointParams {
-
-  def extractParams(params: Map[String, Any]): 
Option[ExternalCheckpointParams] = {
-    val checkpointPath: String = params.get("checkpoint_path") match {
-      case None | Some(null) | Some("") => null
-      case Some(path: String) => path
-      case _ => throw new IllegalArgumentException("parameter 
\"checkpoint_path\" must be" +
-        s" an instance of String, but current value is 
${params("checkpoint_path")}")
-    }
-
-    val checkpointInterval: Int = params.get("checkpoint_interval") match {
-      case None => 0
-      case Some(freq: Int) => freq
-      case _ => throw new IllegalArgumentException("parameter 
\"checkpoint_interval\" must be" +
-        " an instance of Int.")
-    }
-
-    val skipCleanCheckpointFile: Boolean = params.get("skip_clean_checkpoint") 
match {
-      case None => false
-      case Some(skipCleanCheckpoint: Boolean) => skipCleanCheckpoint
-      case _ => throw new IllegalArgumentException("parameter 
\"skip_clean_checkpoint\" must be" +
-        " an instance of Boolean")
-    }
-    if (checkpointPath == null || checkpointInterval == 0) {
-      None
-    } else {
-      Some(ExternalCheckpointParams(checkpointInterval, checkpointPath, 
skipCleanCheckpointFile))
-    }
-  }
-}
-
-

++++++ xgboost-2.0.0-cmake.patch ++++++
--- xgboost-2.0.0/CMakeLists.txt        2023-10-07 11:33:17.298102827 +0200
+++ xgboost-2.0.0/CMakeLists.txt        2023-10-07 12:15:05.755584934 +0200
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
 project(xgboost LANGUAGES CXX C VERSION 2.0.0)
 include(cmake/Utils.cmake)
 list(APPEND CMAKE_MODULE_PATH "${xgboost_SOURCE_DIR}/cmake/modules")
@@ -180,6 +180,9 @@
 
 if (USE_OPENMP)
   if (APPLE)
+    # Require CMake 3.16+ on Mac OSX, as previous versions of CMake had 
trouble locating
+    # OpenMP on Mac. See 
https://github.com/dmlc/xgboost/pull/5146#issuecomment-568312706
+    cmake_minimum_required(VERSION 3.16)
     find_package(OpenMP)
     if (NOT OpenMP_FOUND)
       # Try again with extra path info; required for libomp 15+ from Homebrew
--- xgboost-2.0.0/demo/c-api/CMakeLists.txt     2023-10-07 11:33:17.398103617 
+0200
+++ xgboost-2.0.0/demo/c-api/CMakeLists.txt     2023-10-07 12:15:05.755584934 
+0200
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.18)
+cmake_minimum_required(VERSION 3.13)
 project(xgboost-c-examples)
 
 add_subdirectory(basic)
--- xgboost-2.0.0/demo/c-api/external-memory/CMakeLists.txt     2023-10-07 
11:33:17.401436976 +0200
+++ xgboost-2.0.0/demo/c-api/external-memory/CMakeLists.txt     2023-10-07 
12:15:05.758918291 +0200
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.18)
+cmake_minimum_required(VERSION 3.13)
 project(external-memory-demo LANGUAGES C VERSION 0.0.1)
 
 find_package(xgboost REQUIRED)
--- xgboost-2.0.0/demo/c-api/inference/CMakeLists.txt   2023-10-07 
11:33:17.401436976 +0200
+++ xgboost-2.0.0/demo/c-api/inference/CMakeLists.txt   2023-10-07 
12:15:05.758918291 +0200
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.18)
+cmake_minimum_required(VERSION 3.13)
 project(inference-demo LANGUAGES C VERSION 0.0.1)
 find_package(xgboost REQUIRED)
 
--- xgboost-2.0.0/doc/tutorials/c_api_tutorial.rst      2023-10-07 
11:33:17.514771205 +0200
+++ xgboost-2.0.0/doc/tutorials/c_api_tutorial.rst      2023-10-07 
12:15:05.758918291 +0200
@@ -45,7 +45,7 @@
 
 .. code-block:: cmake
 
-    cmake_minimum_required(VERSION 3.18)
+    cmake_minimum_required(VERSION 3.13)
     project(your_project_name LANGUAGES C CXX VERSION your_project_version)
     find_package(xgboost REQUIRED)
     add_executable(your_project_name /path/to/project_file.c)
--- xgboost-2.0.0/rabit/CMakeLists.txt  2023-10-07 11:33:17.724772863 +0200
+++ xgboost-2.0.0/rabit/CMakeLists.txt  2023-10-07 12:15:05.758918291 +0200
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.18)
+cmake_minimum_required(VERSION 3.3)
 
 find_package(Threads REQUIRED)
 

++++++ xgboost-2.0.0-python34.patch ++++++
--- xgboost-2.0.0/jvm-packages/create_jni.py    2023-10-07 11:33:17.581438398 
+0200
+++ xgboost-2.0.0/jvm-packages/create_jni.py    2023-10-07 11:57:33.488402381 
+0200
@@ -122,8 +122,8 @@
             run("cmake --build . --config Release" + maybe_parallel_build)
 
         with cd("demo/CLI/regression"):
-            run(f'"{sys.executable}" mapfeat.py')
-            run(f'"{sys.executable}" mknfold.py machine.txt 1')
+            run("{} mapfeat.py".format(sys.executable))
+            run("{} mknfold.py machine.txt 1".format(sys.executable))
 
     xgboost4j = 'xgboost4j-gpu' if cli_args.use_cuda == 'ON' else 'xgboost4j'
     xgboost4j_spark = 'xgboost4j-spark-gpu' if cli_args.use_cuda == 'ON' else 
'xgboost4j-spark'
@@ -153,8 +153,8 @@
     print("copying train/test files")
     maybe_makedirs("{}/src/test/resources".format(xgboost4j_spark))
     with cd("../demo/CLI/regression"):
-        run(f'"{sys.executable}" mapfeat.py')
-        run(f'"{sys.executable}" mknfold.py machine.txt 1')
+        run("{} mapfeat.py".format(sys.executable))
+        run("{} mknfold.py machine.txt 1".format(sys.executable))
 
     for file in glob.glob("../demo/CLI/regression/machine.txt.t*"):
         cp(file, "{}/src/test/resources".format(xgboost4j_spark))

++++++ xgboost-0.90.tar.xz -> xgboost-2.0.0.tar.xz ++++++
++++ 342028 lines of diff (skipped)

++++++ xgboost4j-build.xml ++++++
--- /var/tmp/diff_new_pack.zyIDJi/_old  2023-10-12 23:47:29.592592929 +0200
+++ /var/tmp/diff_new_pack.zyIDJi/_new  2023-10-12 23:47:29.596593074 +0200
@@ -10,7 +10,7 @@
 
   <property name="project.groupId" value="com.fasterxml.jackson.core"/>
   <property name="project.artifactId" value="xgboost4j"/>
-  <property name="project.version" value="0.90"/>
+  <property name="project.version" value="2.0.0"/>
 
   <property name="compiler.release" value="8"/>
   <property name="compiler.source" value="1.${compiler.release}"/>
@@ -66,7 +66,6 @@
            encoding="UTF-8"
            optimize="false"
            deprecation="true"
-           release="${compiler.release}"
            target="${compiler.target}"
            verbose="false"
            fork="false"

Reply via email to