data.java
来自「神经网络源代码,实现了一个BP神经网络,可以完成基于BP的神经网络算法.」· Java 代码 · 共 92 行
JAVA
92 行
package net.openai.ai.nn.parser;import java.util.*;public class Data { // the column names for this data private Vector columnNames = null; // rows of data private Vector rows = null; public Data() { columnNames = new Vector(); rows = new Vector(); } /** * Get the column names for this data. * * @return Vector List of column names for the data. */ public Vector getColumnNames() { return columnNames; } /** * Set the column names for this data. * * @param columnNames The list of column names for this data. */ public void setColumnNames(Vector columnNames) { if(columnNames != null) this.columnNames = columnNames; } /** * Add a column name to the list. * * @param columnName The name to add to the columns name list. */ public void addColumnName(String columnName) { if(columnName != null) columnNames.addElement(columnName); } /** * Get the rows of data. * * @return Vector The rows of data. */ public Vector getRows() { return rows; } /** * Set the rows of data. * * @param rows The rows of data to be set. */ public void setRows(Vector rows) { if(rows != null) this.rows = rows; } /** * Add a single row of data. * * @param row The row of data to add. */ public void addRow(Vector row) { if(row != null) rows.addElement(row); } /** * Returns a String of the columns and the data. * * @return String String representation of this object. */ public String toString() { String data = columnNames.toString() + "\n"; int size = rows.size(); for(int i = 0; i < size; i++) { Vector row = (Vector) rows.elementAt(i); data += row.toString() + "\n"; } return data; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?