/** * Main method for testing this class. * * @param args the options */ public static void main(String[] args) { runEvaluator(new ReliefFAttributeEval(), args); } }
/** * Gets the current settings of ReliefFAttributeEval. * * @return an array of strings suitable for passing to setOptions() */ @Override public String[] getOptions() { Vector<String> options = new Vector<String>(); if (getWeightByDistance()) { options.add("-W"); } options.add("-M"); options.add("" + getSampleSize()); options.add("-D"); options.add("" + getSeed()); options.add("-K"); options.add("" + getNumNeighbours()); if (getWeightByDistance()) { options.add("-A"); options.add("" + getSigma()); } return options.toArray(new String[0]); }
/** * Returns a string describing this attribute evaluator * * @return a description of the evaluator suitable for displaying in the * explorer/experimenter gui */ public String globalInfo() { return "ReliefFAttributeEval :\n\nEvaluates the worth of an attribute by " + "repeatedly sampling an instance and considering the value of the " + "given attribute for the nearest instance of the same and different " + "class. Can operate on both discrete and continuous class data.\n\n" + "For more information see:\n\n" + getTechnicalInformation().toString(); }
getCapabilities().testWithFail(data); updateMinMax(m_trainInstances.instance(i)); findKHitMiss(z); updateWeightsNumericClass(z); } else { updateWeightsDiscreteClass(z);
/** Creates a default ReliefFAttributeEval */ public ASEvaluation getEvaluator() { return new ReliefFAttributeEval(); }
diff = difference(firstI, first.valueSparse(p1), second.valueSparse(p2)); p1++; p2++; } else if (firstI > secondI) { diff = difference(secondI, 0, second.valueSparse(p2)); p2++; } else { diff = difference(firstI, first.valueSparse(p1), 0); p1++;
if (i != instNum) { Instance cmpInst = m_trainInstances.instance(i); temp_diff = distance(cmpInst, thisInst);
getCapabilities().testWithFail(data); updateMinMax(m_trainInstances.instance(i)); findKHitMiss(z); updateWeightsNumericClass(z); } else { updateWeightsDiscreteClass(z);
/** Creates a default ReliefFAttributeEval */ public ASEvaluation getEvaluator() { return new ReliefFAttributeEval(); }
diff = difference(firstI, first.valueSparse(p1), second.valueSparse(p2)); p1++; p2++; } else if (firstI > secondI) { diff = difference(secondI, 0, second.valueSparse(p2)); p2++; } else { diff = difference(firstI, first.valueSparse(p1), 0); p1++;
if (i != instNum) { Instance cmpInst = m_trainInstances.instance(i); temp_diff = distance(cmpInst, thisInst);
/** * Gets the current settings of ReliefFAttributeEval. * * @return an array of strings suitable for passing to setOptions() */ @Override public String[] getOptions() { Vector<String> options = new Vector<String>(); if (getWeightByDistance()) { options.add("-W"); } options.add("-M"); options.add("" + getSampleSize()); options.add("-D"); options.add("" + getSeed()); options.add("-K"); options.add("" + getNumNeighbours()); if (getWeightByDistance()) { options.add("-A"); options.add("" + getSigma()); } return options.toArray(new String[0]); }
/** * Main method for testing this class. * * @param args the options */ public static void main(String[] args) { runEvaluator(new ReliefFAttributeEval(), args); } }
temp = difference( m_classIndex, inst.value(m_classIndex), temp *= (m_weightsByRank[i] / distNorm); } else { temp = difference(m_classIndex, inst.value(m_classIndex), m_trainInstances.instance((int) m_karray[0][i][1]) .value(m_classIndex)); .instance((int) m_karray[0][i][1]); double temp_diffP_diffA_givNearest = difference(m_classIndex, inst.value(m_classIndex), cmp.value(m_classIndex)); temp = difference(j, inst.valueSparse(p1), cmp.valueSparse(p2)); p1++; p2++; } else if (firstI > secondI) { j = secondI; temp = difference(j, 0, cmp.valueSparse(p2)); p2++; } else { j = firstI; temp = difference(j, inst.valueSparse(p1), 0); p1++;
/** * Returns a string describing this attribute evaluator * * @return a description of the evaluator suitable for displaying in the * explorer/experimenter gui */ public String globalInfo() { return "ReliefFAttributeEval :\n\nEvaluates the worth of an attribute by " + "repeatedly sampling an instance and considering the value of the " + "given attribute for the nearest instance of the same and different " + "class. Can operate on both discrete and continuous class data.\n\n" + "For more information see:\n\n" + getTechnicalInformation().toString(); }
temp = difference( m_classIndex, inst.value(m_classIndex), temp *= (m_weightsByRank[i] / distNorm); } else { temp = difference(m_classIndex, inst.value(m_classIndex), m_trainInstances.instance((int) m_karray[0][i][1]) .value(m_classIndex)); .instance((int) m_karray[0][i][1]); double temp_diffP_diffA_givNearest = difference(m_classIndex, inst.value(m_classIndex), cmp.value(m_classIndex)); temp = difference(j, inst.valueSparse(p1), cmp.valueSparse(p2)); p1++; p2++; } else if (firstI > secondI) { j = secondI; temp = difference(j, 0, cmp.valueSparse(p2)); p2++; } else { j = firstI; temp = difference(j, inst.valueSparse(p1), 0); p1++;
temp_diff = difference(i, inst.valueSparse(p1), cmp.valueSparse(p2)); p1++; p2++; } else if (firstI > secondI) { i = secondI; temp_diff = difference(i, 0, cmp.valueSparse(p2)); p2++; } else { i = firstI; temp_diff = difference(i, inst.valueSparse(p1), 0); p1++; temp_diff = difference(i, inst.valueSparse(p1), cmp.valueSparse(p2)); p1++; } else if (firstI > secondI) { i = secondI; temp_diff = difference(i, 0, cmp.valueSparse(p2)); p2++; } else { i = firstI; temp_diff = difference(i, inst.valueSparse(p1), 0); p1++;
temp_diff = difference(i, inst.valueSparse(p1), cmp.valueSparse(p2)); p1++; p2++; } else if (firstI > secondI) { i = secondI; temp_diff = difference(i, 0, cmp.valueSparse(p2)); p2++; } else { i = firstI; temp_diff = difference(i, inst.valueSparse(p1), 0); p1++; temp_diff = difference(i, inst.valueSparse(p1), cmp.valueSparse(p2)); p1++; } else if (firstI > secondI) { i = secondI; temp_diff = difference(i, 0, cmp.valueSparse(p2)); p2++; } else { i = firstI; temp_diff = difference(i, inst.valueSparse(p1), 0); p1++;