public override IEnumerable <SuggestedTransform> Apply(IntermediateColumn[] columns, TaskKind task) { var newColumns = new List <string>(); foreach (var column in columns) { if (!column.Type.GetItemType().IsBool() || column.Purpose != ColumnPurpose.NumericFeature) { continue; } newColumns.Add(column.ColumnName); } if (newColumns.Count() > 0) { var newColumnsArr = newColumns.ToArray(); yield return(TypeConvertingExtension.CreateSuggestedTransform(Context, newColumnsArr, newColumnsArr)); } }
public override IEnumerable <SuggestedTransform> Apply(IntermediateColumn[] columns, TaskKind task) { var columnsWithMissing = new List <string>(); foreach (var column in columns) { if (column.Type.GetItemType() == NumberDataViewType.Single && column.Purpose == ColumnPurpose.NumericFeature && column.Dimensions.HasMissing == true) { columnsWithMissing.Add(column.ColumnName); } } if (columnsWithMissing.Any()) { var columnsArr = columnsWithMissing.ToArray(); var indicatorColNames = GetNewColumnNames(columnsArr.Select(c => $"{c}_MissingIndicator"), columns).ToArray(); yield return(MissingValueIndicatingExtension.CreateSuggestedTransform(Context, columnsArr, indicatorColNames)); yield return(TypeConvertingExtension.CreateSuggestedTransform(Context, indicatorColNames, indicatorColNames)); yield return(MissingValueReplacingExtension.CreateSuggestedTransform(Context, columnsArr, columnsArr)); } }