Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rebase fix
  • Loading branch information
artidoro committed Apr 16, 2019
1 parent 192b466 commit 7682d7f
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 47 deletions.
Expand Up @@ -59,13 +59,14 @@ public static void Example()
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.24
// Log Loss Reduction: 0.78
// Log Loss Reduction: 0.79
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -8,6 +8,7 @@ string TrainerOptions = null;
string OptionsInclude = "";
string Comments = "";
bool CacheData = false;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand All @@ -20,5 +21,5 @@ string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.24
// Log Loss Reduction: 0.78";
// Log Loss Reduction: 0.79";
#>
Expand Up @@ -72,10 +72,11 @@ public static void Example()
// Log Loss Reduction: 0.80
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -12,7 +12,7 @@ string TrainerOptions = @"LbfgsMaximumEntropyMulticlassTrainer.Options

string OptionsInclude = "using Microsoft.ML.Trainers;";
string Comments = "";

string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";
bool CacheData = false;

string ExpectedOutputPerInstance = @"// Expected output:
Expand Down
Expand Up @@ -61,13 +61,14 @@ public static void Example()
// Micro Accuracy: 0.99
// Macro Accuracy: 0.99
// Log Loss: 0.05
// Log Loss Reduction: 0.96
// Log Loss Reduction: 0.95
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -10,6 +10,7 @@ string Comments = @"
// This example requires installation of additional NuGet package
// <a href=""https://www.nuget.org/packages/Microsoft.ML.FastTree/"">Microsoft.ML.FastTree</a>.";
bool CacheData = false;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand All @@ -22,5 +23,5 @@ string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.99
// Macro Accuracy: 0.99
// Log Loss: 0.05
// Log Loss Reduction: 0.96";
// Log Loss Reduction: 0.95";
#>
Expand Up @@ -72,14 +72,15 @@ public static void Example()
// Expected output:
// Micro Accuracy: 0.98
// Macro Accuracy: 0.98
// Log Loss: 0.06
// Log Loss Reduction: 0.80
// Log Loss: 0.07
// Log Loss Reduction: 0.94
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -18,6 +18,7 @@ string Comments = @"
// <a href=""https://www.nuget.org/packages/Microsoft.ML.FastTree/"">Microsoft.ML.FastTree</a>.";

bool CacheData = false;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand All @@ -29,6 +30,6 @@ string ExpectedOutputPerInstance = @"// Expected output:
string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.98
// Macro Accuracy: 0.98
// Log Loss: 0.06
// Log Loss Reduction: 0.80";
// Log Loss: 0.07
// Log Loss Reduction: 0.94";
#>
Expand Up @@ -58,11 +58,10 @@ public static void Example()
// Expected output:
// Micro Accuracy: 0.90
// Macro Accuracy: 0.90
// Log Loss: 0.37
// Log Loss Reduction: 0.67
// Log Loss: 0.36
// Log Loss Reduction: 0.68
}


// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
Expand Down
Expand Up @@ -7,8 +7,8 @@ string TrainerOptions = null;

string OptionsInclude = "";
string Comments= "";
string DataGenerationComments= @"
// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

bool CacheData = false;

string ExpectedOutputPerInstance= @"// Expected output:
Expand All @@ -21,6 +21,6 @@ string ExpectedOutputPerInstance= @"// Expected output:
string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.90
// Macro Accuracy: 0.90
// Log Loss: 0.37
// Log Loss Reduction: 0.67";
// Log Loss: 0.36
// Log Loss Reduction: 0.68";
#>
Expand Up @@ -58,11 +58,10 @@ public static void Example()
// Expected output:
// Micro Accuracy: 0.90
// Macro Accuracy: 0.90
// Log Loss: 0.38
// Log Loss Reduction: 0.66
// Log Loss: 0.36
// Log Loss Reduction: 0.67
}


// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
Expand Down
Expand Up @@ -7,8 +7,7 @@ string TrainerOptions = null;

string OptionsInclude = "";
string Comments= "";
string DataGenerationComments= @"
// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";
bool CacheData = false;

string ExpectedOutputPerInstance= @"// Expected output:
Expand All @@ -21,6 +20,6 @@ string ExpectedOutputPerInstance= @"// Expected output:
string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.90
// Macro Accuracy: 0.90
// Log Loss: 0.38
// Log Loss Reduction: 0.66";
// Log Loss: 0.36
// Log Loss Reduction: 0.67";
#>
Expand Up @@ -68,10 +68,11 @@ public static void Example()
// Log Loss Reduction: 0.80
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -8,6 +8,7 @@ string TrainerOptions = null;
string OptionsInclude = "";
string Comments = "";
bool CacheData = true;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand Down
Expand Up @@ -73,16 +73,17 @@ public static void Example()
PrintMetrics(metrics);

// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.46
// Log Loss Reduction: 0.58
// Micro Accuracy: 0.92
// Macro Accuracy: 0.92
// Log Loss: 0.31
// Log Loss Reduction: 0.72
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -14,6 +14,8 @@ string TrainerOptions = @"SdcaMaximumEntropyMulticlassTrainer.Options
string OptionsInclude = "using Microsoft.ML.Trainers;";
string Comments = "";
bool CacheData = true;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";


string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand All @@ -23,8 +25,8 @@ string ExpectedOutputPerInstance = @"// Expected output:
// Label: 3, Prediction: 3";

string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.46
// Log Loss Reduction: 0.58";
// Micro Accuracy: 0.92
// Macro Accuracy: 0.92
// Log Loss: 0.31
// Log Loss Reduction: 0.72";
#>
Expand Up @@ -64,14 +64,15 @@ public static void Example()
// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.00
// Log Loss Reduction: 1.00
// Log Loss: 0.57
// Log Loss Reduction: 0.48
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -8,6 +8,7 @@ string TrainerOptions = null;
string OptionsInclude = "";
string Comments = "";
bool CacheData = true;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand All @@ -19,6 +20,6 @@ string ExpectedOutputPerInstance = @"// Expected output:
string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.00
// Log Loss Reduction: 1.00";
// Log Loss: 0.57
// Log Loss Reduction: 0.48";
#>
Expand Up @@ -75,14 +75,15 @@ public static void Example()
// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.36
// Log Loss Reduction: 0.67
// Log Loss: 0.22
// Log Loss Reduction: 0.80
}

// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.
private static IEnumerable<DataPoint> GenerateRandomDataPoints(int count, int seed=0)
{
var random = new Random(seed);
float randomFloat() => (float)random.NextDouble();
float randomFloat() => (float)(random.NextDouble() - 0.5);
for (int i = 0; i < count; i++)
{
// Generate Labels that are integers 1, 2 or 3
Expand Down
Expand Up @@ -14,6 +14,7 @@ string TrainerOptions = @"SdcaNonCalibratedMulticlassTrainer.Options
string OptionsInclude = "using Microsoft.ML.Trainers;";
string Comments = "";
bool CacheData = true;
string DataGenerationComments= "// Generates random uniform doubles in [-0.5, 0.5) range with labels 1, 2 or 3.";

string ExpectedOutputPerInstance = @"// Expected output:
// Label: 1, Prediction: 1
Expand All @@ -25,6 +26,6 @@ string ExpectedOutputPerInstance = @"// Expected output:
string ExpectedOutput = @"// Expected output:
// Micro Accuracy: 0.91
// Macro Accuracy: 0.91
// Log Loss: 0.36
// Log Loss Reduction: 0.67";
// Log Loss: 0.22
// Log Loss Reduction: 0.80";
#>

0 comments on commit 7682d7f

Please sign in to comment.