New question, new post with new subject please.
> Hello again, I take this opportunity to ask you, if I wanted to know the degree of correlation between any pair of attributes, and also between any attribute and the attribute to be classified, how could I do it?
You have two options:
1. use attribute selection
import weka.core.jvm as jvm
from weka.core.converters import load_any_file
from weka.attribute_selection import ASSearch, ASEvaluation, AttributeSelection
jvm.start()
data = load_any_file("/some/where/bolts.arff", class_index="last")
search = ASSearch(classname="weka.attributeSelection.Ranker", options=[])
evaluation = ASEvaluation(classname="weka.attributeSelection.CorrelationAttributeEval",
options=[])
attsel = AttributeSelection()
attsel.search(search)
attsel.evaluator(evaluation)
attsel.select_attributes(data)
print("# attributes: " + str(attsel.number_attributes_selected))
print("attributes (as numpy array): " + str(attsel.selected_attributes))
print("attributes (as list): " + str(list(attsel.selected_attributes)))
print("result string:\n" + attsel.results_string)
jvm.stop()
2. install pww3 from the github repo to take advantage of the the
weka.core.utils module that I just added and use the following code:
import weka.core.jvm as jvm
from weka.core.converters import load_any_file
from weka.core.utils import correlation
jvm.start()
data = load_any_file("/some/where/bolts.arff", class_index="last")
class_values = data.values(data.class_index)
for i in range(data.num_attributes - 1):
att_values = data.values(i)
print(data.attribute(i).name, correlation(att_values, class_values))
jvm.stop()