diff --git a/release-packaging/Examples/dataset/super-simple-1D-example.scd b/release-packaging/Examples/dataset/super-simple-1D-example.scd index 3e8d2b6..010477e 100644 --- a/release-packaging/Examples/dataset/super-simple-1D-example.scd +++ b/release-packaging/Examples/dataset/super-simple-1D-example.scd @@ -36,9 +36,9 @@ Routine{ ( Routine{ 10.do{|i| - ~point.set(0,i * 10); + ~point.set(0,i); s.sync; - ~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + (i * 10) ++ ":" + x).postln}) + ~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + i ++ ":" + x).postln}) } }.play ) @@ -53,6 +53,7 @@ Routine{ ~labels.size({|x| x.asInteger.do{|i| ~labels.getLabel(i.asString,action: {|l|("Label for" + i ++ ":" + l).postln}); + s.sync; };}); }.play ) diff --git a/release-packaging/Examples/dataset/super-simple-1D-example2.scd b/release-packaging/Examples/dataset/super-simple-1D-example2.scd index 5a22bb9..f42cdcc 100644 --- a/release-packaging/Examples/dataset/super-simple-1D-example2.scd +++ b/release-packaging/Examples/dataset/super-simple-1D-example2.scd @@ -39,9 +39,9 @@ Routine{ ( Routine{ 10.do{|i| - ~point.set(0,i * 10); + ~point.set(0,i); s.sync; - ~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + (i * 10) ++ ":" + x).postln}) + ~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + i ++ ":" + x).postln}) } }.play ) @@ -50,12 +50,13 @@ Routine{ ~kmeans.predict(~ds,~labels, {|x| ("Size of each cluster" + x).postln}) -s( +( Routine{ var n; ~labels.size({|x| x.asInteger.do{|i| ~labels.getLabel(i.asString,action: {|l|("Label for" + i ++ ":" + l).postln}); + s.sync; };}); }.play ) diff --git a/release-packaging/HelpSource/Classes/FluidDataSet.schelp b/release-packaging/HelpSource/Classes/FluidDataSet.schelp index 4a3733d..ec85964 100644 --- a/release-packaging/HelpSource/Classes/FluidDataSet.schelp +++ b/release-packaging/HelpSource/Classes/FluidDataSet.schelp @@ -105,6 +105,12 @@ ARGUMENT:: filename Absolute path for the new file ARGUMENT:: action A function to run when the file has been written + +METHOD:: dump +(buggy, please use Print for now) Post the content of the dataset in JSON format in the window by default, but you can supply a custom action instead; + +METHOD:: print +Post an abbreviated content of the dataset in the window by default, but you can supply a custom action instead; ​​ METHOD:: asString ​Responds with the name of the data set as a pretty(ish) string @@ -150,9 +156,11 @@ Routine{ ~ds.print //to post window by default, but you can supply a custom action instead ~ds.dump //likewise //for example +( ~ds.dump{|j| ~dict = j.parseJSON } +) //Now we have a Dictionary of our data and IDs ~dict.postcs