File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,11 @@ var predictCmd = &cobra.Command{
9393 fmt .Println ("\n " + apiName + " was last updated on " + apiStart + "\n " )
9494
9595 if predictResponse .ClassificationPredictions != nil {
96- fmt .Println ("Predicted classes:" )
96+ if len (predictResponse .ClassificationPredictions ) == 1 {
97+ fmt .Println ("Predicted class:" )
98+ } else {
99+ fmt .Println ("Predicted classes:" )
100+ }
97101 for _ , prediction := range predictResponse .ClassificationPredictions {
98102 if prediction .PredictedClassReversed != nil {
99103 json , _ := json .Marshal (prediction .PredictedClassReversed )
@@ -104,7 +108,11 @@ var predictCmd = &cobra.Command{
104108 }
105109 }
106110 if predictResponse .RegressionPredictions != nil {
107- fmt .Println ("Predicted values:" )
111+ if len (predictResponse .RegressionPredictions ) == 1 {
112+ fmt .Println ("Predicted value:" )
113+ } else {
114+ fmt .Println ("Predicted values:" )
115+ }
108116 for _ , prediction := range predictResponse .RegressionPredictions {
109117 if prediction .PredictedValueReversed != nil {
110118 json , _ := json .Marshal (prediction .PredictedValueReversed )
Original file line number Diff line number Diff line change @@ -544,7 +544,7 @@ $ cortex predict iris-type irises.json
544544
545545iris-type was last updated on Tuesday, February 14, 2019 at 2:57pm PST
546546
547- Predicted classes :
547+ Predicted class :
548548Iris-setosa
549549```
550550
You can’t perform that action at this time.
0 commit comments