Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions machine-learning/tutorials/SentimentAnalysis/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
using System.Linq;
using Microsoft.ML;
using Microsoft.ML.Core.Data;
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms.Text;
// </Snippet1>

Expand Down Expand Up @@ -35,7 +34,7 @@ static void Main(string[] args)
// all the column names and their types. This is used to create the model, and train it.
// Initialize our TextLoader
// <Snippet4>
_textLoader = mlContext.Data.TextReader(new TextLoader.Arguments()
_textLoader = mlContext.Data.CreateTextReader(new TextLoader.Arguments()
{
Separator = "tab",
HasHeader = true,
Expand Down Expand Up @@ -155,7 +154,7 @@ public static void Evaluate(MLContext mlContext, ITransformer model)
private static void Predict(MLContext mlContext, ITransformer model)
{
// <Snippet17>
var predictionFunction = model.MakePredictionFunction<SentimentData, SentimentPrediction>(mlContext);
var predictionFunction = model.CreatePredictionEngine<SentimentData, SentimentPrediction>(mlContext);
// </Snippet17>

// <Snippet18>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ML" Version="0.8.0" />
<PackageReference Include="Microsoft.ML" Version="0.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <Snippet1>
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Data;
// </Snippet1>

namespace SentimentAnalysis
Expand Down
7 changes: 3 additions & 4 deletions machine-learning/tutorials/TaxiFarePrediction/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
using System.IO;
using Microsoft.ML;
using Microsoft.ML.Core.Data;
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Data;
using Microsoft.ML.Transforms;
using Microsoft.ML.Transforms.Categorical;
using Microsoft.ML.Transforms.Normalizers;
Expand All @@ -31,7 +30,7 @@ static void Main(string[] args)
// </Snippet3>

// <Snippet4>
_textLoader = mlContext.Data.TextReader(new TextLoader.Arguments()
_textLoader = mlContext.Data.CreateTextReader(new TextLoader.Arguments()
{
Separator = ",",
HasHeader = true,
Expand Down Expand Up @@ -139,7 +138,7 @@ private static void TestSinglePrediction(MLContext mlContext)
//Prediction test
// Create prediction function and make prediction.
// <Snippet22>
var predictionFunction = loadedModel.MakePredictionFunction<TaxiTrip, TaxiTripFarePrediction>(mlContext);
var predictionFunction = loadedModel.CreatePredictionEngine<TaxiTrip, TaxiTripFarePrediction>(mlContext);
// </Snippet22>
//Sample:
//vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>7.1</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ML" Version="0.8.0" />
<PackageReference Include="Microsoft.ML" Version="0.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion machine-learning/tutorials/TaxiFarePrediction/TaxiTrip.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <Snippet1>
using Microsoft.ML.Runtime.Api;
using Microsoft.ML.Data;
// </Snippet1>

namespace TaxiFarePrediction
Expand Down