how to convert IPs to vector values

Viewed 1740

i have a dataset

in machine learning we use Tf-Idf for making a vectors from Text data

but i am not able to pass this value in Tf-idf

here is the data

   remote_ip            datetime1              user_name
   192.168.1.19     2020-01-01 11:00:03          RON
   192.168.1.14     2020-01-01 11:00:04          JOHN
   192.168.1.195    2020-01-01 11:00:05          SAM
   192.168.1.120    2020-01-01 11:00:06          PILL
   192.168.1.119    2020-01-01 11:00:07          ARR
   192.168.1.119    2020-01-01 11:00:08          ARR

here is what i want to do

i set all these values(vector Type values) manually ( so that you will understand what i want)

 remote_ip    datetime1         user_name
-0.7843         -0.1231          -0.5232
 0.2313         -0.4232          -0.5833
 0.3451         -0.1243          -0.5239
-0.5618         -0.1234          -0.6735
-0.2134         -0.1235          -0.5236
-0.2134         -0.5236          -0.5238

first time asking the error so please ignore the errors (maybe there are some format error and all)

help will be appreciated

Thanks

1 Answers
  • you should transform date to columns which refer to (year,months,days,hours,minutes,seconds)
  • LabelEncodeing for user_name
  • transform IP into 4 columns.

and you don't need to use tf-idf in this case as all values will be numbers and valid to modeling

Related