The Complete SPRLIB & ANNLIB
subspace_dataset
- create a new dataset from another dataset with a higher dimension
SYNOPSIS
| DATASET *subspace_dataset |
(dset, m, subdim) |
ARGUMENTS
DATASET | *dset | A pointer to the original DATASET structure. |
double | **m | A matrix containing the subspace projection. |
int | subdim | The dimension of the dataset to be created. |
The matrix **m should have dimensions [1..subdim][1..dset->NumInputs].
RETURNS
A pointer to a newly allocated and filled DATASET if succesful, NULL otherwise.
FUNCTION
The function first checks if subdim is less than or equal to dset 's NumInputs.
If so, a dataset structure is allocated using malloc_dataset and filled.
Most fields (including input and output descriptions)
are copied from dset; SetText however is set to "Set obtained
by projection of other data.", the CreationDate is set using the time_stamp
function and NumInputs is set to subdim. Also, the SetId is increased by
one.
Finally, all SAMPLE structures are copied. Each element of a
sample's input vector Input is taken as a linear combination of all inputs,
in which the coefficients are given in **m :
for (i = 1; i <= subdim; i++)
{
NewSample->Input[i] = 0;
for (j = 1; j <= dset->NumInputs; j++)
{
NewSample->Input[i] += m[i][j] * InSample->Input[j];
}
}
The output patterns are simply copied.
This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998