MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / getTwiceShallowClone

Method getTwiceShallowClone

JSAT/src/jsat/DataSet.java:780–790  ·  view source on GitHub ↗

Returns a new version of this data set that is of the same type, and contains a different listing pointing to shallow data point copies. Because the data point object contains the weight itself, the weight is not shared - while the vector and array information is. This allows altering the weights of

()

Source from the content-addressed store, hash-verified

778 * @return a shallow copy of shallow data point copies for this data set.
779 */
780 public DataSet getTwiceShallowClone()
781 {
782 DataSet clone = shallowClone();
783 for(int i = 0; i < clone.getSampleSize(); i++)
784 {
785 DataPoint d = getDataPoint(i);
786 DataPoint sd = new DataPoint(d.getNumericalValues(), d.getCategoricalValues(), d.getCategoricalData());
787 clone.setDataPoint(i, sd);
788 }
789 return clone;
790 }
791
792 /**
793 * Returns statistics on the sparsity of the vectors in this data set.

Callers 3

testCluster_WeightedMethod · 0.45
testCluster_WeightedMethod · 0.45
testCluster_WeightedMethod · 0.45

Calls 7

shallowCloneMethod · 0.95
getSampleSizeMethod · 0.95
getDataPointMethod · 0.95
getNumericalValuesMethod · 0.95
getCategoricalValuesMethod · 0.95
getCategoricalDataMethod · 0.95
setDataPointMethod · 0.95

Tested by 3

testCluster_WeightedMethod · 0.36
testCluster_WeightedMethod · 0.36
testCluster_WeightedMethod · 0.36