Classification Problem

PR3S1D3NTPR3S1D3NT Member Posts: 1 Newbie
edited February 2019 in Help
Hi
I using the K-NN algorithm to classification.
my learning data has 3 dimensions and like this:

Learning Data:
Username(Polynomial),Count_of_connections(Integer), Destination_IP(Polynomial), Status (as label)
Alex, 100, 172.16.1.11,normal
Alfred,8,172.16.10.50, anomaly
Mat, 200, 172.16.5.1 , normal
Angelo, 50, 172.16.4.11, normal

Test Data:
Alexis, 8 , 172.16.1.10

Result:
Alexis, 8 , 172.16.1.10, normal

I want to the algorithm do not compare text in username and Destination_IP and decide based on Count_of_Connections only.
It means the characters of Username and Destination_IP values most not effect on algorithm and this dimensions considered as unit entity, i don't know how solve this problem!
thanks friends.





Answers

  • rfuentealbarfuentealba Moderator, RapidMiner Certified Analyst, Member, University Professor Posts: 568 Unicorn
    Hello, @PR3S1D3NT

    Let's see if I get this straight.

    You have four columns: Polynominal, Integer, Polynominal and Binominal as label.

    I would do this:

    1.- Add the Multiply operator in front of your Retrieve Data operator, so that the information doesn't get destroyed upfront.
    2.- Assign the ID role to the username (as it identifies the row). Your mileage might vary, you may as well use step 3 to take it out.
    3.- Use Select Attributes with the include special attributes parameter turned on, and select the Username, the Connections Count and your label.
    4.- Train your algorithm and go ahead with it.

    I am feeling quite burned out lately, so I did something quick with the Titanic dataset instead of trying to mimick your data. Notice that this example doesn't have an ID so I used Generate ID, but you should use Set Role to change the role of your Username column instead.



    Why this?

    Columns with an ID role aren't considered for training algorithms, and they are useful for merging your results later on if you need some more information that you filtered with the Select Attributes operator. You may as well skip the Multiply operator if you don't need it, though.

    Hope this helps,

    All the best,

    Rodrigo.

  • kypexinkypexin Moderator, RapidMiner Certified Analyst, Member Posts: 291 Unicorn
    Hi @PR3S1D3NT

    Just my 5 cents to add to Rodrigo's detailed answer. All models are using only attributes of type 'regular' for training and predictions, so to quickly exclude any variables subset from modelling I often use this type of hack when I change unwanted variables type from regular to 'id' or 'cluster', and convert them back to 'regular' afterwards.
Sign In or Register to comment.