EdwardRaff / JSAT

Java Statistical Analysis Tool, a Java library for Machine Learning
GNU General Public License v3.0
789 stars 205 forks source link

[Question] Disable certain comparisons? #61

Closed kalebmmm closed 7 years ago

kalebmmm commented 7 years ago

Is there a way to only use certain comparisons or change weighting so that inconclusive classifications aren't being accounted for?

If I'm confusing you, here's what I mean (Screenshot from weka): http://prnt.sc/ea3ogz Plots I squared in red are okay for classification and I want to use them while I have some (In black) that don't classify well (or at all for that matter) and therefore I don't want to use those. How would I go about doing that?

My data setup is 5 numerical datas and a class. I'm using a LVQ classifier.

EdwardRaff commented 7 years ago

That plot does not help explain. What is being plotted?

Are you referring to down weighting/removing certain features?

Are you asking to down weight / ignore certain data points at test time?

kalebmmm commented 7 years ago

Here's a snippet of the CSV where c is my class.

Vx, vy, and vz have no relationship with each other, but they do with y and p so I can't remove those completely. Take Iris for example, the sepal and petal's length and width don't have any mixups when plotted while vx,vy, and vz in my screenshot are just jumbled garbage (That's what I had circled in black). I need those features for y and p's sake, but they don't work when compared together.

Here's vx compared to vy (This is bad - No clear categories) Here's vx compared to y (This is good - 2 clear categories)

y,p,vx,vy,vz,c
172.6308,24.489506,0.037431074933626206,72.1707870772188,224.8595430808245,VANILLA

Since vx,vy, and vz don't show any clear categories among each other, is there a way to weight or handle them differently? I'm only looking to downweight if that will solve the problem, and I don't want to remove those features as they give y and p categories.

I apologize for being so vague, it's just stuff I have to try not to share.

EdwardRaff commented 7 years ago

Ok, so you are talking about weighting / removing features.

Under jsat.datatransform you will find a number of methods that can perform automatic feature selection (particularly, jsat.datatransform.featureselection), or you can manually specify the features to remove.

Since you are using a distance metric, you can also just multiply the features you are using by some constant to change their weights. Distance metrics are scale sensitive. If you for some reason really just want to manually specify the weights, but not change the data, you can use the WeightedEuclideanDistance class to give in a weight vector to apply to each dimension.