Revize abfd9c7c
Přidáno uživatelem Roman Kalivoda před téměř 4 roky(ů)
Server/ServerApp/Predictor/IPredictor.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Microsoft.ML; |
|
7 |
using Microsoft.ML.Data; |
|
8 |
|
|
9 |
namespace ServerApp.Predictor |
|
10 |
{ |
|
11 |
interface IPredictor |
|
12 |
{ |
|
13 |
|
|
14 |
void Fit(ModelInput trainInput); |
|
15 |
|
|
16 |
void Predict(ModelInput testInput); |
|
17 |
} |
|
18 |
} |
Server/ServerApp/Predictor/ModelInput.cs | ||
---|---|---|
1 |
namespace ServerApp.Predictor |
|
2 |
{ |
|
3 |
public class ModelInput |
|
4 |
{ |
|
5 |
protected class DataPoint |
|
6 |
{ |
|
7 |
public uint Label { get; set; } |
|
8 |
|
|
9 |
public float[] Features { get; set; } |
|
10 |
} |
|
11 |
} |
|
12 |
} |
Server/ServerApp/Predictor/NaiveBayesClassifier.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Microsoft.ML; |
|
7 |
|
|
8 |
namespace ServerApp.Predictor |
|
9 |
{ |
|
10 |
class NaiveBayesClassifier : IPredictor |
|
11 |
{ |
|
12 |
private MLContext mlContext; |
|
13 |
|
|
14 |
public NaiveBayesClassifier() |
|
15 |
{ |
|
16 |
mlContext = new MLContext(); |
|
17 |
|
|
18 |
} |
|
19 |
|
|
20 |
public void Fit(ModelInput trainingData) |
|
21 |
{ |
|
22 |
throw new NotImplementedException(); |
|
23 |
} |
|
24 |
|
|
25 |
public void Predict(ModelInput testData) |
|
26 |
{ |
|
27 |
throw new NotImplementedException(); |
|
28 |
} |
|
29 |
} |
|
30 |
} |
Server/ServerApp/ServerApp.csproj | ||
---|---|---|
43 | 43 |
<Reference Include="System.Xml" /> |
44 | 44 |
</ItemGroup> |
45 | 45 |
<ItemGroup> |
46 |
<Compile Include="Predictor\IPredictor.cs" /> |
|
47 |
<Compile Include="Predictor\ModelInput.cs" /> |
|
48 |
<Compile Include="Predictor\NaiveBayesClassifier.cs" /> |
|
46 | 49 |
<Compile Include="obj\Debug\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs" /> |
47 | 50 |
<Compile Include="Parser\InputData\CsvDataLoader.cs" /> |
48 | 51 |
<Compile Include="Parser\InputData\JisInstance.cs" /> |
Server/ServerApp/packages.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<packages> |
|
3 |
<package id="Microsoft.ML" version="1.5.5" targetFramework="net472" /> |
|
4 |
<package id="Microsoft.ML.CpuMath" version="1.5.5" targetFramework="net472" /> |
|
5 |
<package id="Microsoft.ML.DataView" version="1.5.5" targetFramework="net472" /> |
|
6 |
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net472" /> |
|
7 |
<package id="System.Buffers" version="4.4.0" targetFramework="net472" /> |
|
8 |
<package id="System.CodeDom" version="4.4.0" targetFramework="net472" /> |
|
9 |
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" /> |
|
10 |
<package id="System.Memory" version="4.5.3" targetFramework="net472" /> |
|
11 |
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" /> |
|
12 |
<package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net472" /> |
|
13 |
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" /> |
|
14 |
<package id="System.Threading.Channels" version="4.7.1" targetFramework="net472" /> |
|
15 |
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> |
|
16 |
</packages> |
Také k dispozici: Unified diff
Add packages.config, add Predictors
Stub model component