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

fixed csv reader issue for the bosch dataset #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 7 additions & 56 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG CUDA_VERSION
ARG XGB_HASH=6d293020fbfa2c67b532d550fe5d55689662caac
FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu16.04
SHELL ["/bin/bash", "-c"]
# Install conda (and use python 3.7)
Expand Down Expand Up @@ -26,6 +27,7 @@ RUN curl -o /opt/miniconda.sh \
/opt/conda/bin/conda update -n base conda && \
rm /opt/miniconda.sh
ENV PATH /opt/conda/bin:$PATH

RUN conda install -c conda-forge \
bokeh \
h5py \
Expand Down Expand Up @@ -64,76 +66,25 @@ RUN wget --no-check-certificate \
rm -rf cmake-${CMAKE_LONG_VERSION}.tar.gz cmake-${CMAKE_LONG_VERSION}

# lightgbm
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
bzip2 \
ca-certificates \
curl \
git \
libblas-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-system-dev \
libbz2-dev \
libc6 \
libglib2.0-0 \
liblapack-dev \
libsm6 \
libxext6 \
libxrender1 \
make \
tar \
unzip \
wget && \
rm -rf /var/lib/apt/*
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV OPENCL_LIBRARIES /usr/local/cuda/lib64
ENV OPENCL_INCLUDE_DIR /usr/local/cuda/include
RUN git config --global http.sslVerify false && \
git clone --recursive https://github.com/Microsoft/LightGBM /opt/LightGBM && \
cd /opt/LightGBM && \
mkdir build && \
cd build && \
cmake .. \
-DUSE_GPU=1 \
-DOpenCL_LIBRARY=$OPENCL_LIBRARIES/libOpenCL.so \
-DOpenCL_INCLUDE_DIR=$OPENCL_INCLUDE_DIR && \
make OPENCL_HEADERS="/usr/local/cuda/targets/x86_64-linux/include" \
LIBOPENCL="/usr/local/cuda/targets/x86_64-linux/lib" -j4 && \
cd ../python-package && \
python setup.py install --precompile
RUN pip install lightgbm

# catboost
RUN if ["$CUDA_VERSION" < "11.0"]; then git config --global http.sslVerify false && \
git clone --recursive "https://github.com/catboost/catboost" /opt/catboost && \
cd /opt/catboost && \
cd catboost/python-package/catboost && \
../../../ya make \
-r \
-o ../../.. \
-DUSE_ARCADIA_PYTHON=no \
-DUSE_SYSTEM_PYTHON=3.7\
-DPYTHON_CONFIG=python3-config \
-DCUDA_ROOT=$(dirname $(dirname $(which nvcc))); \
fi
ENV if ["$CUDA_VERSION" < "11.0"]; then PYTHONPATH=$PYTHONPATH:/opt/catboost/catboost/python-package; fi\


RUN pip install catboost

# xgboost
RUN git config --global http.sslVerify false && \
git clone --recursive https://github.com/dmlc/xgboost /opt/xgboost && \
cd /opt/xgboost && \
git checkout $XGB_HASH && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
RMM_ROOT=/opt/conda cmake .. \
-DUSE_CUDA=ON \
-DUSE_NCCL=ON \
-DPLUGIN_RMM=ON && \
make -j4 && \
git log > xgb_log.txt && \
cd ../python-package && \
pip uninstall -y xgboost && \
python setup.py install
5 changes: 3 additions & 2 deletions datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ def prepare_bosch(dataset_folder, nrows):

os.system("kaggle competitions download -c bosch-production-line-performance -f " +
filename + " -p " + dataset_folder)
X = pd.read_csv(local_url, index_col=0, compression='zip', dtype=np.float32,
nrows=nrows)
X = pd.read_csv(local_url,compression='zip', dtype=np.float32)
X = X.set_index('Id')
X.index = X.index.astype('int64')
y = X.iloc[:, -1].to_numpy(dtype=np.float32)
X.drop(X.columns[-1], axis=1, inplace=True)
X = X.to_numpy(dtype=np.float32)
Expand Down