TransWikia.com

Interactive Machine Learning App to make Predictions using Descriptors

Mathematica Asked by Nawn on February 25, 2021

I have developed a Machine Learning algorithm that uses 4 chemical descriptors to calculate a chosen chemical property. I would like to create an interactive app on Mathematica (using the manipulate function) to make predictions of the chosen property by inserting values of the 4 descriptors. Currently, I am able to perform this on my notebook using the following code:

pred2o = Predict[trainingSet1, Method -> "NeuralNetwork"]
pred2o[{20, 146, 2.5, 0.55}]
73.3435
pred2o[{100, 100, 100, 0}]
672.989

I would like to be able to convert this same idea into an app that can be accessed outside of this notebook where you can insert chosen values for each of these descriptors and automatically retrieve the predicted value using the developed machine learning algorithm. If possible, I was thinking of having a text box for each descriptor where you can type a numerical value for each, and once you do that the predicted value is shown. For context, the descriptors are Atom Count, Molecular Mass, Radius of Gyration, and Plane of Best Fit Distance, respectively. The output value is Molecular Surface Area. My plan is to have each text box labeled accordingly so that it clear what each text box represents.

I have looked through the Manipulate documentation and have not viewed it being applied to Machine Learning, so if anyone can provide me with the code to do this it would be greatly appreciated.

One Answer

Is this what you had in mind?

idea 1

Manipulate[
 pred2o[{atomCount, molecularMass, radiusOfGyration, 
   planeOfBestFitDistance} ], {atomCount, 20}, {molecularMass, 
  146}, {radiusOfGyration, 2.5}, {planeOfBestFitDistance, 0.55}, 
 ControlType -> InputField]

enter image description here

idea 2

Manipulate[
 
 pred2o[
  {atomCount, molecularMass, radiusOfGyration, planeOfBestFitDistance}]
 
 , {{atomCount, 20}, 2, 120, 1}
 , {{molecularMass, 146}, 26.038`, 822.942`}
 , {{radiusOfGyration, 2.5}, 0.22462`, 10.7024`}
 , {{planeOfBestFitDistance, 0.55}, 0.`, 1.22643`}]

enter image description here

Adding a label to denote the output

Manipulate[
 
 "Molecular Surface Area = " <> ToString[pred2o[
    {atomCount, molecularMass, radiusOfGyration, 
     planeOfBestFitDistance}] ]
 
 , {{atomCount, 20}, 2, 120, 1}
 , {{molecularMass, 146}, 26.038`, 822.942`}
 , {{radiusOfGyration, 2.5}, 0.22462`, 10.7024`}
 , {{planeOfBestFitDistance, 0.55}, 0.`, 1.22643`}]

enter image description here

Correct answer by Conor Cosnett on February 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP