This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IrisData | |
{ | |
[Column("0")] | |
public float SepalLength; | |
[Column("1")] | |
public float SepalWidth; | |
[Column("2")] | |
public float PetalLength; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IrisData | |
{ | |
[Column("0")] | |
public float SepalLength; | |
[Column("1")] | |
public float SepalWidth; | |
[Column("2")] | |
public float PetalLength; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IrisPrediction is the result returned from prediction operations | |
public class IrisPrediction | |
{ | |
[ColumnName("PredictedLabel")] | |
public string PredictedLabels; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
// STEP 2: Create a pipeline and load your data | |
var pipeline = new LearningPipeline(); | |
// If working in Visual Studio, make sure the 'Copy to Output Directory' | |
// property of iris-data.txt is set to 'Copy always' | |
string dataPath = "iris-data.txt"; | |
pipeline.Add(new TextLoader(dataPath).CreateFrom<IrisData>(separator: ',')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using Microsoft.ML; | |
using Microsoft.ML.Data; | |
using Microsoft.ML.Trainers; | |
using Microsoft.ML.Transforms; | |
namespace ClusteringInML | |
{ | |
public static class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.ML.Runtime.Api; | |
namespace TitanicSurvivalClassifier | |
{ | |
public class TitanicData | |
{ | |
[Column("0")] | |
public float PassengerId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TitanicPrediction | |
{ | |
[ColumnName("PredictedLabel")] | |
public bool Survived; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestTitanicData | |
{ | |
public static readonly TitanicData Passenger = new TitanicData() | |
{ | |
Pclass = 2, | |
Name = "Shelley, Mrs. William (Imanita Parrish Hall)", | |
Sex = "female", | |
Age = 25, | |
SibSp = 0, | |
Parch = 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Program | |
{ | |
private static string AppPath => Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]); | |
private static string TrainDataPath => Path.Combine(AppPath, "titanic-train.csv"); | |
private static string TestDataPath => Path.Combine(AppPath, "titanic-test.csv"); | |
private static string ModelPath => Path.Combine(AppPath, "TitanicModel.zip"); | |
private static void Main(string[] args) | |
{ | |
// STEP 1: Create a model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TaxiTrip | |
{ | |
[Column("0")] | |
public string VendorId; | |
[Column("1")] | |
public string RateCode; | |
[Column("2")] | |
public float PassengerCount; |
OlderNewer