Classification Problem
PR3S1D3NT
New Altair Community Member
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.
Tagged:
0
Answers
-
Hello, @PR3S1D3NTLet'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.1
-
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.2