-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
33 lines (27 loc) · 891 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Python.Runtime;
using Python.Included;
using Numpy;
using ScikitLearn;
namespace ConsoleExample
{
internal class Program
{
private static async Task InitializeInstallerAsync()
{
Installer.InstallPath = Path.GetFullPath(".");
await Installer.SetupPython();
await Installer.TryInstallPip();
await Installer.PipInstallModule("numpy");
await Installer.PipInstallModule("scikit-learn");
}
static void Main(string[] args)
{
Task.Run(InitializeInstallerAsync).Wait();
var X = np.array(new int[,] {
{ 1, 2 }, { 2, 2 }, { 2, 3 },
{ 8, 7 }, { 8,8 }, { 25, 25 } });
var clustering = new sklearn.cluster.DBSCAN(eps: 3, min_samples: 2).fit(X);
Console.WriteLine(clustering.labels_);
}
}
}