Skip to content

Commit

Permalink
Removed Datasets from output and dead import
Browse files Browse the repository at this point in the history
  • Loading branch information
Anipik committed Jan 12, 2019
1 parent 8b75709 commit b7aeba4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 33 deletions.
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.ML.Benchmarks
{
public class KMeansAndLogisticRegressionBench
{
private readonly string _dataPath = Program.GetInvariantCultureDataPath("adult.tiny.with-schema.txt");
private readonly string _dataPath = DataPathProvider.GetDataPath("adult.tiny.with-schema.txt");

[Benchmark]
public ParameterMixingCalibratedPredictor TrainKMeansAndLR()
Expand Down
16 changes: 0 additions & 16 deletions test/Microsoft.ML.Benchmarks/Microsoft.ML.Benchmarks.csproj
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(RepoRoot)\build\ExternalBenchmarkDataFiles.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>7.2</LangVersion>
Expand All @@ -25,19 +24,4 @@
<NativeAssemblyReference Include="CpuMathNative" />
<NativeAssemblyReference Include="FastTreeNative" />
</ItemGroup>
<ItemGroup>
<Folder Include="Input\" />
<Content Include="..\data\iris.txt" Link="Input\iris.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="..\data\adult.tiny.with-schema.txt" Link="Input\adult.tiny.with-schema.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\data\wikipedia-detox-250-line-data.tsv" Link="Input\wikipedia-detox-250-line-data.tsv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\data\breast-cancer.txt" Link="Input\breast-cancer.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions test/Microsoft.ML.Benchmarks/PredictionEngineBench.cs
Expand Up @@ -32,7 +32,7 @@ public void SetupIrisPipeline()
PetalWidth = 5.1f,
};

string _irisDataPath = Program.GetInvariantCultureDataPath("iris.txt");
string _irisDataPath = DataPathProvider.GetDataPath("iris.txt");

var env = new MLContext(seed: 1, conc: 1);
var reader = new TextLoader(env,
Expand Down Expand Up @@ -65,7 +65,7 @@ public void SetupSentimentPipeline()
SentimentText = "Not a big fan of this."
};

string _sentimentDataPath = Program.GetInvariantCultureDataPath("wikipedia-detox-250-line-data.tsv");
string _sentimentDataPath = DataPathProvider.GetDataPath("wikipedia-detox-250-line-data.tsv");

var env = new MLContext(seed: 1, conc: 1);
var reader = new TextLoader(env, columns: new[]
Expand Down Expand Up @@ -94,7 +94,7 @@ public void SetupBreastCancerPipeline()
Features = new[] { 5f, 1f, 1f, 1f, 2f, 1f, 3f, 1f, 1f }
};

string _breastCancerDataPath = Program.GetInvariantCultureDataPath("breast-cancer.txt");
string _breastCancerDataPath = DataPathProvider.GetDataPath("breast-cancer.txt");

var env = new MLContext(seed: 1, conc: 1);
var reader = new TextLoader(env, columns: new[]
Expand Down
11 changes: 0 additions & 11 deletions test/Microsoft.ML.Benchmarks/Program.cs
Expand Up @@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Globalization;
using System.IO;
using System.Threading;
using BenchmarkDotNet.Running;

namespace Microsoft.ML.Benchmarks
Expand All @@ -19,13 +16,5 @@ static void Main(string[] args)
=> BenchmarkSwitcher
.FromAssembly(typeof(Program).Assembly)
.Run(args, new RecommendedConfig());

internal static string GetInvariantCultureDataPath(string name)
{
// enforce Neutral Language as "en-us" because the input data files use dot as decimal separator (and it fails for cultures with ",")
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

return Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location), "Input", name);
}
}
}
Expand Up @@ -16,8 +16,8 @@ namespace Microsoft.ML.Benchmarks
{
public class StochasticDualCoordinateAscentClassifierBench : WithExtraMetrics
{
private readonly string _dataPath = Program.GetInvariantCultureDataPath("iris.txt");
private readonly string _sentimentDataPath = Program.GetInvariantCultureDataPath("wikipedia-detox-250-line-data.tsv");
private readonly string _dataPath = DataPathProvider.GetDataPath("iris.txt");
private readonly string _sentimentDataPath = DataPathProvider.GetDataPath("wikipedia-detox-250-line-data.tsv");
private readonly Consumer _consumer = new Consumer(); // BenchmarkDotNet utility type used to prevent dead code elimination

private readonly MLContext _env = new MLContext(seed: 1);
Expand Down

0 comments on commit b7aeba4

Please sign in to comment.