Package Database.Primitives

Examples of Database.Primitives.User


    }

    private void formatUser(String dataLine) {
        String[] splitData = dataLine.split("\\|");
        if (splitData != null) {
            currentUser = new User(strArrayToIntArray(splitData)[0]);
            if (splitData.length == 3) {
                currentUser.setAvgRating(Double.valueOf(splitData[2]));
            }
            users.addUser(currentUser);
View Full Code Here


        Parser nbrParser = new NeighborhoodParser(Main.getOptions().getNeighborhoodFilePath())//alternatively print out users that rated that item
        nbrParser.parse(songs, users);
        FileInputStream file = new FileInputStream(activeUserFile);
        Scanner in = new Scanner(file);
        int line;
        User u;
        while (in.hasNext()) {
            line = Integer.parseInt(in.nextLine());
            u = users.getUser(line);
            if (u == null) {
                System.out.println("Invalid user id");
View Full Code Here

                    //        forall users user
                    int userCount = 0;
                    for (User user : myUsers) {
                        double num = 0, den_l = 0, den_r = 0;
//                        System.out.println("comparing! song: " + i.getID() + " and " + j.getID());
                        User other = otherUsers.getUser(user.getID());
                        if (other == null) {
                            continue;
                        }
                        if (user.rated(i) && other.rated(j)) {
//                            System.out.println("if (user.rated(i) && user.rated(j))! song: " + i.getID() + " and " + j.getID());
                            userCount++;
                            double iTmp = user.getRating(i) - user.getAvgRating();
                            double jTmp = other.getRating(j) - other.getAvgRating();

                            num = iTmp * jTmp;
                            den_l = iTmp * iTmp;
                            den_r = jTmp * jTmp;
                        }
View Full Code Here

TOP

Related Classes of Database.Primitives.User

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.