Skip to content

Commit

Permalink
set_env
Browse files Browse the repository at this point in the history
  • Loading branch information
minafarid committed Nov 9, 2018
1 parent cd2820c commit d37d8af
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,5 @@ See the code in `tests/test_holoclean.py` for a documented usage of HoloClean.
In order to run the test script, run the following:
```bash
$ cd tests
$ python test_holoclean.py
$ ./start_test.sh
```
8 changes: 8 additions & 0 deletions set_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

export HOLOCLEANHOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Holoclean home directory: $HOLOCLEANHOME"
export PYTHONPATH="$PYTHONPATH:$HOLOCLEANHOME"
export PATH="$PATH:$HOLOCLEANHOME"
echo $PATH
echo "Environment variables set!"
2 changes: 1 addition & 1 deletion tests/start_test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set & move to home directory
# source ../set_env.sh
source ../set_env.sh

# Launch test.
echo "Launching test..."
Expand Down
25 changes: 9 additions & 16 deletions tests/test_holoclean.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import sys

sys.path.insert(0, '..')

import holoclean

from detect import NullDetector, ViolationDetector
Expand All @@ -14,18 +10,6 @@
from repair.featurize import LangModelFeat


def get_tid(row):
return row['tid'] - 1


def get_attr(row):
return row['attribute'].lower()


def get_value(row):
return row['correct_val'].lower()


# 1. Setup a HoloClean session.
hc = holoclean.HoloClean(pruning_topk=0.1, epochs=30, weight_decay=0.01, threads=20, batch_size=1, verbose=True, timeout=3*60000).session

Expand All @@ -44,4 +28,13 @@ def get_value(row):
hc.repair_errors(featurizers)

# 5. Evaluate the correctness of the results.
def get_tid(row):
return row['tid'] - 1

def get_attr(row):
return row['attribute'].lower()

def get_value(row):
return row['correct_val'].lower()

hc.evaluate('data', 'hospital_clean.csv', get_tid, get_attr, get_value)

0 comments on commit d37d8af

Please sign in to comment.