TMtx ZScore(TMtx Src)
Transforms matrix into matrix of standardized data.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtx | source TMtx |
Result: stored in self (calling object), returns self for chaining
Remarks:
The routine uses Data matrix and transforms it into ZScore matrix of standardized data (the so called Z Scores). The standardization of each column (variable) is made by subtracting its mean and dividing by its standard deviation:
Z(Column) = (Column - Mean(Column))/StdDev(Column)
Examples
TMtx Data;
Res TMtx;
Data = TMtx.Create;
Res = TMtx.Create;
try
{
Data.SetIt(3,3,false,[1,2,3,
4,5,6,
7,100,12]);
Res.ZScore(Data);
// result = (-1 -0,604 -0,873,
// 0 -0,55 -0,218
// 1 1,154 1,091)
}
finally
{
Data.Free;
Res.Free;
}