Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Optimizing a model output (Y) with some (X) parameters defined
Hi Everyone,
(Disclaimer: I am quite a beginner onPython and Data Science in general… Smile )

I have designed and published my 1st kernel on Kaggle (here:, based on a nice industrial Kaggle dataset (and this is not for a specific competition, just for fun).

So I now have a model which I can run to to predict a "Y" (%silicate rate) according to 10 parameters (Xs).
Note: the Xs input is an array like this:
[[-0.33660127 0.61050275 -0.19441589 -0.1988209 0.3357553 0.16947863 0.11750669 -0.09867687 0.29995688 0.03718947]]
Now I would like to:
1/ find a way to define the values of the 10 Xs to reach a specific Y value
2/ find a way to set values for some Xs (let's say 4 out of 10), set my Y target… and get the corresponding values for the remaining Xs, like this:
[[-0.3 (defined) X2? X3? X4? X5? 0.2 (defined) X7? X8? 0.4 (defined) 0.05(defined)]]
I have tried to convert the model into a function and optimize it but it does not get me anywhere (probably by a lack of knowledge), like this:

filename = 'mining_model.sav'
gbr = pickle.load(open(filename, 'rb'))

# Parameters Optimization
def gbr_function(x):
    y = gbr.predict(x)
return y

… and then I tried some different optimization algorithms from "scipy.optimize" with no luck…
Anyone who could guide me a bit on how to do that?

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Distance between 2 user defined geo-grids in km chandrakant98c 0 129 Jun-16-2019, 11:26 AM
Last Post: chandrakant98c
  Apply function on different columns as defined DavidGG 5 410 Jun-03-2019, 01:12 PM
Last Post: ichabod801
  Manage Iges Cad Model achilledue 0 132 May-20-2019, 06:45 PM
Last Post: achilledue
  save parameters an data from image to csv pifko22 0 139 Apr-02-2019, 10:22 PM
Last Post: pifko22
  Parallelizing Run ARIMA Model wissam1974 0 180 Mar-02-2019, 07:20 PM
Last Post: wissam1974
  arima model error in python wissam1974 0 444 Jan-23-2019, 09:37 AM
Last Post: wissam1974
  Saving PyTorch model kiton 3 660 Nov-24-2018, 01:38 AM
Last Post: kiton
  [neural netrowks]How do i resume training once i have saved the model Prince_Bhatia 0 479 Aug-07-2018, 05:01 AM
Last Post: Prince_Bhatia
  Multiprocessing with loading well-trained model. (via Python3) Chris2013 0 453 Jun-06-2018, 06:48 AM
Last Post: Chris2013
  Model.predict() always returning the same value of 1 for opencv nastyheatnor 0 1,616 Dec-14-2017, 08:20 AM
Last Post: nastyheatnor

Forum Jump:

Users browsing this thread: 1 Guest(s)