add tracking of source puzzles
This commit is contained in:
parent
69e7f62f4e
commit
4d9b9bae9b
12
ch09.jl
12
ch09.jl
@ -78,6 +78,12 @@ puzzles[:, names(puzzles, Real)]
|
||||
|
||||
# Code for row subsetting
|
||||
|
||||
df_small = DataFrame(id=1:4)
|
||||
df_small[[1, 3], :]
|
||||
df_small[[true, false, true, false], :]
|
||||
df_small[Not([2, 4]), :]
|
||||
df_small[Not([false, true, false, true]), :]
|
||||
|
||||
df1 = puzzles[:, ["Rating", "Popularity"]];
|
||||
df2 = puzzles[!, ["Rating", "Popularity"]];
|
||||
|
||||
@ -145,9 +151,9 @@ end
|
||||
scatter(ratings, mean_popularities;
|
||||
xlabel="rating", ylabel="mean popularity", legend=false)
|
||||
|
||||
import Loess
|
||||
model = Loess.loess(ratings, mean_popularities);
|
||||
using Loess
|
||||
model = loess(ratings, mean_popularities);
|
||||
ratings_predict = float.(sort(ratings))
|
||||
popularity_predict = Loess.predict(model, ratings_predict)
|
||||
popularity_predict = predict(model, ratings_predict)
|
||||
|
||||
plot!(ratings_predict, popularity_predict; width=5, color="black")
|
||||
|
BIN
puzzles.csv.bz2
Normal file
BIN
puzzles.csv.bz2
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user