// deriveLabel set derived label FieldDesc information back to the original IR structure.
deriveLabel set derived label FieldDesc information back to the original IR structure.
// deriveLabel set derived label FieldDesc information back to the original IR structure .
func deriveLabel(trainStmt *TrainStmt, fmMap FieldDescMap) error {
	labelName := trainStmt.Label.GetFieldDesc()[0].Name
	if labelName == "" {
		return nil 
	}
	if fmMap[labelName] == nil {
		return fmt.Errorf("deriveLabel: LABEL COLUMN '%s' not found", labelName)
	}
	trainStmt.Label = &NumericColumn{
		FieldDesc: fmMap[labelName],
	}
	shape := trainStmt.Label.GetFieldDesc()[0].Shape
	if len(shape) == 1 && shape[0] == 1 {
		trainStmt.Label.GetFieldDesc()[0].Shape = []int{}
	}
	return nil
}
func deriveLabel ( trainStmt * TrainStmt , fmMap FieldDescMap ) error { labelName := trainStmt . Label . GetFieldDesc ( ) [ 0 ] . Name if labelName == " " { return nil } if fmMap [ labelName ] == nil { return fmt . Errorf ( " " , labelName ) } trainStmt . Label = & NumericColumn { FieldDesc : fmMap [ labelName ] , } shape := trainStmt . Label . GetFieldDesc ( ) [ 0 ] . Shape if len ( shape ) == 1 && shape [ 0 ] == 1 { trainStmt . Label . GetFieldDesc ( ) [ 0 ] . Shape = [ ] int { } } return nil }
deriveLabel set derived label FieldDesc information back to the original IR structure.
deriveLabel set derived label FieldDesc information back to the original IR structure .
// NOTE: clustering model may not specify Label // use shape [] if label shape is [1] for Tensorflow scalar label shape should be [].