class: MBAForm

public class: MBAForm
Author: Petra Vanícková
Project: Phase: 1.0; Status: Proposed; Version: 1.0; Complexity: 1
Dates: Created: 5.12.2005 0:39:20; Modified: 10.12.2005 23:02:31;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {BC38BCE2-7A9F-4d42-AA08-9AD6E691A99E}
class containing MBA Algorythm

 

Goto: Fields, Methods

See also: FrontOfSets, FrontOfSets, FTree, FChart, DBDataAdmin, DataSrc

Appears in: CD MarketBasketAnalysis

Connections
 
MBAForm Attributes
Attribute Details
private DBDataAdmin
  dbAdmin
private int
  TransCount
Notes: number of transactions = number of rows

private double
  MinSupp
Notes: current minimal support used in algorithm

private double
  MinConf
Notes: current minimal confidence used in algorithm

private bool
  VisSetName
Notes: flag which determines if set description is visible directly in tree form

private bool
  VisSetCode
Notes: flag which determines if set code is visible directly in tree form

private bool
  VisSupport
Notes: flag which determines if set support is visible directly in tree form

private bool
  VisIsLargeSet
Notes: flag which determines if set state(=large/small) is visible directly in tree form

private bool
  VisOccurence
Notes: flag which determines if number of occurences of the set is visible directly in tree form

private bool
  VisTransaction
Notes: flag which determines if number of all rows is visible directly in tree form

private bool
  ShowAllNodes
Notes: flag which determines if both small and large sets are visible directly in tree form

private int
  ColumnCount
Notes: number of columns in db table

private System.ComponentModel.IContainer
  components
Notes: components of the form

private int
  transformId
Notes: ID of MBA transformation, get from MBAMain class.

private int
  selectedVersion
Notes: Keeps ID of version which data are currently used for algorithm.

private FrontOfSets
  frequentedSets
Notes: Main structure which keeps large sets.

private FrontOfSets
  candidateSets
Notes: Auxiliary structure which keeps candidates for being large set.

private FTree
  treeForm
Notes: Formm which contains TreeControl object and displays tree of large sets.

private FChart
  chartForm
Notes: Form which contains chart of large sets.

private DataSrc
  MyDsrc
Notes: DataSource reached from dbAdmin after loading data.

private System.Windows.Forms.DataGridTableStyle
  dataGridTableStyle2
Notes: Style of result grid table.

private System.Windows.Forms.DataGridTextBoxColumn
  ColVyslPrst
Notes: Style of column Confidence in result grid.

private System.Windows.Forms.DataGrid
  GResult
Notes: Grid which shows result rules.

private GuiExt.TextBoxDouble
  TBSupp
Notes: Text box which is used for setting of minimal support.

private GuiExt.TextBoxDouble
  TBConf
Notes: Text box which is used for setting of minimal confidence.

private System.Windows.Forms.Label
  label1
private System.Windows.Forms.Label
  label2
private System.Windows.Forms.MainMenu
  mainMenu1
private System.Windows.Forms.ToolBar
  toolBar1
private System.Windows.Forms.ImageList
  imageList1
private System.Windows.Forms.ToolBarButton
  tbRun
private System.Windows.Forms.ToolBarButton
  tbStep
private System.Windows.Forms.ToolBarButton
  tbRestart
private System.Windows.Forms.ToolBarButton
  tbLoadSetup
private System.Windows.Forms.ToolBarButton
  tbLoadData
private System.Windows.Forms.DataGridTextBoxColumn
  ColRule
Notes: Style of column Rules in result grid.

private System.Windows.Forms.ToolBarButton
  tbTree
private System.Windows.Forms.MenuItem
  menuItem1
private System.Windows.Forms.MenuItem
  menuItem3
private System.Windows.Forms.MenuItem
  menuItem5
private System.Windows.Forms.MenuItem
  menuItem15
private System.Windows.Forms.MenuItem
  menuItem21
private System.Windows.Forms.ToolBarButton
  tbChart
private System.Windows.Forms.ToolBarButton
  tbSaveSetup
private System.Windows.Forms.ToolBarButton
  tbSaveData
private System.Windows.Forms.MenuItem
  mILoadConfiguration
private System.Windows.Forms.MenuItem
  mICloseForm
private System.Windows.Forms.MenuItem
  mIRun
private System.Windows.Forms.MenuItem
  mIStep
private System.Windows.Forms.MenuItem
  mIRestart
private System.Windows.Forms.MenuItem
  mIShowTree
private System.Windows.Forms.MenuItem
  mIShowGraph
private System.Windows.Forms.DataGrid
  dataGrid1
private System.Windows.Forms.Label
  label3
private System.Windows.Forms.Label
  label4
private System.Windows.Forms.MenuItem
  mILoadData
private System.Windows.Forms.MenuItem
  mISaveData
private System.Windows.Forms.MenuItem
  mISetName
private System.Windows.Forms.MenuItem
  mISetCode
private System.Windows.Forms.MenuItem
  mISupport
private System.Windows.Forms.MenuItem
  mIIsLargeSet
