Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I have a neural network model (model.predict in code) which fitted our data, and now we want optimized some variables that exist in the model. my code are attached below,

def objective_function(X):
  wob   = X[0]
  torque= X[1]
  RPM   = X[2]
  pump  = X[3]
  input = pd.DataFrame(wob,torque,RPM, 0.00017,0.027,pump,0,0.5,0.386,0.026,0.0119,0.33,0.83,0.48)
  obj= model.predict(input)
  return obj


I want to know my function code is correct or not?

What I have tried:

you can see the code, I attached the code. I'm not expert in python, unfortunately.
Posted
Updated 9-Feb-22 23:23pm
v2
Comments
Richard MacCutchan 10-Feb-22 5:47am    
"I want to know my function code is correct or not?"
What results does it produce?
Member 15530401 10-Feb-22 8:17am    
I want to use this function as a function of the simulated annealing algorithm for optimization 4 variables (wob, torque, RPM, pump). Describing function is my first stage for using the SA algorithm. I want to know, describing functions like the above code, is correct or not. for example, I introduce input in dataframe format for the entrance of neural network (model. predict), I want to know, all of these are correct or have a problem somewhere.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900