/** * get particular probability of the conditional probability distribtion of a * node given its parents. * * @param iNode index of the node * @param iParent index of the parent set, 0 <= iParent <= * getParentCardinality(iNode) * @param iValue index of the value, 0 <= iValue <= getCardinality(iNode) * @return probability */ public double getProbability(int iNode, int iParent, int iValue) { return m_Distributions[iNode][iParent].getProbability(iValue); }
/** * get particular probability of the conditional probability distribtion of a * node given its parents. * * @param iNode index of the node * @param iParent index of the parent set, 0 <= iParent <= * getParentCardinality(iNode) * @param iValue index of the value, 0 <= iValue <= getCardinality(iNode) * @return probability */ public double getProbability(int iNode, int iParent, int iValue) { return m_Distributions[iNode][iParent].getProbability(iValue); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ @Override public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Test with test values. * * @param est estimator to be tested * @param test vector with test values * **/ protected Vector<Double> testWithTestValues(Estimator est, Vector<Double> test) { Vector<Double> results = new Vector<Double>(); for (int i = 0; i < test.size(); i++) { double testValue = (test.elementAt(i)).doubleValue(); double prob = est.getProbability(testValue); Double p = new Double(prob); results.add(p); } return results; }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ @Override public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Get a probability estimate for a value * * @param data the value to estimate the probability of * @param given the new value that data is conditional upon * @return the estimated probability of the supplied value */ public double getProbability(double data, double given) { return getEstimator(given).getProbability(data); }
/** * Test with test values. * * @param est estimator to be tested * @param test vector with test values * **/ protected Vector<Double> testWithTestValues(Estimator est, Vector<Double> test) { Vector<Double> results = new Vector<Double>(); for (int i = 0; i < test.size(); i++) { double testValue = (test.elementAt(i)).doubleValue(); double prob = est.getProbability(testValue); Double p = new Double(prob); results.add(p); } return results; }
/** * returns distribution of a node in matrix form with matrix representing * distribution with P[i][j] = P(node = j | parent configuration = i) * * @param nTargetNode index of the node to get distribution from */ public double[][] getDistribution(int nTargetNode) { int nParentCard = m_ParentSets[nTargetNode].getCardinalityOfParents(); int nCard = m_Instances.attribute(nTargetNode).numValues(); double[][] P = new double[nParentCard][nCard]; for (int iParent = 0; iParent < nParentCard; iParent++) { for (int iValue = 0; iValue < nCard; iValue++) { P[iParent][iValue] = m_Distributions[nTargetNode][iParent] .getProbability(iValue); } } return P; } // getDistribution
/** * returns distribution of a node in matrix form with matrix representing * distribution with P[i][j] = P(node = j | parent configuration = i) * * @param nTargetNode index of the node to get distribution from */ public double[][] getDistribution(int nTargetNode) { int nParentCard = m_ParentSets[nTargetNode].getCardinalityOfParents(); int nCard = m_Instances.attribute(nTargetNode).numValues(); double[][] P = new double[nParentCard][nCard]; for (int iParent = 0; iParent < nParentCard; iParent++) { for (int iValue = 0; iValue < nCard; iValue++) { P[iParent][iValue] = m_Distributions[nTargetNode][iParent] .getProbability(iValue); } } return P; } // getDistribution