Skip to content

Files

Latest commit

9a967dc · Mar 6, 2024

History

History

TRAILS-Database-Native-Model-Selection

Database-Native Model Selection

​ -- based on SINGA

image-20231020174425377

Build & Run examples

Singa + PostgreSQL

# Create project folder.
mkdir project && cd project
# Download the Dockerile.
wget https://raw.githubusercontent.com/apache/singa/dev-postgresql/examples/model_selection/TRAILS-Database-Native-Model-Selection/Dockerfile


# Build Dockerile and run the docker.
docker build -t trails .
docker run -d --name trails --network="host" trails
# Monitor the logs until the setup step is done.
docker logs -f trails

docker exec -it trails bash
# Connect to the pg server and use pg_extension database.
psql -h localhost -p 28814 -U postgres
\c pg_extension

# Run an example, wait one min, it will run filtering + refinemnt + training the selected model.
CALL model_selection_end2end('frappe_train', ARRAY['col1', 'col2', 'col3', 'col4','col5','col6','col7','col8','col9','col10', 'label'], '10', '/project/Trails/internal/ml/model_selection/config.ini');

Singa + PolarDB

# Create project folder.
mkdir project && cd project
# Download the Dockerile.
wget https://raw.githubusercontent.com/apache/singa/dev-postgresql/examples/model_selection/TRAILS-Database-Native-Model-Selection/singa.polarDB.Dockerfile


# Build Dockerile and run the docker.
docker build -t trails_polardb .
docker run -d --name trails_polardb --network="host" trails_polardb
# Monitor the logs until the setup step is done.
docker logs -f trails_polardb

docker exec -it trails_polardb bash
# Connect to the pg server and use pg_extension database.
psql -h localhost -p 5432 -U postgres 
\c pg_extension

# Run an example, wait one min, it will run filtering + refinemnt + training the selected model.
CALL model_selection_end2end('frappe_train', ARRAY['col1', 'col2', 'col3', 'col4','col5','col6','col7','col8','col9','col10', 'label'], '10', '/project/Trails/internal/ml/model_selection/config.ini');