protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var info = new Schema.DetachedColumn[_parent.Outputs.Length]; for (int i = 0; i < _parent.Outputs.Length; i++) info[i] = new Schema.DetachedColumn(_parent.Outputs[i], _parent.OutputTypes[i], null); return info; }
private protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var infos = new Schema.DetachedColumn[2]; infos[L1Col] = new Schema.DetachedColumn(L1, NumberType.R8, null); infos[L2Col] = new Schema.DetachedColumn(L2, NumberType.R8, null); return(infos); }
public override Schema.DetachedColumn[] GetOutputColumns() { var infos = new Schema.DetachedColumn[2]; infos[L1Col] = new Schema.DetachedColumn(L1, NumberType.R8, null); infos[L2Col] = new Schema.DetachedColumn(L2, NumberType.R8, null); return(infos); }
public Schema.DetachedColumn[] GetOutputColumns() { var meta = new MetadataBuilder(); meta.AddSlotNames(_parent._outputLength, GetSlotNames); var info = new Schema.DetachedColumn[1]; info[0] = new Schema.DetachedColumn(_parent.OutputColumnName, new VectorType(NumberType.R8, _parent._outputLength), meta.GetMetadata()); return(info); }
private protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var infos = new Schema.DetachedColumn[5]; infos[LabelOutput] = new Schema.DetachedColumn(LabelCol, _labelType, _labelMetadata); infos[ScoreOutput] = new Schema.DetachedColumn(ScoreCol, _scoreType, _scoreMetadata); infos[L1Output] = new Schema.DetachedColumn(L1, NumberType.R8, null); infos[L2Output] = new Schema.DetachedColumn(L2, NumberType.R8, null); infos[DistCol] = new Schema.DetachedColumn(Dist, NumberType.R8, null); return(infos); }
protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var result = new Schema.DetachedColumn[_parent.ColumnPairs.Length]; for (int i = 0; i < _parent.ColumnPairs.Length; i++) { InputSchema.TryGetColumnIndex(_parent.ColumnPairs[i].input, out int colIndex); Host.Assert(colIndex >= 0); result[i] = new Schema.DetachedColumn(_parent.ColumnPairs[i].output, _types[i], null); } return result; }
protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var result = new Schema.DetachedColumn[_parent.ColumnPairs.Length]; for (int i = 0; i < _parent.ColumnPairs.Length; i++) { var builder = new MetadataBuilder(); builder.Add(InputSchema[ColMapNewToOld[i]].Metadata, x => x == MetadataUtils.Kinds.KeyValues || x == MetadataUtils.Kinds.IsNormalized); result[i] = new Schema.DetachedColumn(_parent.ColumnPairs[i].outputColumnName, _types[i], builder.GetMetadata()); } return(result); }
protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var result = new Schema.DetachedColumn[_parent.ColumnPairs.Length]; for (int i = 0; i < _parent.ColumnPairs.Length; i++) { var meta = new MetadataBuilder(); meta.Add(InputSchema[ColMapNewToOld[i]].Metadata, name => name == MetadataUtils.Kinds.SlotNames); result[i] = new Schema.DetachedColumn(_parent.ColumnPairs[i].output, _types[i], meta.GetMetadata()); } return(result); }
protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var result = new Schema.DetachedColumn[_parent.ColumnPairs.Length]; for (int i = 0; i < _parent.ColumnPairs.Length; i++) { var builder = new MetadataBuilder(); AddMetadata(i, builder); result[i] = new Schema.DetachedColumn(_parent.ColumnPairs[i].output, _type, builder.GetMetadata()); } return(result); }
/// <summary> /// For PCA, the transform equation is y=U^Tx, where "^T" denotes matrix transpose, x is an 1-D vector (i.e., the input column), and U=[u_1, ..., u_PcaNum] /// is a n-by-PcaNum matrix. The symbol u_k is the k-th largest (in terms of the associated eigenvalue) eigenvector of (1/m)*\sum_{i=1}^m x_ix_i^T, /// where x_i is the whitened column at the i-th row and we have m rows in the training data. /// For ZCA, the transform equation is y = US^{-1/2}U^Tx, where U=[u_1, ..., u_n] (we retain all eigenvectors) and S is a diagonal matrix whose i-th /// diagonal element is the eigenvalues of u_i. The first U^Tx rotates x to another linear space (bases are u_1, ..., u_n), then S^{-1/2} is applied /// to ensure unit variance, and finally we rotate the scaled result back to the original space using U (note that UU^T is identity matrix so U is /// the inverse rotation of U^T). /// </summary> protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var result = new Schema.DetachedColumn[_parent.ColumnPairs.Length]; for (int iinfo = 0; iinfo < _parent.ColumnPairs.Length; iinfo++) { InputSchema.TryGetColumnIndex(_parent.ColumnPairs[iinfo].input, out int colIndex); Host.Assert(colIndex >= 0); var info = _parent._columns[iinfo]; ColumnType outType = (info.Kind == WhiteningKind.Pca && info.PcaNum > 0) ? new VectorType(NumberType.Float, info.PcaNum) : _srcTypes[iinfo]; result[iinfo] = new Schema.DetachedColumn(_parent.ColumnPairs[iinfo].output, outType, null); } return(result); }
internal static Schema.DetachedColumn[] GetSchemaColumns(InternalSchemaDefinition schemaDefn) { Contracts.AssertValue(schemaDefn); var columns = new Schema.DetachedColumn[schemaDefn.Columns.Length]; for (int i = 0; i < columns.Length; i++) { var col = schemaDefn.Columns[i]; var meta = new MetadataBuilder(); foreach (var kvp in col.Metadata) { meta.Add(kvp.Value.Kind, kvp.Value.MetadataType, kvp.Value.GetGetterDelegate()); } columns[i] = new Schema.DetachedColumn(col.ColumnName, col.ColumnType, meta.GetMetadata()); } return(columns); }
protected override Schema.DetachedColumn[] GetOutputColumnsCore() { var result = new Schema.DetachedColumn[_parent.ColumnPairs.Length]; for (int iinfo = 0; iinfo < _infos.Length; iinfo++) { InputSchema.TryGetColumnIndex(_infos[iinfo].Input, out int colIndex); Host.Assert(colIndex >= 0); var builder = new MetadataBuilder(); builder.Add(InputSchema[colIndex].Metadata, x => x == MetadataUtils.Kinds.SlotNames); ValueGetter <bool> getter = (ref bool dst) => { dst = true; }; builder.Add(MetadataUtils.Kinds.IsNormalized, BoolType.Instance, getter); result[iinfo] = new Schema.DetachedColumn(_infos[iinfo].Output, _infos[iinfo].OutputType, builder.GetMetadata()); } return(result); }
public override Schema.DetachedColumn[] GetOutputColumns() { var infos = new Schema.DetachedColumn[3]; infos[ClusterIdCol] = new Schema.DetachedColumn(ClusterId, _types[ClusterIdCol], null); var slotNamesType = new VectorType(TextType.Instance, _numClusters); var sortedClusters = new MetadataBuilder(); sortedClusters.AddSlotNames(slotNamesType.VectorSize, CreateSlotNamesGetter(_numClusters, "Cluster")); var builder = new MetadataBuilder(); builder.AddSlotNames(slotNamesType.VectorSize, CreateSlotNamesGetter(_numClusters, "Score")); infos[SortedClusterCol] = new Schema.DetachedColumn(SortedClusters, _types[SortedClusterCol], sortedClusters.GetMetadata()); infos[SortedClusterScoreCol] = new Schema.DetachedColumn(SortedClusterScores, _types[SortedClusterScoreCol], builder.GetMetadata()); return(infos); }