Skip to content
Closed
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ SeparatorDialog.9=Error
StatisticsView.0=Distribution
StatisticsView.1=Contingency
StatisticsView.2=Properties
StatisticsView.3=Enable/disable
StatisticsView.3=Enable/disable visualization
StatisticsView.13=Enable/disable suppressed records
StatisticsView.4=Distribution (table)
StatisticsView.5=Contingency (table)
StatisticsView.6=Summary statistics
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.deidentifier.arx.gui.view.impl.common.async;

import org.deidentifier.arx.aggregates.StatisticsFrequencyDistribution;

/**
* The current context.
*
Expand All @@ -38,4 +40,12 @@ public interface AnalysisContextVisualization {
* @return
*/
public boolean isValid();

/**
* Hide suppressed records.
*
* @param distribution
* @return
*/
public void hideSuppressedData(StatisticsFrequencyDistribution distribution) throws InterruptedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.deidentifier.arx.gui.view.impl.risk;

import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.aggregates.StatisticsFrequencyDistribution;
import org.deidentifier.arx.gui.model.Model;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContext;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContextVisualization;
Expand Down Expand Up @@ -68,4 +69,11 @@ public boolean isValid(){
else if (this.model == null) return false;
else return true;
}

@Override
public void
hideSuppressedData(StatisticsFrequencyDistribution distribution) throws InterruptedException {
// TODO Auto-generated method stub
//Empty by design
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.deidentifier.arx.gui.view.impl.utility;

import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.aggregates.StatisticsFrequencyDistribution;
import org.deidentifier.arx.gui.model.Model;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContext;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContextVisualization;
Expand Down Expand Up @@ -67,4 +68,12 @@ public boolean isValid(){
else if (this.model.getSelectedFeatures().isEmpty()) return false;
else return true;
}

@Override
public void
hideSuppressedData(StatisticsFrequencyDistribution distribution) throws InterruptedException {
// TODO Auto-generated method stub
// Empty by design

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.deidentifier.arx.AttributeType;
import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.DataType;
import org.deidentifier.arx.aggregates.StatisticsFrequencyDistribution;
import org.deidentifier.arx.gui.model.Model;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContext;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContextVisualization;
Expand Down Expand Up @@ -105,4 +106,11 @@ public boolean isValid(){
else if (this.attributeType2 == null) return false;
else return true;
}

@Override
public void
hideSuppressedData(StatisticsFrequencyDistribution distribution) throws InterruptedException {
// TODO Auto-generated method stub
//Empty by design
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@

package org.deidentifier.arx.gui.view.impl.utility;

import java.util.ArrayList;

import org.deidentifier.arx.AttributeType;
import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.DataType;
import org.deidentifier.arx.AttributeType.Hierarchy;
import org.deidentifier.arx.aggregates.StatisticsBuilderInterruptible;
import org.deidentifier.arx.aggregates.StatisticsFrequencyDistribution;
import org.deidentifier.arx.gui.model.Model;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContext;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContextVisualization;
Expand All @@ -32,13 +37,13 @@
public class AnalysisContextDistribution implements AnalysisContextVisualization{

/** Context information. */
public String attribute = null;
public String attribute = null;

/** Context information. */
public DataType<?> dataType = null;
public DataType<?> dataType = null;

/** Context information. */
public AttributeType attributeType = null;
public AttributeType attributeType = null;

/** Context information. */
public DataHandle handle = null;
Expand All @@ -47,8 +52,14 @@ public class AnalysisContextDistribution implements AnalysisContextVisualization
public Model model = null;

/** Context information. */
public AnalysisContext context = null;
public AnalysisContext context = null;

/** Context distribution. */
public String [] newDistValues = null;

/** Context distribution. */
public double [] newDistFreqs = null;

/**
* Creates a new context from the given context.
*
Expand Down Expand Up @@ -86,4 +97,33 @@ public boolean isValid(){
else if (this.attributeType == null) return false;
else return true;
}

/**
* Hide suppressed records.
*
* @param distribution
* @throws InterruptedException
*/
public void hideSuppressedData( StatisticsFrequencyDistribution distribution) throws InterruptedException {

ArrayList <String> newValues = new ArrayList<String>();
for (String s: distribution.values) {
newValues.add(s);
}
double srSum = 0.0;
int sr=newValues.indexOf("*");
newValues.removeIf(element-> (element=="*"));

for (int i = 0; i<distribution.frequency.length; i++)
if (i==sr) srSum = distribution.frequency[i] / newValues.size();

this.newDistValues = new String [newValues.size()];
this.newDistFreqs = new double [newValues.size()];

for (int i=0; i < newValues.size(); i++) {
this.newDistValues[i] = newValues.get(i);
this.newDistFreqs [i] = distribution.frequency[i] + srSum;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.deidentifier.arx.gui.view.impl.utility;

import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.aggregates.StatisticsFrequencyDistribution;
import org.deidentifier.arx.gui.model.Model;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContext;
import org.deidentifier.arx.gui.view.impl.common.async.AnalysisContextVisualization;
Expand Down Expand Up @@ -64,4 +65,11 @@ public boolean isValid(){
else if (this.model == null) return false;
else return true;
}

@Override
public void hideSuppressedData(StatisticsFrequencyDistribution distribution) throws InterruptedException {
// TODO Auto-generated method stub
// Empty by design

}
}
Loading