Skip to content

Commit ad9162b

Browse files
authored
Merge pull request #568 from JRAlexander/jralexander-mlnet-011419
updating for ML.NET .9 release
2 parents cc9101f + b79f9ed commit ad9162b

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

machine-learning/tutorials/SentimentAnalysis/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
using System.Linq;
66
using Microsoft.ML;
77
using Microsoft.ML.Core.Data;
8-
using Microsoft.ML.Runtime.Api;
9-
using Microsoft.ML.Runtime.Data;
8+
using Microsoft.ML.Data;
109
using Microsoft.ML.Transforms.Text;
1110
// </Snippet1>
1211

@@ -35,7 +34,7 @@ static void Main(string[] args)
3534
// all the column names and their types. This is used to create the model, and train it.
3635
// Initialize our TextLoader
3736
// <Snippet4>
38-
_textLoader = mlContext.Data.TextReader(new TextLoader.Arguments()
37+
_textLoader = mlContext.Data.CreateTextReader(new TextLoader.Arguments()
3938
{
4039
Separator = "tab",
4140
HasHeader = true,
@@ -155,7 +154,7 @@ public static void Evaluate(MLContext mlContext, ITransformer model)
155154
private static void Predict(MLContext mlContext, ITransformer model)
156155
{
157156
// <Snippet17>
158-
var predictionFunction = model.MakePredictionFunction<SentimentData, SentimentPrediction>(mlContext);
157+
var predictionFunction = model.CreatePredictionEngine<SentimentData, SentimentPrediction>(mlContext);
159158
// </Snippet17>
160159

161160
// <Snippet18>

machine-learning/tutorials/SentimentAnalysis/SentimentAnalysis.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
66
</PropertyGroup>
77

88
<PropertyGroup>
@@ -14,7 +14,7 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.ML" Version="0.8.0" />
17+
<PackageReference Include="Microsoft.ML" Version="0.9.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

machine-learning/tutorials/SentimentAnalysis/SentimentData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// <Snippet1>
2-
using Microsoft.ML.Runtime.Api;
2+
using Microsoft.ML.Data;
33
// </Snippet1>
44

55
namespace SentimentAnalysis

machine-learning/tutorials/TaxiFarePrediction/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
using System.IO;
44
using Microsoft.ML;
55
using Microsoft.ML.Core.Data;
6-
using Microsoft.ML.Runtime.Api;
7-
using Microsoft.ML.Runtime.Data;
6+
using Microsoft.ML.Data;
87
using Microsoft.ML.Transforms;
98
using Microsoft.ML.Transforms.Categorical;
109
using Microsoft.ML.Transforms.Normalizers;
@@ -31,7 +30,7 @@ static void Main(string[] args)
3130
// </Snippet3>
3231

3332
// <Snippet4>
34-
_textLoader = mlContext.Data.TextReader(new TextLoader.Arguments()
33+
_textLoader = mlContext.Data.CreateTextReader(new TextLoader.Arguments()
3534
{
3635
Separator = ",",
3736
HasHeader = true,
@@ -139,7 +138,7 @@ private static void TestSinglePrediction(MLContext mlContext)
139138
//Prediction test
140139
// Create prediction function and make prediction.
141140
// <Snippet22>
142-
var predictionFunction = loadedModel.MakePredictionFunction<TaxiTrip, TaxiTripFarePrediction>(mlContext);
141+
var predictionFunction = loadedModel.CreatePredictionEngine<TaxiTrip, TaxiTripFarePrediction>(mlContext);
143142
// </Snippet22>
144143
//Sample:
145144
//vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount

machine-learning/tutorials/TaxiFarePrediction/TaxiFarePrediction.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
66
</PropertyGroup>
77

88
<PropertyGroup>
99
<LangVersion>7.1</LangVersion>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.ML" Version="0.8.0" />
13+
<PackageReference Include="Microsoft.ML" Version="0.9.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

machine-learning/tutorials/TaxiFarePrediction/TaxiTrip.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// <Snippet1>
2-
using Microsoft.ML.Runtime.Api;
2+
using Microsoft.ML.Data;
33
// </Snippet1>
44

55
namespace TaxiFarePrediction

0 commit comments

Comments
 (0)