Skip to content

Commit db8d690

Browse files
author
Shahab Moradi
committed
Address PR comments #1
1 parent f985de3 commit db8d690

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Microsoft.ML.PCA/PcaTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6+
using System.Collections.Generic;
67
using System.Linq;
78
using System.Text;
9+
using Microsoft.ML.Core.Data;
810
using Microsoft.ML.Runtime;
911
using Microsoft.ML.Runtime.CommandLine;
1012
using Microsoft.ML.Runtime.Data;
@@ -13,10 +15,8 @@
1315
using Microsoft.ML.Runtime.Internal.Utilities;
1416
using Microsoft.ML.Runtime.Model;
1517
using Microsoft.ML.Runtime.Numeric;
16-
using Microsoft.ML.Core.Data;
1718
using Microsoft.ML.StaticPipe;
1819
using Microsoft.ML.StaticPipe.Runtime;
19-
using System.Collections.Generic;
2020

2121
[assembly: LoadableClass(PcaTransform.Summary, typeof(IDataTransform), typeof(PcaTransform), typeof(PcaTransform.Arguments), typeof(SignatureDataTransform),
2222
PcaTransform.UserName, PcaTransform.LoaderSignature, PcaTransform.ShortName)]

test/Microsoft.ML.Tests/Transformers/PcaTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public sealed class PcaTests : TestDataPipeBase
2020
public PcaTests(ITestOutputHelper helper)
2121
: base(helper)
2222
{
23-
_env = new ConsoleEnvironment(seed: 1, conc: 1);
23+
_env = new ConsoleEnvironment(seed: 1);
2424
_dataSource = GetDataPath("generated_regression_dataset.csv");
2525
_saver = new TextSaver(_env, new TextSaver.Arguments { Silent = true, OutputHeader = false });
2626
}
@@ -31,12 +31,12 @@ public void PcaWorkout()
3131
var data = TextLoader.CreateReader(_env,
3232
c => (label: c.LoadFloat(11), weight: c.LoadFloat(0), features: c.LoadFloat(1, 10)),
3333
separator: ';', hasHeader: true)
34-
.Read(new MultiFileSource(_dataSource));
34+
.Read(_dataSource);
3535

3636
var invalidData = TextLoader.CreateReader(_env,
3737
c => (label: c.LoadFloat(11), weight: c.LoadFloat(0), features: c.LoadText(1, 10)),
3838
separator: ';', hasHeader: true)
39-
.Read(new MultiFileSource(_dataSource));
39+
.Read(_dataSource);
4040

4141
var est = new PcaEstimator(_env, "features", "pca", rank: 4, seed: 10);
4242
TestEstimatorCore(est, data.AsDynamic, invalidInput: invalidData.AsDynamic);
@@ -53,7 +53,7 @@ public void TestPcaEstimator()
5353
var data = TextLoader.CreateReader(_env,
5454
c => (label: c.LoadFloat(11), features: c.LoadFloat(0, 10)),
5555
separator: ';', hasHeader: true)
56-
.Read(new MultiFileSource(_dataSource));
56+
.Read(_dataSource);
5757

5858
var est = new PcaEstimator(_env, "features", "pca", rank: 5, seed: 1);
5959
var outputPath = GetOutputPath("PCA", "pca.tsv");
@@ -76,7 +76,7 @@ public void TestPcaPigsty()
7676
var reader = TextLoader.CreateReader(_env,
7777
c => (label: c.LoadFloat(11), features1: c.LoadFloat(0, 10)),
7878
separator: ';', hasHeader: true);
79-
var data = reader.Read(new MultiFileSource(_dataSource));
79+
var data = reader.Read(_dataSource);
8080
var pipeline = reader.MakeNewEstimator()
8181
.Append(r => (r.label, pca: r.features1.ToPrincipalComponents(rank: 5, seed: 1)));
8282

0 commit comments

Comments
 (0)