philomathic-guy / Malicious-Web-Content-Detection-Using-Machine-Learning

Chrome extension for detecting phishing web sites
https://philomathic-guy.github.io/Malicious-Web-Content-Detection-Using-Machine-Learning/
MIT License
236 stars 76 forks source link

Getting error in train.py #2

Closed sayalijangam closed 5 years ago

sayalijangam commented 5 years ago

Hi, Am referring your project but in train.py I getting one error as shown below. **File "E:/Malicious-Web-Content-Detection-Using-Machine-Learning-master/train.py", line 14, in data1 = data1[0:, : -1]

TypeError: list indices must be integers or slices, not tuple**

Also even tried to solve it....I don't get it the use of this snippet data1 = data1[0 : -1] for i in data1: labels.append(i[30])

philomathic-guy commented 5 years ago

Which version of Python are you using?

On Wed, Jan 23, 2019, 11:57 AM sayalijangam <notifications@github.com wrote:

Hi, Am referring your project but in train.py I getting one error as shown below. **File "E:/Malicious-Web-Content-Detection-Using-Machine-Learning-master/train.py", line 14, in data1 = data1[0:, : -1]

TypeError: list indices must be integers or slices, not tuple**

Also even tried to solve it....I don't get it the use of this snippet

data1 = data1[0 : -1] for i in data1: labels.append(i[30])

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rohitnaik246/Malicious-Web-Content-Detection-Using-Machine-Learning/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ARMAL1_OC1kj8qvmLDAGYY7HY0JTDYzoks5vGADLgaJpZM4aOHyt .

sayalijangam commented 5 years ago

3.6.4

philomathic-guy commented 5 years ago

Probably that is the reason. This project was done using Python 2.7. There are certain small differences between the two versions which might cause this issue. Please try with Python 2.7

Thanks and regards, Rohit Naik

On Mon, Jan 28, 2019 at 10:39 AM sayalijangam notifications@github.com wrote:

3.6.4

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rohitnaik246/Malicious-Web-Content-Detection-Using-Machine-Learning/issues/2#issuecomment-458000625, or mute the thread https://github.com/notifications/unsubscribe-auth/ARMALx7QsORy5beW2_2vhc6CAwjEOuuiks5vHoX8gaJpZM4aOHyt .

sayalijangam commented 5 years ago

Now I've done using python 2.7.....but still facing same error``

You can see error using above link

philomathic-guy commented 5 years ago

Hi Sayali, It seems to be working fine on my end. I tried replicating the situation with a much smaller data set just for representation purpose.

screen shot 2019-01-30 at 6 18 02 pm screen shot 2019-01-30 at 6 18 21 pm
  1. Are you sure you are using Python 2.7 and not 3.x? There is a difference in how the file splitting is done in both so it is necessary that you have the correct version of Python. Otherwise you might face problems later as well. For Python3, data_list = file.split('\n') works but for Python2 data_list = file.split('\r\n') is needed for the correct split.
  2. Can you please let me know what do you get for data1.shape similar to what I have done? That is probably the reason why you are getting that error, i.e. due to the mismatch of dimensions of the np array.
  3. Also, please do a git pull and run this newly added file temp.py on your end and please attach the results if the problem persists.

Thanks

philomathic-guy commented 5 years ago

I have revamped the entire project to remove certain deprecated method calls, improved certain aspects of the code. Please do a git pull on the project and try running it according to the steps for reproducing the project.

Thanks

philomathic-guy commented 5 years ago

Since, there has been no reply to this thread, I am closing it. Kindly open up another issue if there is any other problem. Thanks!