1
$\begingroup$

I work with the Predict function to train a neural network.

datnn =   Predict[dattrain, Method -> "NeuralNetwork",  PerformanceGoal -> "Quality"];
NNCM = PredictorMeasurements[datnn, dattest];
CP = NNCM["ComparisonPlot"]

One of the outputs is the ComparisonPlot

enter image description here

I want to combine this plot with one other plot, for example :

Row[{CP, 
  ListLinePlot[date[[All, {1, 3}]],  ImageSize -> Large], Frame -> True]

The ImageSize of the ComparisonPlot is different from the other plot. For that reason I want to change the image format of the ComparisonPlot. Who has a suggestion to do this?

$\endgroup$
1
$\begingroup$

Use Show[CP, ImageSize -> Large] instead of CP inside Row.

points = {##, # Cos[#1  #2] + RandomReal[{-.2, .2}]} & @@@ RandomReal[{-2, 2}, {100, 2}];
dattrain = {#1, #2} -> #3 & @@@ points[[;; 80]];
dattest = {#1, #2} -> #3 & @@@ points[[81 ;;]];

datnn =   Predict[dattrain, Method -> "NeuralNetwork",  PerformanceGoal -> "Quality"];
NNCM = PredictorMeasurements[datnn, dattest];
CP = NNCM["ComparisonPlot"];  

Row[{Show[CP, ImageSize -> 300, Frame -> True], 
 ListLinePlot[SortBy[First] @ points[[All, {1, 3}]],
  FrameLabel -> {{"predicted value", None}, {"xvalues", None}}, 
  AspectRatio -> 1, ImageSize -> 300, Frame -> True]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.