Package org.apache.mahout.cf.taste.common

Examples of org.apache.mahout.cf.taste.common.TasteException


      @Override
      public Recommender buildRecommender(DataModel model) throws TasteException {
        try {
          return new LibimsetiRecommender(model);
        } catch (IOException ioe) {
          throw new TasteException(ioe);
        }

      }
    };
    double score = evaluator.evaluate(recommenderBuilder, null, model, 0.95, 0.1);
View Full Code Here


        if (!future.isDone()) {
          future.get();
        }
      }
    } catch (InterruptedException ie) {
      throw new TasteException(ie);
    } catch (ExecutionException ee) {
      throw new TasteException(ee.getCause());
    }
    executor.shutdown();
  }
View Full Code Here

    Context context = null;
    try {
      context = new InitialContext();
      return (DataSource) context.lookup("java:comp/env/" + dataSourceName);
    } catch (NamingException ne) {
      throw new TasteException(ne);
    } finally {
      if (context != null) {
        try {
          context.close();
        } catch (NamingException ne) {
View Full Code Here

      stmt = conn.prepareStatement(storeMappingSQL);
      stmt.setLong(1, longID);
      stmt.setString(2, stringID);
      stmt.executeUpdate();
    } catch (SQLException sqle) {
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(null, stmt, conn);
    }
  }
View Full Code Here

        return rs.getString(1);
      } else {
        return null;
      }
    } catch (SQLException sqle) {
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

        throw new NoSuchItemException();
      }
     
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving user", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

        doPartialUpdate(updateDiffSQLs[0], itemID, prefDelta, conn);
        doPartialUpdate(updateDiffSQLs[1], itemID, prefDelta, conn);
      }
    } catch (SQLException sqle) {
      log.warn("Exception while updating item diff", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(conn);
    }
  }
View Full Code Here

        itemIDs.add(rs.getLong(1));
      }
      return itemIDs;
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving recommendable items", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

      } finally {
        IOUtils.quietClose(stmt);
      }
    } catch (SQLException sqle) {
      log.warn("Exception while updating/deleting diffs", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(conn);
    }
  }
View Full Code Here

      rs = stmt.executeQuery(diffsExistSQL);
      rs.next();
      return rs.getInt(1) > 0;
    } catch (SQLException sqle) {
      log.warn("Exception while deleting diffs", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.common.TasteException

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.