本文整理匯總了Java中ca.pfv.spmf.algorithms.associationrules.fhsar.AlgoFHSAR類的典型用法代碼示例。如果您正苦於以下問題:Java AlgoFHSAR類的具體用法?Java AlgoFHSAR怎麽用?Java AlgoFHSAR使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AlgoFHSAR類屬於ca.pfv.spmf.algorithms.associationrules.fhsar包,在下文中一共展示了AlgoFHSAR類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: runAlgorithm
import ca.pfv.spmf.algorithms.associationrules.fhsar.AlgoFHSAR; //導入依賴的package包/類
@Override
public void runAlgorithm(String[] parameters, String inputFile, String outputFile) throws IOException {
double minsup = getParamAsDouble(parameters[0]);
double minconf = getParamAsDouble(parameters[1]);
// file for sensitive
String sarFile = parameters[2];
File file = new File(inputFile);
String sarFileFullPath;
if (file.getParent() == null) {
sarFileFullPath = sarFile;
} else {
sarFileFullPath = file.getParent() + File.separator + sarFile;
}
// STEP 1: Applying the FHSAR algorithm to hide association rules
AlgoFHSAR algorithm = new AlgoFHSAR();
algorithm.runAlgorithm(inputFile, sarFileFullPath, outputFile,
minsup, minconf);
algorithm.printStats();
}
示例2: main
import ca.pfv.spmf.algorithms.associationrules.fhsar.AlgoFHSAR; //導入依賴的package包/類
@Test
public void main() {
NoExceptionAssertion.assertDoesNotThrow(() -> {
String input = "contextIGB.txt"; // the database
String inputSAR = "sar.txt"; // the sensitive association rules that we want to hide
String output = ".//output.txt"; // the path for saving the transformed database
double minsup = 0.5;
double minconf = 0.60;
// STEP 1: Applying the FHSAR algorithm to hide association rules
AlgoFHSAR algorithm = new AlgoFHSAR();
algorithm.runAlgorithm(input, inputSAR, output, minsup, minconf);
algorithm.printStats();
});
}
示例3: main
import ca.pfv.spmf.algorithms.associationrules.fhsar.AlgoFHSAR; //導入依賴的package包/類
public static void main(String [] arg) throws IOException{
String input = fileToPath("contextIGB.txt"); // the database
String inputSAR = fileToPath("sar.txt"); // the sensitive association rules that we want to hide
String output = "C://patterns//new_database.txt"; // the path for saving the transformed database
double minsup = 0.5;
double minconf = 0.60;
// STEP 1: Applying the FHSAR algorithm to hide association rules
AlgoFHSAR algorithm = new AlgoFHSAR();
algorithm.runAlgorithm(input, inputSAR, output, minsup, minconf);
algorithm.printStats();
}