SampleSet<T>

References
public sealed class SampleSet<T> : ISampleSet
Represents an immutable data set of n-dimensional samples.
TSample type.

Constructors

SampleSet

#
public SampleSet(int dimensionality, ProjectItem<T> project, IEnumerable<T> samples)
Create a new sample set.
dimensionality (int)Dimensionality of set.
project (ProjectItem<T>)Projection delegate.
samples (IEnumerable<T>)Initial samples, if any.

SampleSet

#
public SampleSet(int dimensionality, ProjectItem<T> project)
Create a new, empty sample set.
dimensionality (int)Dimensionality of set.
project (ProjectItem<T>)Projection delegate.

Properties

Coordinates

#
public IEnumerator<PointN> Coordinates { get; }
Enumerate over all sample coordinates.
Coordinates

Count

#
public int Count { get; }
Gets the number of datum items in this set.
Count

Description

#
public string Description { get; }
Gets a description of this object type.
Description

Dimensionality

#
public int Dimensionality { get; }
Gets the dimensionality of the data set.
Dimensionality
Explicit

ISampleSet.Samples

#
Enumerate over all samples.
Samples

ProjectionDelegate

#
public ProjectItem<T> ProjectionDelegate { get; }
Gets the projection delegate.

Samples

#
public IEnumerable<T> Samples { get; }
Enumerate over all samples.

Indexers

Explicit

ISampleSet.this[]

#
object ISampleSet.this[int index]
Gets the item at the given index.
index (int)Index of item to retrieve.
Item at index.
this[]

this[]

#
public T this[int index] { get; }
Gets the item at the given index.
index (int)Index of item to retrieve.
Item at index.

Methods

AddRange

#
public SampleSet<T> AddRange(IEnumerable<T> items)
Grow this sample set.
items (IEnumerable<T>)Items to add.
Modified sample set.

ComputeAxisDomain

#
public bool ComputeAxisDomain(int axis, int[] indices, out double min, out double mean, out double max)
Compute the domain and average of all samples along some axis.
axis (int)Axis to measure.
indices (int[])Indices to measure.
min (out double)Lowest value will be returned here.
mean (out double)Average (mean) value will be returned here.
max (out double)Highest value will be returned here.
True on success, false on failure. This method only returns false if the set is empty.
ComputeAxisDomain

ComputeAxisDomain

#
public bool ComputeAxisDomain(int axis, out double min, out double mean, out double max)
Compute the domain and average of all samples along some axis.
axis (int)Axis to measure.
min (out double)Lowest value will be returned here.
mean (out double)Average (mean) value will be returned here.
max (out double)Highest value will be returned here.
True on success, false on failure. This method only returns false if the set is empty.
ComputeAxisDomain

ComputeAxisMean

#
public double ComputeAxisMean(int axis, int maxSamples, int[] indices)
Compute the exact or estimated mean for this set.
axis (int)Spatial axis.
maxSamples (int)Maximum number of samples to take into account. If this limit is less than the total number of potential samples, the resulting mean will be an estimate.
indices (int[])Set of sample indices to take into account.
Computed mean along given axis.
ComputeAxisMean

ComputeAxisMean

#
public double ComputeAxisMean(int axis, int maxSamples)
Compute the exact or estimated mean for this set.
axis (int)Spatial axis.
maxSamples (int)Maximum number of samples to take into account. If this limit is less than the total number of potential samples, the resulting mean will be an estimate.
Computed mean along given axis.
ComputeAxisMean

ComputeBoundingBox

#
public BoxN ComputeBoundingBox()
Compute the bounding box for all items.
ComputeBoundingBox

ComputeBoundingBox

#
public BoxN ComputeBoundingBox(IEnumerable<int> indices)
Compute the bounding box for a subset of samples.
indices (IEnumerable<int>)Indices to include.
Bounding box.
ComputeBoundingBox

ComputeKdTree

#
public KdTree ComputeKdTree()
Compute the k-d tree associated with this sample set. Once a k-d tree has been computed, additional calls to this method will return the cached version.
k-d tree or null if this sampling set is empty.
ComputeKdTree

