17
17
using Microsoft . ML . Numeric ;
18
18
using Microsoft . ML . Transforms . Projections ;
19
19
20
- [ assembly: LoadableClass ( PcaTransformer . Summary , typeof ( IDataTransform ) , typeof ( PcaTransformer ) , typeof ( PcaTransformer . Options ) , typeof ( SignatureDataTransform ) ,
21
- PcaTransformer . UserName , PcaTransformer . LoaderSignature , PcaTransformer . ShortName ) ]
20
+ [ assembly: LoadableClass ( PrincipalComponentAnalysisTransformer . Summary , typeof ( IDataTransform ) , typeof ( PrincipalComponentAnalysisTransformer ) , typeof ( PrincipalComponentAnalysisTransformer . Options ) , typeof ( SignatureDataTransform ) ,
21
+ PrincipalComponentAnalysisTransformer . UserName , PrincipalComponentAnalysisTransformer . LoaderSignature , PrincipalComponentAnalysisTransformer . ShortName ) ]
22
22
23
- [ assembly: LoadableClass ( PcaTransformer . Summary , typeof ( IDataTransform ) , typeof ( PcaTransformer ) , null , typeof ( SignatureLoadDataTransform ) ,
24
- PcaTransformer . UserName , PcaTransformer . LoaderSignature ) ]
23
+ [ assembly: LoadableClass ( PrincipalComponentAnalysisTransformer . Summary , typeof ( IDataTransform ) , typeof ( PrincipalComponentAnalysisTransformer ) , null , typeof ( SignatureLoadDataTransform ) ,
24
+ PrincipalComponentAnalysisTransformer . UserName , PrincipalComponentAnalysisTransformer . LoaderSignature ) ]
25
25
26
- [ assembly: LoadableClass ( PcaTransformer . Summary , typeof ( PcaTransformer ) , null , typeof ( SignatureLoadModel ) ,
27
- PcaTransformer . UserName , PcaTransformer . LoaderSignature ) ]
26
+ [ assembly: LoadableClass ( PrincipalComponentAnalysisTransformer . Summary , typeof ( PrincipalComponentAnalysisTransformer ) , null , typeof ( SignatureLoadModel ) ,
27
+ PrincipalComponentAnalysisTransformer . UserName , PrincipalComponentAnalysisTransformer . LoaderSignature ) ]
28
28
29
- [ assembly: LoadableClass ( typeof ( IRowMapper ) , typeof ( PcaTransformer ) , null , typeof ( SignatureLoadRowMapper ) ,
30
- PcaTransformer . UserName , PcaTransformer . LoaderSignature ) ]
29
+ [ assembly: LoadableClass ( typeof ( IRowMapper ) , typeof ( PrincipalComponentAnalysisTransformer ) , null , typeof ( SignatureLoadRowMapper ) ,
30
+ PrincipalComponentAnalysisTransformer . UserName , PrincipalComponentAnalysisTransformer . LoaderSignature ) ]
31
31
32
- [ assembly: LoadableClass ( typeof ( void ) , typeof ( PcaTransformer ) , null , typeof ( SignatureEntryPointModule ) , PcaTransformer . LoaderSignature ) ]
32
+ [ assembly: LoadableClass ( typeof ( void ) , typeof ( PrincipalComponentAnalysisTransformer ) , null , typeof ( SignatureEntryPointModule ) , PrincipalComponentAnalysisTransformer . LoaderSignature ) ]
33
33
34
34
namespace Microsoft . ML . Transforms . Projections
35
35
{
36
36
/// <include file='doc.xml' path='doc/members/member[@name="PCA"]/*' />
37
- public sealed class PcaTransformer : OneToOneTransformerBase
37
+ public sealed class PrincipalComponentAnalysisTransformer : OneToOneTransformerBase
38
38
{
39
39
internal sealed class Options : TransformInputBase
40
40
{
@@ -193,7 +193,7 @@ private static VersionInfo GetVersionInfo()
193
193
verReadableCur : 0x00010002 ,
194
194
verWeCanReadBack : 0x00010001 ,
195
195
loaderSignature : LoaderSignature ,
196
- loaderAssemblyName : typeof ( PcaTransformer ) . Assembly . FullName ) ;
196
+ loaderAssemblyName : typeof ( PrincipalComponentAnalysisTransformer ) . Assembly . FullName ) ;
197
197
}
198
198
199
199
private readonly int _numColumns ;
@@ -202,8 +202,8 @@ private static VersionInfo GetVersionInfo()
202
202
203
203
private const string RegistrationName = "Pca" ;
204
204
205
- internal PcaTransformer ( IHostEnvironment env , IDataView input , PrincipalComponentAnalysisEstimator . ColumnInfo [ ] columns )
206
- : base ( Contracts . CheckRef ( env , nameof ( env ) ) . Register ( nameof ( PcaTransformer ) ) , GetColumnPairs ( columns ) )
205
+ internal PrincipalComponentAnalysisTransformer ( IHostEnvironment env , IDataView input , PrincipalComponentAnalysisEstimator . ColumnInfo [ ] columns )
206
+ : base ( Contracts . CheckRef ( env , nameof ( env ) ) . Register ( nameof ( PrincipalComponentAnalysisTransformer ) ) , GetColumnPairs ( columns ) )
207
207
{
208
208
Host . AssertNonEmpty ( ColumnPairs ) ;
209
209
_numColumns = columns . Length ;
@@ -221,7 +221,7 @@ internal PcaTransformer(IHostEnvironment env, IDataView input, PrincipalComponen
221
221
Train ( columns , _transformInfos , input ) ;
222
222
}
223
223
224
- private PcaTransformer ( IHost host , ModelLoadContext ctx )
224
+ private PrincipalComponentAnalysisTransformer ( IHost host , ModelLoadContext ctx )
225
225
: base ( host , ctx )
226
226
{
227
227
Host . AssertValue ( ctx ) ;
@@ -260,14 +260,14 @@ private static IDataTransform Create(IHostEnvironment env, Options options, IDat
260
260
item . Oversampling ?? options . Oversampling ,
261
261
item . Center ?? options . Center ,
262
262
item . Seed ?? options . Seed ) ) . ToArray ( ) ;
263
- return new PcaTransformer ( env , input , cols ) . MakeDataTransform ( input ) ;
263
+ return new PrincipalComponentAnalysisTransformer ( env , input , cols ) . MakeDataTransform ( input ) ;
264
264
}
265
265
266
266
// Factory method for SignatureLoadModel.
267
- private static PcaTransformer Create ( IHostEnvironment env , ModelLoadContext ctx )
267
+ private static PrincipalComponentAnalysisTransformer Create ( IHostEnvironment env , ModelLoadContext ctx )
268
268
{
269
269
Contracts . CheckValue ( env , nameof ( env ) ) ;
270
- var host = env . Register ( nameof ( PcaTransformer ) ) ;
270
+ var host = env . Register ( nameof ( PrincipalComponentAnalysisTransformer ) ) ;
271
271
272
272
host . CheckValue ( ctx , nameof ( ctx ) ) ;
273
273
ctx . CheckAtModel ( GetVersionInfo ( ) ) ;
@@ -276,7 +276,7 @@ private static PcaTransformer Create(IHostEnvironment env, ModelLoadContext ctx)
276
276
int cbFloat = ctx . Reader . ReadInt32 ( ) ;
277
277
env . CheckDecode ( cbFloat == sizeof ( float ) ) ;
278
278
}
279
- return new PcaTransformer ( host , ctx ) ;
279
+ return new PrincipalComponentAnalysisTransformer ( host , ctx ) ;
280
280
}
281
281
282
282
public override void Save ( ModelSaveContext ctx )
@@ -538,10 +538,10 @@ public ColumnSchemaInfo((string outputColumnName, string inputColumnName) column
538
538
}
539
539
}
540
540
541
- private readonly PcaTransformer _parent ;
541
+ private readonly PrincipalComponentAnalysisTransformer _parent ;
542
542
private readonly int _numColumns ;
543
543
544
- public Mapper ( PcaTransformer parent , Schema inputSchema )
544
+ public Mapper ( PrincipalComponentAnalysisTransformer parent , Schema inputSchema )
545
545
: base ( parent . Host . Register ( nameof ( Mapper ) ) , parent , inputSchema )
546
546
{
547
547
_parent = parent ;
@@ -607,7 +607,7 @@ private static void TransformFeatures(IExceptionContext ectx, in VBuffer<float>
607
607
internal static CommonOutputs . TransformOutput Calculate ( IHostEnvironment env , Options input )
608
608
{
609
609
var h = EntryPointUtils . CheckArgsAndCreateHost ( env , "Pca" , input ) ;
610
- var view = PcaTransformer . Create ( h , input , input . Data ) ;
610
+ var view = PrincipalComponentAnalysisTransformer . Create ( h , input , input . Data ) ;
611
611
return new CommonOutputs . TransformOutput ( )
612
612
{
613
613
Model = new TransformModelImpl ( h , view , input . Data ) ,
@@ -617,7 +617,7 @@ internal static CommonOutputs.TransformOutput Calculate(IHostEnvironment env, Op
617
617
}
618
618
619
619
/// <include file='doc.xml' path='doc/members/member[@name="PCA"]/*'/>
620
- public sealed class PrincipalComponentAnalysisEstimator : IEstimator < PcaTransformer >
620
+ public sealed class PrincipalComponentAnalysisEstimator : IEstimator < PrincipalComponentAnalysisTransformer >
621
621
{
622
622
[ BestFriend ]
623
623
internal static class Defaults
@@ -640,7 +640,6 @@ public sealed class ColumnInfo
640
640
public readonly string Name ;
641
641
/// <summary>
642
642
/// Name of column to transform.
643
- /// If set to <see langword="null"/>, the value of the <see cref="Name"/> will be used as source.
644
643
/// </summary>
645
644
public readonly string InputColumnName ;
646
645
/// <summary>
@@ -674,7 +673,7 @@ public sealed class ColumnInfo
674
673
/// <param name="rank">The number of components in the PCA.</param>
675
674
/// <param name="overSampling">Oversampling parameter for randomized PCA training.</param>
676
675
/// <param name="center">If enabled, data is centered to be zero mean.</param>
677
- /// <param name="seed">The seed for random number generation .</param>
676
+ /// <param name="seed">The random seed. If unspecified random state will be instead derived from the <see cref="MLContext"/> .</param>
678
677
public ColumnInfo ( string name ,
679
678
string inputColumnName = null ,
680
679
string weightColumn = Defaults . WeightColumn ,
@@ -729,9 +728,9 @@ internal PrincipalComponentAnalysisEstimator(IHostEnvironment env, params Column
729
728
}
730
729
731
730
/// <summary>
732
- /// Trains and returns a <see cref="PcaTransformer "/>.
731
+ /// Trains and returns a <see cref="PrincipalComponentAnalysisTransformer "/>.
733
732
/// </summary>
734
- public PcaTransformer Fit ( IDataView input ) => new PcaTransformer ( _host , input , _columns ) ;
733
+ public PrincipalComponentAnalysisTransformer Fit ( IDataView input ) => new PrincipalComponentAnalysisTransformer ( _host , input , _columns ) ;
735
734
736
735
/// <summary>
737
736
/// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer.
0 commit comments