-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathfit.sh
executable file
·41 lines (33 loc) · 1.22 KB
/
fit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# Copyright 2025 DataRobot, Inc. and its affiliates.
#
# All rights reserved.
# This is proprietary source code of DataRobot, Inc. and its affiliates.
#
# Released under the terms of DataRobot Tool and Utility Agreement.
# You probably don't want to modify this file
cd "${CODEPATH}" || exit 1
export PYTHONPATH="${CODEPATH}":"${PYTHONPATH}"
export X="${INPUT_DIRECTORY}/X${TRAINING_DATA_EXTENSION:-.csv}"
export weights="${INPUT_DIRECTORY}/weights.csv"
export sparse_colnames="${INPUT_DIRECTORY}/X.colnames"
export parameters="${INPUT_DIRECTORY}/parameters.json"
CMD="drum fit --target-type ${TARGET_TYPE} --input ${X} --num-rows ALL --output ${ARTIFACT_DIRECTORY} \
--code-dir ${CODEPATH} --verbose --enable-fit-metadata "
if [ "${TARGET_TYPE}" != "anomaly" ]; then
CMD="${CMD} --target-csv ${INPUT_DIRECTORY}/y.csv"
fi
if [ -f "${weights}" ]; then
CMD="${CMD} --row-weights-csv ${weights}"
fi
if [ -f "${sparse_colnames}" ]; then
CMD="${CMD} --sparse-column-file ${sparse_colnames}"
fi
if [ -f "${parameters}" ]; then
CMD="${CMD} --parameter-file ${parameters}"
fi
if [ -n "${USER_SECRETS_MOUNT_PATH}" ]; then
CMD="${CMD} --user-secrets-mount-path ${USER_SECRETS_MOUNT_PATH}"
fi
echo "${CMD}"
sh -c "${CMD}"