[SciPy-Dev] sparse rmatvec and maxentropy

Skipper Seabold jsseabold at gmail.com
Thu Jan 20 09:13:22 EST 2011


On Tue, Jan 18, 2011 at 8:12 PM,  <josef.pktd at gmail.com> wrote:
> On Tue, Jan 18, 2011 at 8:05 PM,  <josef.pktd at gmail.com> wrote:
>> I don't know much about these two parts of scipy.
>>
>> Running an example for scipy.maxentropy raises an exception after
>> upgrading to scipy trunk
>>
>> I didn't manage to find out with a  Trac search whether rmatvec still exists.
>>
>> scipy.maxentropy maxentutils is still using it.
>>
>>
>> Traceback (most recent call last):
>>  File "C:\Josef\eclipsegworkspace\statsmodels-josef-experimental-gsoc\scikits\statsmodels\sandbox\examples\example_maxent.py",
>> line 29, in <module>
>>    model.fit(K[i])
>>  File "\Programs\Python25\Lib\site-packages\scipy\maxentropy\maxentropy.py",
>> line 226, in fit
>>  File "\Programs\Python25\Lib\site-packages\scipy\optimize\optimize.py",
>> line 636, in fmin_cg
>>  File "\Programs\Python25\Lib\site-packages\scipy\optimize\optimize.py",
>> line 176, in function_wrapper
>>  File "\Programs\Python25\Lib\site-packages\scipy\maxentropy\maxentropy.py",
>> line 420, in grad
>>  File "\Programs\Python25\Lib\site-packages\scipy\maxentropy\maxentropy.py",
>> line 702, in expectations
>>  File "\Programs\Python25\Lib\site-packages\scipy\maxentropy\maxentropy.py",
>> line 737, in pmf
>>  File "\Programs\Python25\Lib\site-packages\scipy\maxentropy\maxentropy.py",
>> line 719, in logpmf
>>  File "\Programs\Python25\Lib\site-packages\scipy\maxentropy\maxentutils.py",
>> line 381, in innerprodtranspose
>>  File "C:\Josef\_progs\Subversion\scipy_trunk_g09\dist\scipy-0.10.0.dev7027.win32\Programs\Python25\Lib\site-packages\scipy\sparse\base.py",
>> line 384, in __getattr__
>>    raise AttributeError(attr + " not found")
>> AttributeError: rmatvec not found
>
> 3 of the 4 examples in scipy/maxentropy/examples raise an exception. 2
> of them with the rmatvec not found error. The other one doesn't find
> scipy.sandbox
>

I remember seeing the deprecation warnings for this now, but I never
worked much with the bigmodel.  I think you can just use * now instead
of the rmatvec for the sparse matrices.  You can see this in 0.8.0
where both are still there.

http://projects.scipy.org/scipy/browser/tags/0.8.0/scipy/sparse/base.py

I picked up the montecarlo code when I was playing around with these.

http://bazaar.launchpad.net/~jsseabold/statsmodels/statsmodels-skipper-maxent/files/head:/scikits/statsmodels/sandbox/maxentropy/

I'm curious if the maxentropy stuff as it is in scipy wouldn't find
more use and maintenance in scikits.learn.  The implementation is
somewhat use specific (natural language processing), though this is
not by any means set in stone.

Skipper



More information about the SciPy-Dev mailing list