def factorize_space(self, threshold=<NUM_LIT>, printOut=False, views=None):
M = len(self.bgplvms)<EOL>if views is None:<EOL><INDENT>if M is not <NUM_LIT:2>:<EOL><INDENT>raise NotImplementedError("<STR_LIT>")<EOL><DEDENT>obsMod = [<NUM_LIT:0>]<EOL>infMod = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>obsMod = views[<NUM_LIT:0>]<EOL>infMod = views[<NUM_LIT:1>]<EOL><DEDENT>scObs = [None] * len(obsMod)<EOL>for i in range(<NUM_LIT:0>,len(obsMod)):<EOL><INDENT>scObs[i] = np.atleast_2d(self.bgplvms[obsMod[i]].kern.input_sensitivity(summarize=False))[<NUM_LIT:0>]<EOL>scObs[i] /= np.max(scObs[i])<EOL><DEDENT>scInf = np.atleast_2d(self.bgplvms[infMod].kern.input_sensitivity(summarize=False))[<NUM_LIT:0>]<EOL>scInf /= np.max(scInf)<EOL>retainedScales = [None]*(len(obsMod)+<NUM_LIT:1>)<EOL>for i in range(<NUM_LIT:0>,len(obsMod)):<EOL><INDENT>retainedScales[obsMod[i]] = np.where(scObs[i] > threshold)[<NUM_LIT:0>]<EOL><DEDENT>retainedScales[infMod] = np.where(scInf > threshold)[<NUM_LIT:0>]<EOL>for i in range(len(retainedScales)):<EOL><INDENT>retainedScales[i] = [k for k in retainedScales[i]] <EOL><DEDENT>sharedDims = set(retainedScales[obsMod[<NUM_LIT:0>]]).intersection(set(retainedScales[infMod]))<EOL>for i in range(<NUM_LIT:1>,len(obsMod)):<EOL><INDENT>sharedDims = sharedDims.intersection(set(retainedScales[obsMod[i]]))<EOL><DEDENT>privateDims = [None]*M<EOL>for i in range(<NUM_LIT:0>,len(retainedScales)):<EOL><INDENT>privateDims[i] = set(retainedScales[i]).difference(sharedDims)<EOL>privateDims[i] = [k for k in privateDims[i]]        <EOL><DEDENT>sharedDims = [k for k in sharedDims]                    <EOL>sharedDims.sort()<EOL>for i in range(len(privateDims)):<EOL><INDENT>privateDims[i].sort()<EOL><DEDENT>if printOut:<EOL><INDENT>print('<STR_LIT>' + str(sharedDims))<EOL>for i in range(len(retainedScales)):<EOL><INDENT>print('<STR_LIT>' + str(i) + '<STR_LIT::>' + str(privateDims[i]))<EOL><DEDENT><DEDENT>return sharedDims, privateDims<EOL>
Given a trained MRD model, this function looks at the optimized ARD weights (lengthscales)
and decides which part of the latent space is shared across views or private, according to a threshold.
The threshold is applied after all weights are normalized so that the maximum value is 1.