lasso-net / lassonet

Feature selection in neural networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An error when trying to run 'Usage' code in Readme

Wei-weiWang opened this issue · comments

Hi,

I tried to run the code in 'Usage'. However, I encounter this error:

from lassonet import LassoNetClassifierCV
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/dist-packages/lassonet/init.py", line 4, in
from .interfaces import (
File "", line 1
(current_lambda=)
^
SyntaxError: invalid syntax

Could you please tell me why it's like this?

I am unable to reproduce your bug. What is your version of python?

python 3.9

Oh it's because the CV isn't yet pushed to PyPI. I am going to fix a few other bugs and update the PyPI version.

Thank you very much!

Can you test again? run pip install -U lassonet first

Still has this error. Sorry, my python version is 3.7.

What version of lassonet are you installing?

lassonet-0.0.9

I try it successfully, the interface.py in lassonet reports an error here, just remove the equal sign. The code snippet is as follows:
if is_dense and self.model.selected_count() < X.shape[1]: is_dense = False if current_lambda / lambda_start < 2: warnings.warn( f"lambda_start={self.lambda_start:.3f} " "might be too large.\n" f"Features start to disappear at {current_lambda=:.3f}." ) # Here is an error, just remove the equal sign

@Wei-weiWang just upgrade to python 3.8

@louisabraham good job,you can add a runtime environment, Python Version >= 3.8, Torch Version >= 1.11

Thanks!

I just edited the requirements (ac50fae)

Why should torch be >= 1.11 ?

If Torch Version < 1.11, the following error will be reported:

AttributeError: module 'torch' has no attribute 'scatter_reduce'

Indeed, thanks!