Example A: Uniform distributions

Generate data from two uniform classes

Number of points in each class

n1 = 100 ; n2 = 100 ;

Generate data

data1 = Table[{ru2[{pr[[1, 1]], 0}], ru2[pr[[2]]]}, {n1}] ; data2 = Table[{ru2[{0, pr[[1, 2]]}], ru2[pr[[2]]]}, {n2}] ;

Visualize data

gd1 = PlotData2D[data1, pr, style1, nS] ; gd2 = PlotData2D[data2, pr, style2, nS] ; gd = Show[gd1, gd2, yS, FrameTicksNone] ;

[Graphics:../HTMLFiles/index_7.gif]

Uniform quantization

Number of centroids in each direction

nCentroids = 4 ;

Compute uniformly distributed centroids

uniformCentroids = UniformQuantization[pr[[1]], pr[[2]], nCentroids] ;

Visualize data

gCentroids = PlotData2D[uniformCentroids, pr, centroidStyle, FrameTicksNone] ;

[Graphics:../HTMLFiles/index_11.gif]

Histograms for two classes

Compute histograms based on uniform centroids

h1 = Histogram[data1, uniformCentroids, pr, 50] ; h2 = Histogram[data2, uniformCentroids, pr, 50] ;

Visualize two histograms

gh1 = DrawHistogram[h1, pr, nS, AxesFalse] ; gh2 = DrawHistogram[h2, pr, nS, AxesFalse] ; Show[GraphicsArray[{gh1, gh2}], yS, imSize] ;

[Graphics:../HTMLFiles/index_14.gif]

Classification of input space

gdnoFrame = Show[gd, FrameFalse, nS] ; gclass = DrawHistogramClass[{h1, h2}, {class1Color, class2Color}, nS] ; Show[GraphicsArray[{gdnoFrame, gclass}], yS, imSize] ;

[Graphics:../HTMLFiles/index_16.gif]


Created by Mathematica  (October 9, 2003)