ComputeKdTree

#
public KdTree ComputeKdTree(int divisionThreshold, int maximumLeafCount)
Compute a k-d tree with custom settings. This kd-tree is not cached, so if you need it more than once you should cache it yourself.
divisionThreshold (int)Maximum number of samples per spatial region.
maximumLeafCount (int)Maximum number of regions to create. Leaves up to the nearest, larger power of two may actually be created.
Custom k-d tree.

ComputeKMeansClusters

#
public KMeansCluster[] ComputeKMeansClusters(int count, KMeansIteration callback)
Compute a distribution of k-means clusters.
count (int)Number of clusters to compute.
callback (KMeansIteration)Callback method.
Array of clusters.

ComputeKMeansClusters

#
public KMeansCluster[] ComputeKMeansClusters(int count)
Compute a distribution of k-means clusters.
count (int)Number of clusters to compute.
Array of clusters.

ComputeKMeansClusters

#
public KMeansCluster[] ComputeKMeansClusters(PointN[] initialMeans, KMeansIteration callback)
Compute a distribution of k-means clusters.
initialMeans (PointN[])Number of clusters to compute.
callback (KMeansIteration)Callback method.
Array of clusters.

ComputeKMeansClusters

#
public KMeansCluster[] ComputeKMeansClusters(PointN[] initialMeans)
Compute a distribution of k-means clusters.
initialMeans (PointN[])Number of clusters to compute.
Array of clusters.

ComputeMean

#
public PointN ComputeMean()
Compute the exact or estimated mean for this set.
Computed mean.
ComputeMean

ComputeMean

#
public PointN ComputeMean(int maxSamples, int[] indices)
Compute the exact or estimated mean for this set.
maxSamples (int)Maximum number of samples to actually use.
indices (int[])Set of sample indices to take into account.
Computed mean.
ComputeMean

ComputeMean

#
public PointN ComputeMean(int[] indices)
Compute the exact mean for this set.
indices (int[])Set of sample indices to take into account.
Computed mean.
ComputeMean

DistributePoints

#
public PointN[] DistributePoints(int count, bool limitToSet)
Randomly distribute N points within the space. This method performs pretty poorly when 'count' is large.
count (int)Number of points to distribute.
limitToSet (bool)If true, distributed points are constrainted to the existing point set.
Array of randomly distributed points.
DistributePoints
Explicit

ISampleSet.NormaliseProjection

#
ISampleSet ISampleSet.NormaliseProjection()
Normalise the entire projection to the unit hypercube.
Explicit

ISampleSet.NormaliseProjection

#
ISampleSet ISampleSet.NormaliseProjection(double min, double max)
Normalise the entire projection to a hypercube in a specific domain.
min (double)Hypercube domain start.
max (double)Hypercube domain end.
Explicit

ISampleSet.NormaliseProjection

#
ISampleSet ISampleSet.NormaliseProjection(double size)
Normalise the entire projection to a hypercube of a specific size.
size (double)Edge length of hypercube.

NormaliseProjection

#
public SampleSet<T> NormaliseProjection()
Normalise the entire projection to the unit hypercube.

NormaliseProjection

#
public SampleSet<T> NormaliseProjection(double min, double max)
Normalise the entire projection to a hypercube in a specific domain.
min (double)Hypercube domain start.
max (double)Hypercube domain end.

NormaliseProjection

#
public SampleSet<T> NormaliseProjection(double size)
Normalise the entire projection to a hypercube of a specific size.
size (double)Edge length of hypercube.

Point

#
public PointN Point(int index)
Gets the point associated with the given index.
index (int)Index.
Point associated with index.
Point

Points

#
public PointN[] Points(int[] indices)
Get an array of points.
indices (int[])Point indices to retrieve.
Array of points.
Points

ToPointSet

#
public SampleSet<PointN> ToPointSet()
Convert this sample set to a PointN set.
PointN set.