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!"; }
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") { var db = new ExcelReader(filename, true, false); var 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(); scatterplotView1.DataSource = sourceMatrix; } } } } lbStatus.Text = "Switch to the Machine Creation tab to create a learning machine!"; }
/// <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.ToArray(out columnNames); // TODO: Rename this ToArray to ToJagged 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) { DataTable tableSource = db.GetWorksheet(t.Selection); this.dgvLearningSource.DataSource = tableSource; this.dgvTestingSource.DataSource = tableSource.Copy(); CreateScatterplot(graphInput, tableSource.ToJagged(out columnNames)); } } } }
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(); CreateScatterplot(graphInput, sourceMatrix); } } } } lbStatus.Text = "When ready, click 'Create Tree' to start the tree inducing algorithm!"; }
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(); graphInput.DataSource = sourceMatrix; // enable "Start" button startButton.Enabled = true; } } } } }
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(); CreateScatterplot(graphInput, sourceMatrix); } } } } lbStatus.Text = "Switch to the Machine Creation tab to create a learning machine!"; }