@@ -108,30 +108,6 @@ public T[] GetData<T>()
108
108
109
109
private static class Experts
110
110
{
111
- internal sealed class HeaderComprehension : IPurposeInferenceExpert
112
- {
113
- public void Apply ( IntermediateColumn [ ] columns )
114
- {
115
- foreach ( var column in columns )
116
- {
117
- if ( column . IsPurposeSuggested )
118
- continue ;
119
- else if ( Regex . IsMatch ( column . ColumnName , @"^m_queryid$" , RegexOptions . IgnoreCase ) )
120
- column . SuggestedPurpose = ColumnPurpose . Group ;
121
- else if ( Regex . IsMatch ( column . ColumnName , @"group" , RegexOptions . IgnoreCase ) )
122
- column . SuggestedPurpose = ColumnPurpose . Group ;
123
- else if ( Regex . IsMatch ( column . ColumnName , @"^m_\w+id$" , RegexOptions . IgnoreCase ) )
124
- column . SuggestedPurpose = ColumnPurpose . Name ;
125
- else if ( Regex . IsMatch ( column . ColumnName , @"^id$" , RegexOptions . IgnoreCase ) )
126
- column . SuggestedPurpose = ColumnPurpose . Name ;
127
- else if ( Regex . IsMatch ( column . ColumnName , @"^m_" , RegexOptions . IgnoreCase ) )
128
- column . SuggestedPurpose = ColumnPurpose . Ignore ;
129
- else
130
- continue ;
131
- }
132
- }
133
- }
134
-
135
111
internal sealed class TextClassification : IPurposeInferenceExpert
136
112
{
137
113
public void Apply ( IntermediateColumn [ ] columns )
@@ -172,12 +148,10 @@ public void Apply(IntermediateColumn[] columns)
172
148
if ( cardinalityRatio < 0.7 || seen . Count < 100 )
173
149
column . SuggestedPurpose = ColumnPurpose . CategoricalFeature ;
174
150
// (note: the columns.Count() == 1 condition below, in case a dataset has only
175
- // a 'name' and a 'label' column, forces what would be a 'name ' column to become a text feature)
151
+ // a 'name' and a 'label' column, forces what would be an 'ignore ' column to become a text feature)
176
152
else if ( cardinalityRatio >= 0.85 && ( avgLength > 30 || avgSpaces >= 1 || columns . Count ( ) == 1 ) )
177
153
column . SuggestedPurpose = ColumnPurpose . TextFeature ;
178
154
else if ( cardinalityRatio >= 0.9 )
179
- column . SuggestedPurpose = ColumnPurpose . Name ;
180
- else
181
155
column . SuggestedPurpose = ColumnPurpose . Ignore ;
182
156
}
183
157
else
@@ -244,9 +218,7 @@ public void Apply(IntermediateColumn[] columns)
244
218
private static IEnumerable < IPurposeInferenceExpert > GetExperts ( )
245
219
{
246
220
// Each of the experts respects the decisions of all the experts above.
247
-
248
- // Use column names to suggest purpose.
249
- yield return new Experts . HeaderComprehension ( ) ;
221
+
250
222
// Single-value text columns may be category, name, text or ignore.
251
223
yield return new Experts . TextClassification ( ) ;
252
224
// Vector-value text columns are always treated as text.
0 commit comments