The Predict
function can provide you the information you need.
Start by importing your data into Mathematica. For me, it was easiest to change the file extensions to .txt
and use SemanticImport
.
rawdata = SemanticImport["basins_(L4).txt"] // Normal;
missing = SemanticImport["data_LGs.txt"] // Normal;
Then pull out the subset that with i2=4.
subset = Select[rawdata, #[[6]] == 4 &]
You can now thread your (x0, y0) values to the f1 values:
f1aidata = Thread[subset[[All, 1 ;; 2]] -> subset[[All, 3]]]
At this point you have some choices to make around the Method and Performance Goals you use for the Predict
function. We could go deep in the weeds on this, but I created some training and test data and ran through all the options and found GradientBoostedTrees
was the best compromise between quality and computational time.
f1predictor =
Predict[f1aidata, Method -> "GradientBoostedTrees",
PerformanceGoal -> "Quality"]
With the Predictor you just created, you can run the missing data through it.
f1outputs = f1predictor[#] & /@ missing;
Then combine the inputs and outputs and Join
the lists
f1missingresults = Append[Transpose[missing], f1outputs] // Transpose;
combinedresults = Join[subset[[All, 1 ;; 3]], f1missingresults];
Using a ListDensityPlot
, you get this:
ListDensityPlot[combinedresults, ColorFunction -> "TemperatureMap"]

Looking at the ListPointPlot3D
you can see it isn't perfect, but it is very close.
ListPointPlot3D[combinedresults]

If you want to use this for f2, then follow the same process pulling your data from subset[[All,{1,2,4}]]
and creating a new predictor