@@ -43,15 +43,15 @@ private class IntermediateColumn
43
43
{
44
44
private readonly ReadOnlyMemory < char > [ ] _data ;
45
45
private readonly int _columnId ;
46
- private PrimitiveType _suggestedType ;
46
+ private PrimitiveDataViewType _suggestedType ;
47
47
private bool ? _hasHeader ;
48
48
49
49
public int ColumnId
50
50
{
51
51
get { return _columnId ; }
52
52
}
53
53
54
- public PrimitiveType SuggestedType
54
+ public PrimitiveDataViewType SuggestedType
55
55
{
56
56
get { return _suggestedType ; }
57
57
set { _suggestedType = value ; }
@@ -95,10 +95,10 @@ public class Column
95
95
{
96
96
public readonly int ColumnIndex ;
97
97
98
- public PrimitiveType ItemType ;
98
+ public PrimitiveDataViewType ItemType ;
99
99
public string SuggestedName ;
100
100
101
- public Column ( int columnIndex , string suggestedName , PrimitiveType itemType )
101
+ public Column ( int columnIndex , string suggestedName , PrimitiveDataViewType itemType )
102
102
{
103
103
ColumnIndex = columnIndex ;
104
104
SuggestedName = suggestedName ;
@@ -160,7 +160,7 @@ public void Apply(IntermediateColumn[] columns)
160
160
continue ;
161
161
}
162
162
163
- col . SuggestedType = BoolType . Instance ;
163
+ col . SuggestedType = BooleanDataViewType . Instance ;
164
164
bool first ;
165
165
166
166
col . HasHeader = ! Conversions . TryParse ( in col . RawData [ 0 ] , out first ) ;
@@ -185,7 +185,7 @@ public void Apply(IntermediateColumn[] columns)
185
185
continue ;
186
186
}
187
187
188
- col . SuggestedType = NumberType . R4 ;
188
+ col . SuggestedType = NumberDataViewType . Single ;
189
189
190
190
var headerStr = col . RawData [ 0 ] . ToString ( ) ;
191
191
col . HasHeader = ! double . TryParse ( headerStr , out var doubleVal ) ;
@@ -202,7 +202,7 @@ public void Apply(IntermediateColumn[] columns)
202
202
if ( col . SuggestedType != null )
203
203
continue ;
204
204
205
- col . SuggestedType = TextType . Instance ;
205
+ col . SuggestedType = TextDataViewType . Instance ;
206
206
col . HasHeader = IsLookLikeHeader ( col . RawData [ 0 ] ) ;
207
207
}
208
208
}
@@ -258,14 +258,14 @@ private static InferenceResult InferTextFileColumnTypesCore(MLContext context, I
258
258
// read the file as the specified number of text columns
259
259
var textLoaderArgs = new TextLoader . Arguments
260
260
{
261
- Column = new [ ] { new TextLoader . Column ( "C" , DataKind . TX , 0 , args . ColumnCount - 1 ) } ,
261
+ Columns = new [ ] { new TextLoader . Column ( "C" , DataKind . TX , 0 , args . ColumnCount - 1 ) } ,
262
262
Separators = new [ ] { args . Separator } ,
263
263
AllowSparse = args . AllowSparse ,
264
264
AllowQuoting = args . AllowQuote ,
265
265
} ;
266
266
var textLoader = new TextLoader ( context , textLoaderArgs ) ;
267
267
var idv = textLoader . Read ( fileSource ) ;
268
- idv = idv . Take ( context , args . MaxRowsToRead ) ;
268
+ idv = context . Data . TakeRows ( idv , args . MaxRowsToRead ) ;
269
269
270
270
// read all the data into memory.
271
271
// list items are rows of the dataset.
@@ -361,7 +361,7 @@ private static InferenceResult InferTextFileColumnTypesCore(MLContext context, I
361
361
// if label column has all Boolean values, set its type as Boolean
362
362
if ( labelColumn . HasAllBooleanValues ( ) )
363
363
{
364
- labelColumn . SuggestedType = BoolType . Instance ;
364
+ labelColumn . SuggestedType = BooleanDataViewType . Instance ;
365
365
}
366
366
367
367
var outCols = cols . Select ( x => new Column ( x . ColumnId , x . Name , x . SuggestedType ) ) . ToArray ( ) ;
0 commit comments