diff --git a/Src/numl.Tests/numl.Tests.csproj b/Src/numl.Tests/numl.Tests.csproj
index b156782..3a86fe0 100644
--- a/Src/numl.Tests/numl.Tests.csproj
+++ b/Src/numl.Tests/numl.Tests.csproj
@@ -7,6 +7,7 @@
+
diff --git a/Src/numl.Tests/project.json b/Src/numl.Tests/project.json
new file mode 100644
index 0000000..1f4b106
--- /dev/null
+++ b/Src/numl.Tests/project.json
@@ -0,0 +1,21 @@
+{
+ "version": "1.0.0-*",
+ "dependencies": {
+ "numl": "0.9.13-beta",
+ "xunit": "2.2.0-*",
+ "FluentAssertions": "4.14.0",
+ "dotnet-test-xunit": "2.2.0-*"
+ },
+ "testRunner": "xunit",
+ "frameworks": {
+ "netcoreapp1.1": {
+ "dependencies": {
+ "Microsoft.NETCore.App": {
+ "version": "1.1.0-*",
+ "type": "platform"
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Src/numl.sln b/Src/numl.sln
index d0151e7..d6d13e3 100644
--- a/Src/numl.sln
+++ b/Src/numl.sln
@@ -1,13 +1,19 @@
-
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26228.4
+VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B002D86D-AF04-48EE-9F22-F7DC8FA747A4}"
+ ProjectSection(SolutionItems) = preProject
+ ..\.gitattributes = ..\.gitattributes
+ ..\.gitignore = ..\.gitignore
+ ..\Build\build.cake = ..\Build\build.cake
+ EndProjectSection
+EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "numl", "numl\numl.csproj", "{554363C6-5979-4C9A-90E6-E70AF2D5CC09}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "numl.Tests", "numl.Tests\numl.Tests.csproj", "{801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "numl.Tests", "numl.Tests\numl.Tests.csproj", "{801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "numlR", "numlR\numlR.csproj", "{1C65B9E4-0843-47F7-A0F6-4CF7EF30164E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "numlsample.GettingStarted", "numlsample.GettingStarted\numlsample.GettingStarted.csproj", "{70589B72-0E1B-4D92-B92D-B0EE30B2E73C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -43,6 +49,16 @@ Global
{801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x64.Build.0 = Release|Any CPU
{801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x86.ActiveCfg = Release|Any CPU
{801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x86.Build.0 = Release|Any CPU
+ {70589B72-0E1B-4D92-B92D-B0EE30B2E73C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {70589B72-0E1B-4D92-B92D-B0EE30B2E73C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {70589B72-0E1B-4D92-B92D-B0EE30B2E73C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {70589B72-0E1B-4D92-B92D-B0EE30B2E73C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {70589B72-0E1B-4D92-B92D-B0EE30B2E73C}.Release|x64.ActiveCfg = Release|Any CPU
+ {70589B72-0E1B-4D92-B92D-B0EE30B2E73C}.Release|x86.ActiveCfg = Release|Any CPU
+ {801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x64.ActiveCfg = Release|Any CPU
+ {801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x64.Build.0 = Release|Any CPU
+ {801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x86.ActiveCfg = Release|Any CPU
+ {801D4C20-F3BB-48B5-8530-2F8E9D2AC1D1}.Release|x86.Build.0 = Release|Any CPU
{1C65B9E4-0843-47F7-A0F6-4CF7EF30164E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C65B9E4-0843-47F7-A0F6-4CF7EF30164E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C65B9E4-0843-47F7-A0F6-4CF7EF30164E}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -62,4 +78,10 @@ Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = numl.vsmdi
EndGlobalSection
+ GlobalSection(TestCaseManagementSettings) = postSolution
+ CategoryFile = numl.vsmdi
+ EndGlobalSection
+ GlobalSection(TestCaseManagementSettings) = postSolution
+ CategoryFile = numl.vsmdi
+ EndGlobalSection
EndGlobal
diff --git a/Src/numl/Supervised/Generator.cs b/Src/numl/Supervised/Generator.cs
index 1bac53b..6559d0d 100644
--- a/Src/numl/Supervised/Generator.cs
+++ b/Src/numl/Supervised/Generator.cs
@@ -1,35 +1,35 @@
-// file: Supervised\Generator.cs
-//
-// summary: Implements the generator class
-using System;
-using numl.Model;
-using System.Linq;
-
-using numl.Math.LinearAlgebra;
-using System.Collections.Generic;
-using numl.Utils;
-
-namespace numl.Supervised
-{
- /// A generator.
- public abstract class Generator : IGenerator
- {
- private Descriptor _Descriptor;
-
- /// Event queue for all listeners interested in ModelChanged events.
- public event EventHandler ModelChanged;
- /// Raises the model event.
- /// Source of the event.
- /// Event information to send to registered event handlers.
- protected virtual void OnModelChanged(object sender, ModelEventArgs e)
- {
- EventHandler handler = ModelChanged;
- if (handler != null)
- handler(sender, e);
- }
-
- /// Gets or sets the descriptor.
- /// The descriptor.
+// file: Supervised\Generator.cs
+//
+// summary: Implements the generator class
+using System;
+using numl.Model;
+using System.Linq;
+
+using numl.Math.LinearAlgebra;
+using System.Collections.Generic;
+using numl.Utils;
+
+namespace numl.Supervised
+{
+ /// A generator.
+ public abstract class Generator : IGenerator
+ {
+ private Descriptor _Descriptor;
+
+ /// Event queue for all listeners interested in ModelChanged events.
+ public event EventHandler ModelChanged;
+ /// Raises the model event.
+ /// Source of the event.
+ /// Event information to send to registered event handlers.
+ protected virtual void OnModelChanged(object sender, ModelEventArgs e)
+ {
+ EventHandler handler = ModelChanged;
+ if (handler != null)
+ handler(sender, e);
+ }
+
+ /// Gets or sets the descriptor.
+ /// The descriptor.
public Descriptor Descriptor
{
get { return this._Descriptor; }
@@ -47,73 +47,73 @@ public Descriptor Descriptor
///
/// If True, examples will keep their original ordering from the set.
///
- public bool PreserveOrder { get; set; }
-
- ///
- /// Gets or sets whether to perform feature normalisation using the specified Feature Normalizer.
- ///
- public bool NormalizeFeatures { get; set; }
- ///
- /// Gets or sets the feature normalizer to use for each item.
- ///
- public numl.Math.Normalization.INormalizer FeatureNormalizer { get; set; }
-
- ///
- /// Gets or sets the Feature properties from the original training set.
- ///
- public numl.Math.Summary FeatureProperties { get; set; }
-
+ public bool PreserveOrder { get; set; }
+
+ ///
+ /// Gets or sets whether to perform feature normalization using the specified Feature Normalizer.
+ ///
+ public bool NormalizeFeatures { get; set; }
+ ///
+ /// Gets or sets the feature normalizer to use for each item.
+ ///
+ public numl.Math.Normalization.INormalizer FeatureNormalizer { get; set; }
+
+ ///
+ /// Gets or sets the Feature properties from the original training set.
+ ///
+ public numl.Math.Summary FeatureProperties { get; set; }
+
///
/// Gets or sets whether the prediction label is discrete / categorical.
- ///
- public bool IsDiscrete { get; set; }
-
- ///
- /// Initializes a new Generator instance.
- ///
- public Generator()
- {
- this.NormalizeFeatures = false;
- this.FeatureNormalizer = new numl.Math.Normalization.MinMaxNormalizer();
- }
-
- ///
- /// Override to perform custom pre-processing steps on the raw Matrix data.
- ///
- /// Matrix of examples.
- ///
- public virtual void Preprocess(Matrix X)
- {
- this.FeatureProperties = new numl.Math.Summary()
- {
- Average = X.Mean(VectorType.Row),
- StandardDeviation = X.StdDev(VectorType.Row),
- Minimum = X.Min(VectorType.Row),
- Maximum = X.Max(VectorType.Row),
- Median = X.Median(VectorType.Row)
- };
-
- if (this.NormalizeFeatures)
- {
- if (this.FeatureNormalizer != null)
- {
- for (int i = 0; i < X.Rows; i++)
- {
- Vector vectors = this.FeatureNormalizer.Normalize(X[i, VectorType.Row], this.FeatureProperties);
- for (int j = 0; j < X.Cols; j++)
- {
- X[i, j] = vectors[j];
- }
- }
- }
- }
- }
-
+ ///
+ public bool IsDiscrete { get; set; }
+
+ ///
+ /// Initializes a new Generator instance.
+ ///
+ public Generator()
+ {
+ this.NormalizeFeatures = false;
+ this.FeatureNormalizer = new numl.Math.Normalization.MinMaxNormalizer();
+ }
+
+ ///
+ /// Override to perform custom pre-processing steps on the raw Matrix data.
+ ///
+ /// Matrix of examples.
+ ///
+ public virtual void Preprocess(Matrix X)
+ {
+ this.FeatureProperties = new numl.Math.Summary()
+ {
+ Average = X.Mean(VectorType.Row),
+ StandardDeviation = X.StdDev(VectorType.Row),
+ Minimum = X.Min(VectorType.Row),
+ Maximum = X.Max(VectorType.Row),
+ Median = X.Median(VectorType.Row)
+ };
+
+ if (this.NormalizeFeatures)
+ {
+ if (this.FeatureNormalizer != null)
+ {
+ for (int i = 0; i < X.Rows; i++)
+ {
+ Vector vectors = this.FeatureNormalizer.Normalize(X[i, VectorType.Row], this.FeatureProperties);
+ for (int j = 0; j < X.Cols; j++)
+ {
+ X[i, j] = vectors[j];
+ }
+ }
+ }
+ }
+ }
+
///
/// Converts a label Vector to a 1-of-k encoded Matrix for discrete values, otherwise returns a n x 1 continuous matrix.
///
/// Vector of class labels.
- /// Matrix.
+ /// Matrix.
public virtual Matrix ToEncoded(Vector y)
{
// check IsDiscrete in case a descriptor is not provided.
@@ -123,90 +123,90 @@ public virtual Matrix ToEncoded(Vector y)
}
else
return y.ToMatrix(VectorType.Col);
- }
-
- /// Generate model based on a set of examples.
- /// Thrown when the requested operation is invalid.
- /// Example set.
- /// Model.
- public IModel Generate(IEnumerable