MovieLens (Julia) Laboratorio de implementación #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solución al ejercicio de 'Movielens' utilizando Julia.
`using CSV
using DataFrames
using Base.Threads
using BenchmarkTools
using Printf
Procesa registros en chunks, combina géneros y guarda en archivos de salida
function process_records(records, output_index)
# Guardar el chunk en un archivo CSV
output_filename = "./movielens/ratings_$(lpad(output_index, 1, '0')).csv"
CSV.write(output_filename, records)
end
Función principal que divide el archivo de ratings en chunks y los procesa en paralelo
function Split_Ratings(total_jobs = 10)
# Leer archivos CSV
ratings_df = CSV.read("ratings.csv", DataFrame)
end
function FindRatingsMaster(nF = 10)
#nF number of files with ratings
# kg is a 1D array that contains the Known Genders
kg = ["Action", "Adventure", "Animation", "Children", "Comedy", "Crime", "Documentary",
"Drama", "Fantasy", "Film-Noir", "Horror", "IMAX", "Musical", "Mystery", "Romance",
"Sci-Fi", "Thriller", "War", "Western", "(no genres listed)"]
end #FindRatingsMaster()
function FindRatingsWorker(w::Integer, ng::Integer, kg::Array, dfm::DataFrame, dfr::DataFrame)
println(" El Worker ", w, " está procesando Ratings con Movielens.")
end
function main(execute_split::Bool)
println("\nIniciando la función de partición:")
@time Split_Ratings()
end
Main Function
@time main(true)`