CyDAS Home funded by   Sponsor: DFG
CyDASMining Documentation Class Miner Class Evolution Tree Documentation Section HowTo Section Online Analysis Section Download Section Resources Section About Section

DependenceViewer

The Dependence Viewer is user control for the visualisation of dependence between events. A number of the most common events is displayed as buttons on a panel, the dependence between the events is visualised by blue and red lines, blue indication positive dependence, red negative dependence, and thicker lines representing more reliable dependence.
The user can adjust the number of events and their minimum reliability (chi-square) on trackbars. By selecting an event, more information on the respective event is shown in the info panel. By select a line between two events, more information on both events and their connections is shown.

Mor information on the internal calculations in the DependenceViewer control and its use is provided in the section "Internal calculations"; the calculation of the data behind the scene is described in the "significant combinations" section of the Miner.

Overview

DependenceViewer
New()
MinimumHeight: Integer {read-only}
MinimumWidth: Integer {read-only}
getMiner(): Miner
setMiner(ByRef NewMiner: Miner): void
calculateNetwork(): void
circularArrange(): void
getBitmap(): Bitmap
setDependenceRange(Minmum: Integer, Maximum: Integer): void
setEventRange(Minmum: Integer, Maximum: Integer): void
setStartEventCount(NewValue: Integer): void
setStartDependence(NewValue: Integer): void

Programming Language

Availability

Constructors

Public Sub New()

Instantiates a new Dependence Viewer.

Parameters

Remarks

Interfaces

This class does not implement an interface.

Enumerations

The class does not provide enumerations.

Properties

Apart from the properties inherited from System.Windows.Forms.UserControl, two properties are available:

Public ReadOnly Property MinimumHeight() As Integer

Gets the minimum height required by the DependenceViewer control.

Property Value

Remarks

Public ReadOnly Property MinimumWidth() As Integer

Gets the minimum width required by the DependenceViewer control.

Property Value

Remarks

Methods

Apart from the methods inherited from System.Windows.Forms.UserControl , the following methods were implemented:

Public Sub getMiner() As Miner

Returns the Miner object associated with the DependenceViewer .

Return Value

Parameters

Remarks

Public Sub setMiner(ByRef NewMiner As Miner)

Associates a  Miner object with the DependenceViewer .

Return Value

Parameters

Remarks

Public Sub calculateNetwork()

Calculates the dependence network with the data obtained from the Miner.

Return Value

Parameter

Remarks

Public Sub circularArrange()

Arranges the events in a circular fashion on the viewing panel.

Return Value

Parameter

Remarks

Public Function getBitmap() As Bitmap

Returns a bitmap with the events and their dependence as shown in the viewer.

Return Value

Parameter

Remarks

Public Sub setDependenceRange(ByVal Minimum As Integer, ByVal Maximum As Integer)

Sets the range for the trackbar which is used for adjusting the minimum value of an event dependence to be displayed.

Return Value

Parameter

Remarks

Public Sub setEventRange(ByVal Minimum As Integer, ByVal Maximum As Integer)

Sets the range for the trackbar which is used for adjusting the number of events to be displayed.

Return Value

Parameter

Remarks

Public Sub setStartEventCount(ByVal NewValue As Integer)

Sets the number of events to be displayed when the dependence network is calculated for the first time.

Return Value

Parameter

Remarks

Public Sub setStartDependence(ByVal NewValue As Double)

Sets the reliability / strength of event dependences to be displayed when the dependence network is calculated for the first time.

Return Value

Parameter

Remarks

Interaction with other classes

Classes using DependenceViewer

The DependenceViewer class is a top level class and not used by other classes of the Mining library.

Classes used by DependenceViewer

The DependenceViewer relies on the data supplied via the Miner object.

Interal Calculations

General Use

If you want to use the DependenceViewer in your project, the steps will typically be:

Calculating the Network

In the Miner object, cases and events are counted and significant combinations of events are determined.

The private function calculateEventButtons (which also reacts on changing the trackbar for the number of events) fills the event buttons collection with the appropriate events. It searches through all events for the next most frequent event. If such an event was encountered, a button is instantiated for it which gets tagged with the index of the event. It is placed randomly onto the dependence panel.

After the calculation of the event buttons, the lines representing the dependence of two events are determined with the private function calculateDependenceLines. For every possible combination of two buttons (events), an EventDependence object is instantiated if the chi-square value meets the minimum value. The private position calculateDependencePositions calculates for every EventDependence object the start and end positions of the lines which are then shown by the refresh function of the viewer (i.e. they are drawn in pnlView_Paint).

Reacting on the Selection of a Dependence Line

When the user clicks somewhere onto the viewer, the pnlView.MouseUp handler looks if a line was hit allowing for some deviation. It iterates through the collection of EventDependences and checks if the point clicked can be found in the rectangle described by its start and end posotions. If so, it checks if the angle from the start point to the clicked point coincides with the angle from the start point to the end point. If so, the private function EventDependenceClick is called with the respective EventDependence as a parameter.

The latter function retrieves data on the events from the miner and shows them on the info panel.

Private Class EventDependence

The EventDependence class is used for the storage of data on a specific combination of two events. It does not contain an actual business logic. It is defined by the properties showing both events (their indices) and the properties showing start and end point of the dependence line, and finally the strength (chi-square) of the dependence.