@Test public void testNotEqualOtherObject() { final DataSet ds1 = generateTestData(); assertFalse(ds1.equals("")); }
@Override public boolean equals(final Object other) { if (!(other instanceof DataSet)) { return false; } final DataSet otherSet = (DataSet) other; if (getHeaderCount() != otherSet.getHeaderCount()) { return false; } if (size() != otherSet.size()) { return false; } for (int i = 0; i < getHeaderCount(); i++) { if (!this.headers[i].equals(otherSet.getHeaders()[i])) { return false; } } for (int i = 0; i < size(); i++) { final Object[] row1 = this.data.get(i); final Object[] row2 = ((DataSet) other).getData().get(i); for (int j = 0; j < getHeaderCount(); j++) { if (!row1[j].equals(row2[j])) { return false; } } } return true; }
DataSet { @Override public boolean equals(final Object other) { if (!(other instanceof DataSet)) { return false; } final DataSet otherSet = (DataSet) other; if (getHeaderCount() != otherSet.getHeaderCount()) { return false; } if (size() != otherSet.size()) { return false; } for (int i = 0; i < getHeaderCount(); i++) { if (!this.headers[i].equals(otherSet.getHeaders()[i])) { return false; } } for (int i = 0; i < size(); i++) { final Object[] row1 = this.data.get(i); final Object[] row2 = ((DataSet) other).getData().get(i); for (int j = 0; j < getHeaderCount(); j++) { if (!row1[j].equals(row2[j])) { return false; } } } return true; } }
DataSet { @Override public boolean equals(final Object other) { if (!(other instanceof DataSet)) { return false; } final DataSet otherSet = (DataSet) other; if (getHeaderCount() != otherSet.getHeaderCount()) { return false; } if (size() != otherSet.size()) { return false; } for (int i = 0; i < getHeaderCount(); i++) { if (!this.headers[i].equals(otherSet.getHeaders()[i])) { return false; } } for (int i = 0; i < size(); i++) { final Object[] row1 = this.data.get(i); final Object[] row2 = ((DataSet) other).getData().get(i); for (int j = 0; j < getHeaderCount(); j++) { if (!row1[j].equals(row2[j])) { return false; } } } return true; } DataSet(final String[] theHeaders); }
DataSet { @Override public boolean equals(final Object other) { if (!(other instanceof DataSet)) { return false; } final DataSet otherSet = (DataSet) other; if (getHeaderCount() != otherSet.getHeaderCount()) { return false; } if (size() != otherSet.size()) { return false; } for (int i = 0; i < getHeaderCount(); i++) { if (!this.headers[i].equals(otherSet.getHeaders()[i])) { return false; } } for (int i = 0; i < size(); i++) { final Object[] row1 = this.data.get(i); final Object[] row2 = ((DataSet) other).getData().get(i); for (int j = 0; j < getHeaderCount(); j++) { if (!row1[j].equals(row2[j])) { return false; } } } return true; } DataSet(final String[] theHeaders); static DataSet load(final File filename); static DataSet load(final InputStream is); static void save(final File filename, final DataSet ds); static void save(final OutputStream os, final DataSet ds); int getHeaderCount(); String[] getHeaders(); void add(final Object[] row); List<Object[]> getData(); double getMax(final int column); double getMin(final int column); void normalizeRange(final int column, final double dataLow, final double dataHigh, final double normalizedLow, final double normalizedHigh); void normalizeRange(final int column, final double normalizedLow, final double normalizedHigh); void deNormalizeRange(final int column, final double dataLow, final double dataHigh, final double normalizedLow, final double normalizedHigh); void normalizeReciprocal(final int column); void deNormalizeReciprocal(final int column); Map<String, Integer> enumerateClasses(final int column); Map<String, Integer> encodeNumeric(final int column); Map<String, Integer> encodeOneOfN(final int column); Map<String, Integer> encodeOneOfN(final int column, final double offValue, final double onValue); Map<String, Integer> encodeEquilateral(final int column); Map<String, Integer> encodeEquilateral(final int column, final double offValue, final double onValue); int size(); void appendColumns(final int count); void insertColumns(final int column, final int columnCount); @Override boolean equals(final Object other); List<BasicData> extractUnsupervisedLabeled(final int labelIndex); List<BasicData> extractSupervised(final int inputBegin, final int inputCount, final int idealBegin, final int idealCount); void deleteUnknowns(); void deleteColumn(final int col); void replaceColumn(final int columnIndex, final double searchFor, final double replaceWith, final double others); }
DataSet { @Override public boolean equals(final Object other) { if (!(other instanceof DataSet)) { return false; } final DataSet otherSet = (DataSet) other; if (getHeaderCount() != otherSet.getHeaderCount()) { return false; } if (size() != otherSet.size()) { return false; } for (int i = 0; i < getHeaderCount(); i++) { if (!this.headers[i].equals(otherSet.getHeaders()[i])) { return false; } } for (int i = 0; i < size(); i++) { final Object[] row1 = this.data.get(i); final Object[] row2 = ((DataSet) other).getData().get(i); for (int j = 0; j < getHeaderCount(); j++) { if (!row1[j].equals(row2[j])) { return false; } } } return true; } DataSet(final String[] theHeaders); static DataSet load(final File filename); static DataSet load(final InputStream is); static void save(final File filename, final DataSet ds); static void save(final OutputStream os, final DataSet ds); int getHeaderCount(); String[] getHeaders(); void add(final Object[] row); List<Object[]> getData(); double getMax(final int column); double getMin(final int column); void normalizeRange(final int column, final double dataLow, final double dataHigh, final double normalizedLow, final double normalizedHigh); void normalizeRange(final int column, final double normalizedLow, final double normalizedHigh); void deNormalizeRange(final int column, final double dataLow, final double dataHigh, final double normalizedLow, final double normalizedHigh); void normalizeReciprocal(final int column); void deNormalizeReciprocal(final int column); Map<String, Integer> enumerateClasses(final int column); Map<String, Integer> encodeNumeric(final int column); Map<String, Integer> encodeOneOfN(final int column); Map<String, Integer> encodeOneOfN(final int column, final double offValue, final double onValue); Map<String, Integer> encodeEquilateral(final int column); Map<String, Integer> encodeEquilateral(final int column, final double offValue, final double onValue); int size(); void appendColumns(final int count); void insertColumns(final int column, final int columnCount); @Override boolean equals(final Object other); List<BasicData> extractUnsupervisedLabeled(final int labelIndex); List<BasicData> extractSupervised(final int inputBegin, final int inputCount, final int idealBegin, final int idealCount); void deleteUnknowns(); void deleteColumn(final int col); void replaceColumn(final int columnIndex, final double searchFor, final double replaceWith, final double others);  }