Package org.apache.mahout.classifier.bayes.exceptions

Examples of org.apache.mahout.classifier.bayes.exceptions.InvalidDatastoreException


      if (column.equals("sigma_j"))
        return getSigma_jFromHbase(row);
      else
        return getWeightFromHbase(row, column);
    } else
      throw new InvalidDatastoreException();
  }
View Full Code Here


      if (index.equals("vocabCount"))
        return getVocabCountFromHbase();
      else if (index.equals("sigma_jSigma_k"))
        return getSigma_jSigma_kFromHbase();
      else
        throw new InvalidDatastoreException();

    } else if (vectorName.equals("labelWeight")) {
      return getWeightFromHbase(BayesConstants.LABEL_SUM, index);
    } else if (vectorName.equals("thetaNormalizer")) {
      return getWeightFromHbase(BayesConstants.LABEL_THETA_NORMALIZER, index)
          / thetaNormalizer;
    } else if (vectorName.equals("params")) {
      if(index.equals("alpha_i")) return alpha_i;
      else throw new InvalidDatastoreException();
    } else {

      throw new InvalidDatastoreException();
    }
  }
View Full Code Here

        return sigmaJ.get(getFeatureID(row));
      } else {
        return weightMatrix.getQuick(getFeatureID(row), getLabelID(column));
      }
    } else {
      throw new InvalidDatastoreException("Matrix not found: " + matrixName);
    }
  }
View Full Code Here

      if ("sigma_jSigma_k".equals(index)) {
        return sigmaJsigmaK;
      } else if ("vocabCount".equals(index)) {
        return featureDictionary.size();
      } else {
        throw new InvalidDatastoreException();
      }
    } else if ("thetaNormalizer".equals(vectorName)) {
      return thetaNormalizerPerLabel.get(getLabelID(index)) / thetaNormalizer;
    } else if ("params".equals(vectorName)) {
      if ("alpha_i".equals(index)) {
        return alphaI;
      } else {
        throw new InvalidDatastoreException();
      }
    } else if ("labelWeight".equals(vectorName)) {
      return sigmaK.get(getLabelID(index));
    } else {
      throw new InvalidDatastoreException();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.classifier.bayes.exceptions.InvalidDatastoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.