Skip to content

Commit

Permalink
Pengaroo independent dataset created using the createARFF.bash. run.v…
Browse files Browse the repository at this point in the history
…alidation2 created to test it. However, run.validation2 expects a second parameter like: weka.classifiers.trees.RandomForest
  • Loading branch information
santosardr committed Jan 15, 2023
1 parent 67f4f05 commit 37ad77e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 35 deletions.
16 changes: 16 additions & 0 deletions run.validation2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
if [ -r $1 ]
then
if [ -r /usr/local/weka/weka.jar ]
then
java -cp /usr/local/weka/weka.jar $2 -l $1 -p 0 -T validation2.arff > validation2.result
sed -i '1,5d; s/[ ]\+/ /g; s/^[ ]//g; s/[ ]$//g; s/[ ]/\t/g;${/^$/d;}' validation2.result
awk ' BEGIN{fp=0;fn=0}{ if($3~ /NON-SECRETED/) {if($1>34)fn++;} else if($3~ /SECRETED/){if($1<=34)fp++;}}END{ printf "\tFalse Positives=%d\tSpecificity=%.2f\tFalse Negatives=%d\tSensitivity=%.2f\tACC=%.2f", fp, (34-fp)/(34), fn, (34-fn)/(34), (34-fp+34-fn)/(68);}' validation2.result;echo
else
echo "Could not find /usr/local/weka/weka.jar"
fi
else
echo "Please, send me one of the training models from the current folder:"
echo "./run.validation2 bin/model-nonclassicsec-71-95.bin"
echo "./run.validation2 bin/model-nonclassicsec-76-98.bin"
fi
2 changes: 1 addition & 1 deletion src/createARFF.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ then
cat weka.attributes >> localsubcellular.arff
echo '@attribute class {SECRETED,NON-SECRETED}' >> localsubcellular.arff
echo '@data' >> localsubcellular.arff
cat wekapos.arff2 wekaneg.arff2 >> localsubcellular.arff
cat wekaneg.arff2 wekapos.arff2 >> localsubcellular.arff
rm weka*.attributes2 weka*.attributes weka*.arff2 weka*.arff neg.faa pos.faa
echo "File localsubcellular.arff for training is ready!"
echo "For testing, exchange the labels by the punctuation signal used for questions (?)"
Expand Down
Loading

0 comments on commit 37ad77e

Please sign in to comment.