private System.Windows.Forms.MenuItem
  mIOccurence
private System.Windows.Forms.MenuItem
  mITransaction
private System.Windows.Forms.Panel
  panel1
private System.Windows.Forms.MenuItem
  menuItem2
private System.Windows.Forms.MenuItem
  mIShowAllNodes
private DasNetBarChart.FlatBarChart.BarChartItem
  barItem
 
MBAForm Methods
Operation Details
public
MBAForm(
   DBDataAdmin dbDataAdmin,
   DMTransformStruct.OneTransform ot):
Notes: initializes connection to db, constructor for treeForm,chartForm and fronts of sets sets default parameters and tries load parameters from xml file and set default flags
protected
Dispose(
   bool disposing):void
Tags: override=true
Notes: Clean up any resources being used.
private
InitializeComponent():void
Notes: Required method for Designer support - do not modify the contents of this method with the code editor.
private
MakeNamesTable():DataTable
Notes: Creates data table for result grid.

@returns new DataTable with appropriate structure
private
addLine(
   String s,
   String newS):void
Notes: Used for adding new line into tree caption.
private
CountConfidence(
   SetCode CodeOfLeft,
   SetCode CodeOfWhole):double
Notes: Counts confidence of rule CodeOfLeft->(CodeOfWhole \ CodeOfLeft)= Code of right. That confidence is equal to # occureneces of whole/ # occurences of left part of rule.

@returns confidence of rule or -1
private
GenerateSubsets(
   SetCode CodeOfLeft,
   SetCode CodeOfRight,
   int ItemCount,
   DataTable MyTable):void
Notes: Recursively generates rules from large sets. It takes one member from right side and puts it to the left side.
private
NextStep():bool
Notes: Takes one set from repository of large sets and creates new candidates, tests candidates, adds the set to the chart form and tree form.

@returns returns if next step is possible
private
TBSupp_Leave(
   object sender,
   System.EventArgs e):void
Notes: Method which checks parameters after textbox for support is left.
private
InitFrontWithOneMemember():bool
Notes: Inserts into frequentedSets enough supported single-member sets.

@returns whether initialization was successful
private
TBConf_Leave(
   object sender,
   System.EventArgs e):void
Notes: Method which checks parameters after textbox for confidence is left.
private
ShowResult():void
Notes: Second part of MBA algorithm, generates rules from large sets and shows result in result grid.
private
RunStep():void
Notes: Trigger procedure for next step of algorithm.
private
RunWhole():void
Notes: Trigger procedure for whole algorithm.
private
AlgorithmRestart():void
Notes: Trigger procedure for algorithm restart.
private
ShowTree():void
Notes: Trigger procedure for tree form displaying.
private
ShowGraph():void
Notes: Trigger procedure for chart form displaying.
private
SaveConfiguration():void
Notes: Trigger procedure for configuration saving.
private
LoadConfiguration():void
Notes: Trigger procedure for loading of configuration.
private
CheckDataFormat(
   DataSet mujDS):bool
Notes: Checks if data table contains just 0 and 1.

@returns whether data are in correct format
private
LoadData():void
Notes: Opens dialog for loading of data.
private
SaveData():void
Notes: Saves data from result table to database.
private
mILoadConfiguration_Click(
   object sender,
   System.EventArgs e):void
private
mISaveConfiguration(
   object sender,
   System.EventArgs e):void
private
CheckParemeters():bool
Notes: Checks whether parameters filled into textboxes are correct or not.

@returns Result of checking.
private
mIClose(
   object sender,
   System.EventArgs e):void
private
mIRun_Click(
   object sender,
   System.EventArgs e):void
private
mIStep_Click(
   object sender,
   System.EventArgs e):void
private
mIRestart_Click(
   object sender,
   System.EventArgs e):void
private
mIShowTree_Click(
   object sender,
   System.EventArgs e):void
private
mIShowGraph_Click(
   object sender,
   System.EventArgs e):void
private
mILoadData_Click(
   object sender,
   System.EventArgs e):void
private
mISaveData_Click(
   object sender,
   System.EventArgs e):void
private
mItem_Click(
   object sender):void
private
mISetName_Click(
   object sender,
   System.EventArgs e):void
private
mISetCode_Click(
   object sender,
   System.EventArgs e):void
private
mISupport_Click(
   object sender,
   System.EventArgs e):void
private
mIIsLargeSet_Click(
   object sender,
   System.EventArgs e):void
private
mIOccurence_Click(
   object sender,
   System.EventArgs e):void
private
mITransaction_Click(
   object sender,
   System.EventArgs e):void
private
mIShowAllNodes_Click(
   object sender,
   System.EventArgs e):void
private
toolBar1_ButtonClick(
   object sender,
   System.Windows.Forms.ToolBarButtonClickEventArgs e):void
Notes: Procedure which recognizes which toolbar button was pressed.
private
MBAForm_Closing(
   object sender,
   System.ComponentModel.CancelEventArgs e):void
Notes: Final action after this form is closed. It disposes MyDsrc object.