Пример #1
0
/*
getAsInputColumn return feature values as in input column.
*/
func getAsInputColumn(reader *wvcgen.Reader, colName string,
	ftrValues *tabula.Dataset,
) {
	ds := reader.GetDataset().(tabula.DatasetInterface)
	ftr := ds.GetColumnByName(colName)

	if ftr == nil {
		return
	}

	// Add column in input as feature
	ftrValues.PushColumn(*ftr)
}
Пример #2
0
func runFeature(reader *wvcgen.Reader, ftrValues *tabula.Dataset,
	md dsv.Metadata,
) {
	defer un(trace(">>> computing feature " + md.Name))

	ftr := feature.GetByName(md.Name)

	// No feature name found, search the column name in
	// input metadata.
	if ftr == nil {
		getAsInputColumn(reader, md.Name, ftrValues)
		return
	}

	ds := reader.GetDataset().(tabula.DatasetInterface)
	ftr.Compute(ds)

	col := ftr.Interface().(*tabula.Column)

	ftrValues.PushColumn(*col)
}