예제 #1
0
파일: main.go 프로젝트: shuLhan/wvcgen
/*
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
파일: main.go 프로젝트: shuLhan/wvcgen
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)
}