Commit ea597178 authored by Tom Lampert's avatar Tom Lampert

Constraint satisfaction measure integrated into test scripts

parent 538f4e49
#!/bin/bash
subdir=$1
data_path=./datasets
test_type=test
indir=./methods/${subdir}/clusterings/constrained
indir2=./methods/${subdir}/clusterings/unconstrained
resdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
for d in ${data_path}/*/
do
dataname=`basename ${d}`
echo ${dataname}
resultdir=./methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
IN=`basename ${constraintsfilename%.*}`
arrIN=(${IN//_/ })
cnstrnt_frac=${arrIN[1]}
cnstrnt_iter=${arrIN[2]}
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
infilename=${indir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.satisfaction
if [ -f ${infilename} ]
then
echo ${infilename}
if [ ! -f ${resultfilename} ]
then
echo ${resultfilename}
python3.5 ./utils/constraint_satisfaction.py -r ${infilename} -c ${constraintsfilename} -o ${resultfilename} -i 1
fi
fi
if [ "${cnstrnt_frac}" = "0.5" ]
then
filenamepattern2=${dataname}_${test_type}_0_${cnstrnt_iter}
infilename=${indir2}/${filenamepattern2}.clustering
resultfilename=${resultdir}/${filenamepattern2}.satisfaction
if [ -f ${infilename} ]
then
echo ${infilename}
rm -f ${resultfilename}
if [ ! -f ${resultfilename} ]
then
echo ${resultfilename}
python3.5 ./utils/constraint_satisfaction.py -r ${infilename} -c ${constraintsfilename} -o ${resultfilename} -i 1
fi
fi
fi
done
for cnstrnt_frac in 0 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
if [ ! -f ${outfilename} ]
then
echo ${outfilename}
rm -f ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
fi
done
done
......@@ -28,9 +28,11 @@ COPKMeansDir=${COPKMeansBaseDir}/copkmeans
outdir=./methods/${subdir}/clusterings/constrained
resdir=./results/${subdir}/constrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${resdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -50,7 +52,9 @@ do
kvalue=`cat ${kfilename}`
resultdir=./methods/${subdir}/results/${test_type}/constrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
......@@ -66,6 +70,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
initialclusterfilename=${COPKMeansBaseDir}/clusterings/unconstrained/${filenamepattern}.clustering
if [ ! -f ${resultfilename} ]
......@@ -76,14 +81,15 @@ do
if [ "${pre_cluster}" == "1" ]
then
python methods/${subdir}/bin/cccg-seed.py -d ${datafilename} -k ${kvalue} --consfile=${constraintsfilename} -c 1 -t 9999999 -copdir ${COPKMeansDir} -f ${nfeatures} -p ${distance_metric} --ofile=${outfilename} --distfile=${distancefilename} --l=1
python methods/${subdir}/bin/cccg-seed.py -d ${datafilename} -k ${kvalue} --consfile=${constraintsfilename} -c 1 -t 9999999 -copdir ${COPKMeansDir} -f ${nfeatures} -p ${distance_metric} --ofile=${outfilename} --distfile=${distancefilename} --l=1
else
python methods/${subdir}/bin/cccg-seed.py -d ${datafilename} -k ${kvalue} --consfile=${constraintsfilename} -c 1 -t 9999999 -copdir ${COPKMeansDir} -f ${nfeatures} -p ${distance_metric} --ofile=${outfilename} --distfile=${distancefilename} --l=1 --init=-1
fi
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
} &
......@@ -94,10 +100,14 @@ do
for cnstrnt_frac in 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
resoutfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satoutfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${resoutfilename}
rm -f ${satoutfilename}
rm -f ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satoutfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
done
done
\ No newline at end of file
......@@ -26,9 +26,11 @@ COPKMeansDir=${COPKMeansBaseDir}/copkmeans
outdir=./methods/${subdir}/clusterings/unconstrained
resdir=./results/${subdir}/unconstrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -48,7 +50,9 @@ do
kvalue=`cat ${kfilename}`
resultdir=./methods/${subdir}/results/${test_type}/unconstrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for (( i=1; i<=10; i++ ))
do
......@@ -62,6 +66,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
initialclusterfilename=${COPKMeansBaseDir}/clusterings/unconstrained/${filenamepattern}.clustering
if [ ! -f ${resultfilename} ]
......@@ -80,6 +85,9 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
constraintsfilename=${data_path}/${dataname}/${test_type}/${dataname}_${test_type}_0.5_${cnstrnt_iter}.constraints
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
} &
......@@ -90,9 +98,12 @@ do
for cnstrnt_frac in 0
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${outfilename}
rm -f ${satfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satfilename}
done
done
\ No newline at end of file
......@@ -21,9 +21,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/constrained
resdir=./results/${subdir}/constrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${resdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -43,7 +45,9 @@ do
kvalue=`cat ${kfilename}`
resultdir=./methods/${subdir}/results/${test_type}/constrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
......@@ -60,6 +64,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
if [ ! -f ${resultfilename} ]
then
......@@ -72,6 +77,7 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -83,10 +89,14 @@ do
for cnstrnt_frac in 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
resoutfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satoutfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${resoutfilename}
rm -f ${satoutfilename}
rm -f ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satoutfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
done
done
\ No newline at end of file
......@@ -21,9 +21,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/unconstrained
resdir=./results/${subdir}/unconstrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -43,7 +45,9 @@ do
kvalue=`cat ${kfilename}`
resultdir=./methods/${subdir}/results/${test_type}/unconstrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for (( i=1; i<=10; i++ ))
do
......@@ -57,6 +61,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
constraintsfilename=-1
......@@ -71,6 +76,9 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
constraintsfilename=${data_path}/${dataname}/${test_type}/${dataname}_${test_type}_0.5_${cnstrnt_iter}.constraints
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -82,9 +90,12 @@ do
for cnstrnt_frac in 0
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${outfilename}
rm -f ${satfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satfilename}
done
done
\ No newline at end of file
......@@ -23,9 +23,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/constrained
resdir=./results/${subdir}/constrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${outdir}
mkdir -p ${resdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -76,7 +78,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/constrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
......@@ -94,6 +98,7 @@ do
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
if [ ! -f ${resultfilename} ]
then
......@@ -106,6 +111,7 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -117,11 +123,14 @@ do
for cnstrnt_frac in 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
rm -f ${outfilename}
resoutfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satoutfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${resoutfilename}
rm -f ${satoutfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satoutfilename}
done
done
\ No newline at end of file
......@@ -23,9 +23,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/unconstrained
resdir=./results/${subdir}/unconstrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -79,7 +81,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/unconstrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for (( i=1; i<=10; i++ ))
do
......@@ -94,6 +98,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
constraintsfilename=-1
......@@ -108,6 +113,9 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
constraintsfilename=${data_path}/${dataname}/${test_type}/${dataname}_${test_type}_0.5_${cnstrnt_iter}.constraints
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -120,9 +128,12 @@ do
for cnstrnt_frac in 0
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${outfilename}
rm -f ${satfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satfilename}
done
done
\ No newline at end of file
......@@ -21,9 +21,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/constrained
resdir=./results/${subdir}/constrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${resdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -42,7 +44,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/constrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
......@@ -58,6 +62,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
if [ ! -f ${resultfilename} ]
then
......@@ -70,6 +75,7 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -81,10 +87,14 @@ do
for cnstrnt_frac in 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
resoutfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satoutfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${resoutfilename}
rm -f ${satoutfilename}
rm -f ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satoutfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
done
done
\ No newline at end of file
......@@ -21,9 +21,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/unconstrained
resdir=./results/${subdir}/unconstrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -42,7 +44,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/unconstrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for (( i=1; i<=10; i++ ))
do
......@@ -55,6 +59,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
constraintsfilename=-1
......@@ -69,6 +74,9 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
constraintsfilename=${data_path}/${dataname}/${test_type}/${dataname}_${test_type}_0.5_${cnstrnt_iter}.constraints
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -80,9 +88,12 @@ do
for cnstrnt_frac in 0
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${outfilename}
rm -f ${satfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satfilename}
done
done
\ No newline at end of file
......@@ -23,9 +23,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/constrained
resdir=./results/${subdir}/constrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${outdir}
mkdir -p ${resdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -76,7 +78,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/constrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
......@@ -93,6 +97,7 @@ do
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
if [ ! -f ${resultfilename} ]
then
......@@ -105,6 +110,7 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -116,10 +122,14 @@ do
for cnstrnt_frac in 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
#rm -f ${outfilename}
resoutfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satoutfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${resoutfilename}
rm -f ${satoutfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satoutfilename}
done
done
\ No newline at end of file
......@@ -23,9 +23,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/unconstrained
resdir=./results/${subdir}/unconstrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -79,7 +81,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./${subdir}/results/${test_type}/unconstrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for (( i=1; i<=10; i++ ))
do
......@@ -93,6 +97,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
constraintsfilename=-1
......@@ -107,6 +112,9 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
constraintsfilename=${data_path}/${dataname}/${test_type}/${dataname}_${test_type}_0.5_${cnstrnt_iter}.constraints
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -118,9 +126,12 @@ do
for cnstrnt_frac in 0
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${outfilename}
rm -f ${satfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satfilename}
done
done
\ No newline at end of file
......@@ -23,9 +23,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/constrained
resdir=./results/${subdir}/constrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${outdir}
mkdir -p ${resider}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -77,7 +79,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/constrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for constraintsfilename in $(find ${data_path}/${dataname}/${test_type} -name '*.constraints')
do
......@@ -93,6 +97,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
if [ ! -f ${resultfilename} ]
then
......@@ -105,6 +110,7 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
......@@ -117,9 +123,13 @@ do
for cnstrnt_frac in 0.05 0.1 0.15 0.5
do
outfilename=${resdir}/${dataname}_${test_type}_${cnstrnt_frac}.results
satoutfilename=${satdir}/${dataname}_${test_type}_${cnstrnt_frac}.satisfaction
rm -f ${outfilename}
rm -f ${satoutfilename}
Rscript --vanilla ./utils/summarise_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${outfilename}
Rscript --vanilla ./utils/summarise_satisfaction_results.R ${resultdir} ${dataname} ${test_type} ${cnstrnt_frac} ${satoutfilename}
done
done
\ No newline at end of file
......@@ -22,9 +22,11 @@ test_type=test
outdir=./methods/${subdir}/clusterings/unconstrained
resdir=./results/${subdir}/unconstrained
satdir=./constraint_satisfaction/${subdir}
mkdir -p ${resdir}
mkdir -p ${outdir}
mkdir -p ${satdir}
for d in ${data_path}/*/
do
......@@ -78,7 +80,9 @@ do
labelsfilename=${data_path}/${dataname}/${test_type}/${dataname}.labels
resultdir=./methods/${subdir}/results/${test_type}/unconstrained
satisfactiondir=/methods/${subdir}/constraint_satisfaction/${test_type}
mkdir -p ${resultdir}
mkdir -p ${satisfactiondir}
for (( i=1; i<=10; i++ ))
do
......@@ -91,6 +95,7 @@ do
filenamepattern=${dataname}_${test_type}_${cnstrnt_frac}_${cnstrnt_iter}
outfilename=${outdir}/${filenamepattern}.clustering
resultfilename=${resultdir}/${filenamepattern}.results
satisfactionfilename=${satisfactiondir}/${filenamepattern}.satisfaction
constraintsfilename=-1
......@@ -105,6 +110,9 @@ do
if [ -f ${outfilename} ]
then
Rscript --vanilla ./utils/cluster_index.R ${labelsfilename} ${outfilename} ${resultfilename}
constraintsfilename=${data_path}/${dataname}/${test_type}/${dataname}_${test_type}_0.5_${cnstrnt_iter}.constraints
python ./utils/constraint_satisfaction.py -r ${outfilename} -c ${constraintsfilename} -o ${satisfactionfilename} -i 1
fi
fi
} &