Skip to content

Trouble running mixed.py #2

@jc-healy

Description

@jc-healy

Hi there,

After reading your paper I'm very excited to give your GLRM code a try but am having trouble getting it running. I hit some dependency trouble with cvxpy and got around it by using "conda install -c https://conda.anaconda.org/omnia cvxpy" which might be handy to add to your readme.

When I try and run your example in mixed.py I initially get an "ImportError: cannot import name unroll_missing" I noticed that it was commented out of your util.py so dropped it from the script.

My error is now unfortunately in glrm.fit() here is the code snippet and error. Any idea how I might get this running?

A = [data_real, data_ord, data_bool]
loss = [QuadraticLoss, OrdinalLoss, HingeLoss]
regX, regY = QuadraticReg(0.01), QuadraticReg(0.01)
converge = Convergence(TOL = 1e-2, max_iters = 1000) # optional (default TOL = 1e-3)
glrm_mix = GLRM(A, loss, regX, regY, k, converge = converge)
glrm_mix.fit()

AttributeError                            Traceback (most recent call last)
<ipython-input-14-99b26bc6fae3> in <module>()
----> 1 glrm_mix.fit()

/home/towermint/anaconda3/envs/py2/lib/python2.7/site-packages/GLRM-0.0.1-py2.7.egg/glrm/glrm.pyc in fit(self, max_iters, eps, use_indirect, warm_start)
     64             self.converge.obj.append(objX)
     65 
---> 66         self._finalize_XY(Xv, Yv)
     67         return self.X, self.Y
     68 

/home/towermint/anaconda3/envs/py2/lib/python2.7/site-packages/GLRM-0.0.1-py2.7.egg/glrm/glrm.pyc in _finalize_XY(self, Xv, Yv)
    162     def _finalize_XY(self, Xv, Yv):
    163         """ Multiply by std, offset by mean """
--> 164         m, k = Xv.shape.size
    165         self.X = asarray(hstack((Xv.value, ones((m,1)))))
    166         self.Y = [asarray(yj.value)*tile(mask[0,:],(k+1,1)) \

AttributeError: 'Variable' object has no attribute 'shape'

Cheers,
John

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions