private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { this.sourceTable = db.GetWorksheet(t.Selection); this.dgvAnalysisSource.DataSource = sourceTable; this.comboBox1.Items.Clear(); this.checkedListBox1.Items.Clear(); foreach (DataColumn col in sourceTable.Columns) { this.comboBox1.Items.Add(col.ColumnName); this.checkedListBox1.Items.Add(col.ColumnName); } this.comboBox1.SelectedIndex = 0; } } } }
/// <summary> /// Launched when the user clicks the File -> Open menu item. /// </summary> /// private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); this.dgvAnalysisSource.DataSource = tableSource; this.dgvProjectionSource.DataSource = tableSource.Copy(); double[,] graph = tableSource.ToMatrix(out columnNames); inputScatterplot.DataSource = graph; createMappingScatterplot(graphMapInput, graph); lbStatus.Text = "Now, click 'Run analysis' to start processing the data!"; } } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { this.dgvAnalysisSource.DataSource = db.GetWorksheet(t.Selection); this.dgvProjectionSource.DataSource = db.GetWorksheet(t.Selection); } } else if (extension == ".xml") { DataTable dataTableAnalysisSource = new DataTable(); dataTableAnalysisSource.ReadXml(openFileDialog.FileName); this.dgvAnalysisSource.DataSource = dataTableAnalysisSource; this.dgvProjectionSource.DataSource = dataTableAnalysisSource.Clone(); } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); double[,] sourceMatrix = tableSource.ToMatrix(out sourceColumns); // Detect the kind of problem loaded. if (sourceMatrix.GetLength(1) == 2) { MessageBox.Show("Missing class column."); } else { this.dgvLearningSource.DataSource = tableSource; this.dgvTestingSource.DataSource = tableSource.Copy(); CreateScatterplot(graphInput, sourceMatrix); } } } } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { this.sourceTable = db.GetWorksheet(t.Selection); this.dataGridView1.DataSource = sourceTable; } } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); this.dgvAnalysisSource.DataSource = tableSource; this.dgvProjectionSource.DataSource = tableSource.Copy(); double[,] graph = tableSource.ToMatrix(out sourceColumns); inputScatterplot.DataSource = graph; } } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); this.dgvLearningSource.DataSource = tableSource; this.dgvTestingSource.DataSource = tableSource.Copy(); double[,] sourceMatrix = tableSource.ToMatrix(out columnNames); CreateScatterplot(graphInput, sourceMatrix); } } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); this.dgvAnalysisSource.DataSource = tableSource; double[,] data = tableSource.ToMatrix(); var x = data.GetColumn(0); var y = data.GetColumn(1); CreateScatterplot(graphInput, x, y, null, null, null, null); } } } lbStatus.Text = "Click Compute the estimate a robust linear regression!"; }
/// <summary> /// Launched when the user clicks the File -> Open menu item. /// </summary> /// private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { this.dgvAnalysisSource.DataSource = db.GetWorksheet(t.Selection); this.dgvProjectionSource.DataSource = db.GetWorksheet(t.Selection); } } else if (extension == ".xml") { DataTable dataTableAnalysisSource = new DataTable(); dataTableAnalysisSource.ReadXml(openFileDialog.FileName); this.dgvAnalysisSource.DataSource = dataTableAnalysisSource; this.dgvProjectionSource.DataSource = dataTableAnalysisSource.Clone(); } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); this.dgvSequenceSource.DataSource = tableSource; loadTesting(tableSource); } } } }
private void MenuFileOpen_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string filename = openFileDialog.FileName; string extension = Path.GetExtension(filename); if (extension == ".xls" || extension == ".xlsx") { ExcelReader db = new ExcelReader(filename, true, false); TableSelectDialog t = new TableSelectDialog(db.GetWorksheetList()); if (t.ShowDialog(this) == DialogResult.OK) { DataTable tableSource = db.GetWorksheet(t.Selection); double[,] sourceMatrix = tableSource.ToMatrix(out columnNames); // Detect the kind of problem loaded. if (sourceMatrix.GetLength(1) == 2) { MessageBox.Show("Missing class column."); } else { this.dgvLearningSource.DataSource = tableSource; this.dgvTestingSource.DataSource = tableSource.Copy(); double[,] graph = tableSource.ToMatrix(out columnNames); graphInput.DataSource = graph; inputNames = columnNames.Submatrix(2); lbStatus.Text = "Now, click 'Run analysis' to start processing the data!"; } } } } }