From 7a384f166ee8c15e4610d0e8d2f79a5933ab07cc Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Mon, 1 Jul 2024 22:08:04 +0000 Subject: [PATCH 1/2] move --- Dockerfile.tmpl | 2 +- tests/test_xgboost.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 3d892f8a..70da1e09 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -89,6 +89,7 @@ RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list & apt-get install -y build-essential unzip cmake libboost-dev libboost-system-dev libboost-filesystem-dev p7zip-full && \ # b/182601974: ssh client was removed from the base image but is required for packages such as stable-baselines. apt-get install -y openssh-client && \ + apt-get install -y graphviz && pip install graphviz && \ /tmp/clean-layer.sh # b/128333086: Set PROJ_LIB to points to the proj4 cartographic library. @@ -280,7 +281,6 @@ RUN pip install "scipy==1.12.0" \ datashader \ # Boruta (python implementation) Boruta && \ - apt-get install -y graphviz && pip install graphviz && \ # Pandoc is a dependency of deap apt-get install -y pandoc && \ pip install essentia diff --git a/tests/test_xgboost.py b/tests/test_xgboost.py index 6b6c6ec1..68166813 100644 --- a/tests/test_xgboost.py +++ b/tests/test_xgboost.py @@ -17,10 +17,9 @@ def test_classifier(self): X_test = np.random.random((100, 28)) y_test = np.random.randint(10, size=(100, 1)) - xgb1 = XGBClassifier(n_estimators=3, use_label_encoder=False) + xgb1 = XGBClassifier(n_estimators=3, use_label_encoder=False, eval_metric='mlogloss') xgb1.fit( X_train, y_train, eval_set=[(X_train, y_train), (X_test, y_test)], - eval_metric='mlogloss', ) self.assertIn("validation_0", xgb1.evals_result()) From af5c46b0f148f6bcf8ae9836a243d85eac90fb57 Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Mon, 1 Jul 2024 23:47:20 +0000 Subject: [PATCH 2/2] l --- Dockerfile.tmpl | 3 ++- tests/test_xgboost.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 70da1e09..f79a7e1e 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -230,12 +230,13 @@ RUN pip install --no-deps "keras>3" keras-cv keras-nlp namex && \ # b/328788268 libpysal 4.10 seems to fail with "module 'shapely' has no attribute 'Geometry'. Did you mean: 'geometry'" RUN pip install pysal "libpysal==4.9.2" +# b/350573866 xgboost v2.1.0 breaks learntools RUN apt-get install -y libfreetype6-dev && \ apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \ pip install gensim \ textblob \ wordcloud \ - xgboost \ + "xgboost==2.0.3" \ pydot \ hep_ml && \ # NLTK Project datasets diff --git a/tests/test_xgboost.py b/tests/test_xgboost.py index 68166813..618a63cc 100644 --- a/tests/test_xgboost.py +++ b/tests/test_xgboost.py @@ -17,9 +17,10 @@ def test_classifier(self): X_test = np.random.random((100, 28)) y_test = np.random.randint(10, size=(100, 1)) - xgb1 = XGBClassifier(n_estimators=3, use_label_encoder=False, eval_metric='mlogloss') + xgb1 = XGBClassifier(n_estimators=3, use_label_encoder=False) xgb1.fit( X_train, y_train, eval_set=[(X_train, y_train), (X_test, y_test)], + eval_metric='mlogloss' ) self.assertIn("validation_0", xgb1.evals_result())