From 2ee44f6d858e79dbad5abc2077779ba9d8ba8f08 Mon Sep 17 00:00:00 2001 From: Jim Nelson Date: Wed, 14 Dec 2016 15:40:59 -0600 Subject: [PATCH] Apparently multidimensional arrrays need commas --- scratch2.ps1 | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/scratch2.ps1 b/scratch2.ps1 index 33f1172..7139fc2 100644 --- a/scratch2.ps1 +++ b/scratch2.ps1 @@ -11,7 +11,25 @@ Add-Type -Path $MlDllPath $KMeans = New-Object Accord.MachineLearning.KMeans -ArgumentList 3 -[double[]]$Observations = @( +#[double[]] +$Observations = @( + @(-5, -2, -1), + @(-5, -5, -6), + @( 2, 1, 1), + @( 1, 1, 2), + @( 1, 2, 2), + @( 3, 1, 2), + @(11, 5, 4), + @(15, 5, 6), + @(10, 5, 6) +) + +[int[]]$Labels = $KMeans.Compute($Observations) + +$Labels -join ", " + +#[double[][]]$New = @(,@( 4, 1, 9)) +$New = @( @(-5, -2, -1) @(-5, -5, -6) @( 2, 1, 1) @@ -22,12 +40,11 @@ $KMeans = New-Object Accord.MachineLearning.KMeans -ArgumentList 3 @(15, 5, 6) @(10, 5, 6) ) - -[int[]]$Labels = $KMeans.Compute($Observations) - -$Labels -join ", " - -[double[][]]$New = @(,@( 4, 1, 9)) +$New = @( +# @(5, 2, 3) + @( 4, 1, 9) +) +$New = @(@(5, 2, 3), @( 4, 1, 9)) # Ugh. Trying to find class which Decide() seems to want # [Accord.MachineLearning.MulticlassScoreClassifierBase]