Changeset 9318 for branches/HeuristicLab.Analysis.AlgorithmBehavior
- Timestamp:
- 03/18/13 13:39:56 (12 years ago)
- Location:
- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/StatisticalTestingView.cs
r9317 r9318 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.Linq; 25 26 using System.Windows.Forms; … … 159 160 private void normalDistButton_Click(object sender, EventArgs e) { 160 161 162 double val; 163 List<double> res = new List<double>(); 164 for (int i = 0; i < data.Length; i++) { 165 alglib.jarqueberatest(data[i], data[i].Length, out val); 166 res.Add(val); 167 } 168 169 for (int i = 0; i < res.Count(); i++) { 170 if (res[i] < 0.1) { 171 stringConvertibleMatrixView.DataGridView.Columns[i].DefaultCellStyle.ForeColor = Color.Red; 172 } else { 173 stringConvertibleMatrixView.DataGridView.Columns[i].DefaultCellStyle.ForeColor = Color.Green; 174 } 175 } 161 176 } 162 177 … … 168 183 RebuildDataTable(); 169 184 } 185 186 private void normalityDetails_Click(object sender, EventArgs e) { 187 DoubleMatrix pValsMatrix = new DoubleMatrix(1, stringConvertibleMatrixView.Content.Columns); 188 pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames; 189 pValsMatrix.RowNames = new string[] { "p-Values" }; 190 191 double val; 192 for (int i = 0; i < data.Length; i++) { 193 alglib.jarqueberatest(data[i], data[i].Length, out val); 194 pValsMatrix[0, i] = val; 195 } 196 197 MainFormManager.MainForm.ShowContent(pValsMatrix); 198 } 199 200 private void pairwiseTestButton_Click(object sender, EventArgs e) { 201 var selectedCells = stringConvertibleMatrixView.DataGridView.SelectedCells; 202 if (selectedCells.Count < 1) { 203 MessageBox.Show("Please selected one cell/column for pairwise comparision. ", "HeuristicLab", MessageBoxButtons.OK, MessageBoxIcon.Error); 204 return; 205 } 206 207 int colIndex = selectedCells[0].ColumnIndex; 208 foreach (DataGridViewCell selC in selectedCells) { 209 if (colIndex != selC.ColumnIndex) { 210 MessageBox.Show("Please selected only one column for pairwise comparision. ", "HeuristicLab", MessageBoxButtons.OK, MessageBoxIcon.Error); 211 return; 212 } 213 } 214 215 DoubleMatrix pValsMatrix = new DoubleMatrix(1, stringConvertibleMatrixView.Content.Columns); 216 pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames; 217 pValsMatrix.RowNames = new string[] { "p-Values" }; 218 219 double bothtails; 220 double lefttail; 221 double righttail; 222 for (int i = 0; i < data.Length; i++) { 223 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out bothtails, out lefttail, out righttail); 224 pValsMatrix[0, i] = bothtails; 225 } 226 227 MainFormManager.MainForm.ShowContent(pValsMatrix); 228 } 229 230 private void infoLabel_DoubleClick(object sender, EventArgs e) { 231 using (TextDialog dialog = new TextDialog("Description of statistical tests", toolTip1.GetToolTip(this.infoLabel), true)) { 232 dialog.ShowDialog(this); 233 } 234 } 170 235 } 171 236 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/StatisticalTestingView.designer.cs
r9317 r9318 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.stringConvertibleMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView(); 48 49 this.groupByLabel = new System.Windows.Forms.Label(); … … 54 55 this.pValTextBox = new System.Windows.Forms.TextBox(); 55 56 this.groupComboBox = new System.Windows.Forms.ComboBox(); 57 this.normalityDetails = new System.Windows.Forms.Button(); 58 this.pairwiseTestButton = new System.Windows.Forms.Button(); 59 this.infoLabel = new System.Windows.Forms.Label(); 60 this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); 61 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 62 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 63 this.splitContainer1.Panel1.SuspendLayout(); 64 this.splitContainer1.Panel2.SuspendLayout(); 65 this.splitContainer1.SuspendLayout(); 56 66 this.SuspendLayout(); 57 67 // 58 68 // stringConvertibleMatrixView 59 69 // 60 this.stringConvertibleMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 61 | System.Windows.Forms.AnchorStyles.Left) 70 this.stringConvertibleMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 71 | System.Windows.Forms.AnchorStyles.Left) 62 72 | System.Windows.Forms.AnchorStyles.Right))); 63 73 this.stringConvertibleMatrixView.Caption = "StringConvertibleMatrix View"; 64 74 this.stringConvertibleMatrixView.Content = null; 65 this.stringConvertibleMatrixView.Location = new System.Drawing.Point(3, 3 0);75 this.stringConvertibleMatrixView.Location = new System.Drawing.Point(3, 38); 66 76 this.stringConvertibleMatrixView.Name = "stringConvertibleMatrixView"; 67 77 this.stringConvertibleMatrixView.ReadOnly = false; 68 this.stringConvertibleMatrixView.ShowRowsAndColumnsTextBox = true;78 this.stringConvertibleMatrixView.ShowRowsAndColumnsTextBox = false; 69 79 this.stringConvertibleMatrixView.ShowStatisticalInformation = true; 70 this.stringConvertibleMatrixView.Size = new System.Drawing.Size(918, 43 8);80 this.stringConvertibleMatrixView.Size = new System.Drawing.Size(918, 430); 71 81 this.stringConvertibleMatrixView.TabIndex = 0; 72 82 // … … 74 84 // 75 85 this.groupByLabel.AutoSize = true; 76 this.groupByLabel.Location = new System.Drawing.Point( 400, 6);86 this.groupByLabel.Location = new System.Drawing.Point(3, 6); 77 87 this.groupByLabel.Name = "groupByLabel"; 78 88 this.groupByLabel.Size = new System.Drawing.Size(53, 13); … … 83 93 // 84 94 this.label1.AutoSize = true; 85 this.label1.Location = new System.Drawing.Point( 5, 6);95 this.label1.Location = new System.Drawing.Point(3, 6); 86 96 this.label1.Name = "label1"; 87 97 this.label1.Size = new System.Drawing.Size(40, 13); … … 91 101 // resultComboBox 92 102 // 103 this.resultComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 104 | System.Windows.Forms.AnchorStyles.Right))); 93 105 this.resultComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 94 106 this.resultComboBox.FormattingEnabled = true; 95 this.resultComboBox.Location = new System.Drawing.Point( 71, 3);107 this.resultComboBox.Location = new System.Drawing.Point(49, 3); 96 108 this.resultComboBox.Name = "resultComboBox"; 97 this.resultComboBox.Size = new System.Drawing.Size(3 23, 21);109 this.resultComboBox.Size = new System.Drawing.Size(393, 21); 98 110 this.resultComboBox.TabIndex = 5; 99 111 this.resultComboBox.SelectedValueChanged += new System.EventHandler(this.resultComboBox_SelectedValueChanged); … … 102 114 // 103 115 this.testButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 104 this.testButton.Location = new System.Drawing.Point(6 41, 473);116 this.testButton.Location = new System.Drawing.Point(610, 473); 105 117 this.testButton.Name = "testButton"; 106 118 this.testButton.Size = new System.Drawing.Size(109, 23); … … 125 137 this.lblPVal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 126 138 this.lblPVal.AutoSize = true; 127 this.lblPVal.Location = new System.Drawing.Point(7 56, 478);139 this.lblPVal.Location = new System.Drawing.Point(725, 478); 128 140 this.lblPVal.Name = "lblPVal"; 129 141 this.lblPVal.Size = new System.Drawing.Size(46, 13); … … 134 146 // 135 147 this.pValTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 136 this.pValTextBox.Location = new System.Drawing.Point( 808, 475);148 this.pValTextBox.Location = new System.Drawing.Point(777, 475); 137 149 this.pValTextBox.Name = "pValTextBox"; 138 this.pValTextBox.Size = new System.Drawing.Size(1 16, 20);150 this.pValTextBox.Size = new System.Drawing.Size(144, 20); 139 151 this.pValTextBox.TabIndex = 13; 140 152 // 141 153 // groupComboBox 142 154 // 155 this.groupComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 156 | System.Windows.Forms.AnchorStyles.Right))); 143 157 this.groupComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 144 158 this.groupComboBox.FormattingEnabled = true; 145 this.groupComboBox.Location = new System.Drawing.Point( 459, 3);159 this.groupComboBox.Location = new System.Drawing.Point(62, 3); 146 160 this.groupComboBox.Name = "groupComboBox"; 147 this.groupComboBox.Size = new System.Drawing.Size( 462, 21);161 this.groupComboBox.Size = new System.Drawing.Size(377, 21); 148 162 this.groupComboBox.TabIndex = 14; 149 163 this.groupComboBox.SelectedValueChanged += new System.EventHandler(this.groupComboBox_SelectedValueChanged); 150 164 // 165 // normalityDetails 166 // 167 this.normalityDetails.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 168 this.normalityDetails.Location = new System.Drawing.Point(169, 473); 169 this.normalityDetails.Name = "normalityDetails"; 170 this.normalityDetails.Size = new System.Drawing.Size(144, 23); 171 this.normalityDetails.TabIndex = 15; 172 this.normalityDetails.Text = "Show details"; 173 this.normalityDetails.UseVisualStyleBackColor = true; 174 this.normalityDetails.Click += new System.EventHandler(this.normalityDetails_Click); 175 // 176 // pairwiseTestButton 177 // 178 this.pairwiseTestButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 179 this.pairwiseTestButton.Location = new System.Drawing.Point(472, 472); 180 this.pairwiseTestButton.Name = "pairwiseTestButton"; 181 this.pairwiseTestButton.Size = new System.Drawing.Size(132, 23); 182 this.pairwiseTestButton.TabIndex = 16; 183 this.pairwiseTestButton.Text = "Pairwise comparision"; 184 this.pairwiseTestButton.UseVisualStyleBackColor = true; 185 this.pairwiseTestButton.Click += new System.EventHandler(this.pairwiseTestButton_Click); 186 // 187 // infoLabel 188 // 189 this.infoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 190 this.infoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information; 191 this.infoLabel.Location = new System.Drawing.Point(905, 6); 192 this.infoLabel.Name = "infoLabel"; 193 this.infoLabel.Size = new System.Drawing.Size(16, 16); 194 this.infoLabel.TabIndex = 17; 195 this.toolTip1.SetToolTip(this.infoLabel, "TODO: Description of features and used methods"); 196 this.infoLabel.DoubleClick += new System.EventHandler(this.infoLabel_DoubleClick); 197 // 198 // splitContainer1 199 // 200 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 201 | System.Windows.Forms.AnchorStyles.Right))); 202 this.splitContainer1.Location = new System.Drawing.Point(8, 3); 203 this.splitContainer1.Name = "splitContainer1"; 204 // 205 // splitContainer1.Panel1 206 // 207 this.splitContainer1.Panel1.Controls.Add(this.resultComboBox); 208 this.splitContainer1.Panel1.Controls.Add(this.label1); 209 // 210 // splitContainer1.Panel2 211 // 212 this.splitContainer1.Panel2.Controls.Add(this.groupByLabel); 213 this.splitContainer1.Panel2.Controls.Add(this.groupComboBox); 214 this.splitContainer1.Size = new System.Drawing.Size(891, 29); 215 this.splitContainer1.SplitterDistance = 445; 216 this.splitContainer1.TabIndex = 18; 217 // 151 218 // StatisticalTestingView 152 219 // 153 this.Controls.Add(this.groupComboBox); 220 this.Controls.Add(this.splitContainer1); 221 this.Controls.Add(this.infoLabel); 222 this.Controls.Add(this.pairwiseTestButton); 223 this.Controls.Add(this.normalityDetails); 154 224 this.Controls.Add(this.pValTextBox); 155 225 this.Controls.Add(this.lblPVal); 156 226 this.Controls.Add(this.normalDistButton); 157 227 this.Controls.Add(this.testButton); 158 this.Controls.Add(this.groupByLabel);159 this.Controls.Add(this.label1);160 this.Controls.Add(this.resultComboBox);161 228 this.Controls.Add(this.stringConvertibleMatrixView); 162 229 this.Name = "StatisticalTestingView"; 163 230 this.Size = new System.Drawing.Size(924, 500); 231 this.splitContainer1.Panel1.ResumeLayout(false); 232 this.splitContainer1.Panel1.PerformLayout(); 233 this.splitContainer1.Panel2.ResumeLayout(false); 234 this.splitContainer1.Panel2.PerformLayout(); 235 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 236 this.splitContainer1.ResumeLayout(false); 164 237 this.ResumeLayout(false); 165 238 this.PerformLayout(); … … 177 250 private System.Windows.Forms.TextBox pValTextBox; 178 251 private System.Windows.Forms.ComboBox groupComboBox; 252 private System.Windows.Forms.Button normalityDetails; 253 private System.Windows.Forms.Button pairwiseTestButton; 254 private System.Windows.Forms.Label infoLabel; 255 private System.Windows.Forms.ToolTip toolTip1; 256 private System.Windows.Forms.SplitContainer splitContainer1; 179 257 } 180 258 }
Note: See TracChangeset
for help on using the changeset viewer.