I am new to python so not sure if this is exactly what you are looking for but ya ig you can use None
so in your function you can set the parameters as X=None,y=None,n=None,rfParams=None....... xgbParams=None
since you are using ensemble() for n
we should write an "if" statement to check if n was specified or is it none
so we can write this:
if n is not None:
mod=ensemble(mods,n)
else:
mod=ensemble(mods)
and then you can do return mod
I hope this helps you