1
$\begingroup$

Given some data dat, we would like to generate a predictor function. Therefore we use

 pdata = Map[#[[1]] -> #[[2]] &, dat];
 p = Predict[pdata, Method -> "NeuralNetwork", PerformanceGoal -> "Quality"];

If one tries to take the derivative of p[x] via (here as an example at 2.)

 ND[p[x], x, 2.]

Mathematica returns PredictorFunction::bfttype: "Invalid argument x. feature1 is a Numerical feature. How can one perform a derivation of the PredictorFunction?

$\endgroup$

1 Answer 1

1
$\begingroup$

I found it: It is the same case as with the integration of compiled functions. One has to use a wrapper: foo[x_?NumericQ] := p[x]; The function foo can now be differentiated using ND.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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