I'm new to Julia and I have written a simple task that calculates RMSE (Root Earth Square Error) . There is a matrix of EDIT: After avoiding global variables, it is over in the 1990s (31x slower than Java). Some suggestions: Ratings ratings, each line is
[user, movie, rating] . The 15 million rating is
rmse () The method takes 12.0 s, but the Java implementation is approximately 188x faster: 0.064 s Why is Julia implementation slow? In Java, I am working with an array of the
rating object, if it was a multidimensional
int array, it would be faster. Returns (User, Film) Returns 3.462 and Function RMSE (Total) = 0.0 I in 1: Size (ratings, 1) R =
Ratings = Reddel M ("Ratings Data", Int 32) Rating [i,:] Diff = predict (r [1], r [2]) - r [3] Total + = diff * Difference end return sqrt (Total / Size (rating) [1]) End
r = Rating [i ,:] After removing it, it is 0.856 s (13x slow).
rating as an argument.
r = Rating [i ,:] creates a copy that is slow, instead of
predict (r [i, 1], r [i, 2]) - r [i, 3] .
class ()
x * x .
No comments:
Post a Comment