8000 Dockerfile partial dependence plot by dsta-siminong · Pull Request #353 · aiverify-foundation/aiverify · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dockerfile partial dependence plot #353

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

Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM python:3.11-slim

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y git gcc

# Install HDF5 using apt
RUN apt-get update && apt-get install -y libhdf5-dev pkg-config

RUN pip install --upgrade pip
RUN pip install --no-binary h5py h5py

WORKDIR /app/aiverify

# Copy test engine core folder to install requirements; in future we can install the test-engine-core pypi package
COPY aiverify-test-engine ./aiverify-test-engine

# Copy sample data to run pytest
COPY stock-plugins/user_defined_files ./stock-plugins/user_defined_files

# Copy algorithm folder
COPY stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot ./stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot

# Install algorithm requirements
WORKDIR /app/aiverify/stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot
RUN pip install pytest
RUN pip install -e '.[dev]'

ENTRYPOINT ["python3", "-m", "aiverify_partial_dependence_plot"]

Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,39 @@ Run the following steps to execute the unit and integration tests inside the `te
cd aiverify/stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot/
pytest .
```

## Run using Docker
In the aiverify root directory, run the below command to build the docker image
```sh
docker build -t aiverify-partial-dependence-plot:v2.0.0a1 -f stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot/Dockerfile .
```

Switch to the algorithm directory
```sh
cd stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot/
```

Run the below bash script to run the algorithm
```sh
#!/bin/bash

root_path="<PATH_TO_FOLDER>/aiverify/stock-plugins/user_defined_files"
docker run \
-v $root_path:/user_defined_files \
-v ./output:/app/aiverify/stock-plugins/aiverify.stock.partial-dependence-plot/algorithms/partial_dependence_plot/output \
aiverify-partial-dependence-plot:v2.0.0a1 \
--data_path /user_defined_files/data/sample_bc_credit_data.sav \
--model_path /user_defined_files/model/sample_bc_credit_sklearn_linear.LogisticRegression.sav \
--ground_truth_path /user_defined_files/data/sample_bc_credit_data.sav \
--ground_truth default \
--model_type REGRESSION \
--no-run_pipeline
```
If the algorithm runs successfully, the results of the test will be saved in an `output` folder in the algorithm directory.

## Tests
### Pytest is used as the testing framework.
Run the following steps to execute the unit and integration tests inside the `tests/` folder
```sh
docker run --entrypoint python3 aiverify-partial-dependence-plot:v2.0.0a1 -m pytest .
```
0