I have a dataset of some (grayscale) images (stored as a list in inputImages
) varying in size and content (this is example data from Wolfram, so you can run the code, too)
inputImages = ExampleData /@ ExampleData["TestImage"];
inputImages = ColorConvert[#, "Grayscale"] & /@ inputImages;(*convert to Grayscale for simplicity*)
I just went ahead and assigned each of those images a individual number via
trainingset = inputImages[[#]] -> # & /@ Range[Length[inputImages]];
I then used Predict
to create a predictor function via
predict = Predict[trainingset, PerformanceGoal -> "Quality"]
For simple testing purposes I used the training data as input via
out = predict /@ inputImages
{24.5, 21.35, 21.35, 21.35, 27.05, . . . 27.35, 27.55, 27.45, 23.8, 26.7}
To my surprise I do not get an output close to the Range[Length[inputImages]]
vector. I tried most available methods for the Predict
function with completely different results but none of them close to the simple ascending list the Predict
function was trained with.
Any suggestions why the results are not closer to Range[Length[inputImages]]
or how to get better predictions?
inputImages = ExampleData /@ ExampleData["TestImage"];
$\endgroup$ – Mr.Wizard Oct 10 '14 at 0:51Classify
instead ofPredict
? $\endgroup$ – Chip Hurst Oct 10 '14 at 20:22Nearest
is better for you since you only have one example for each class. $\endgroup$ – Chip Hurst Oct 10 '14 at 20:29