-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback #1
base: feedback
Are you sure you want to change the base?
Feedback #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, be aware of the file names you are supposed to use. There are multiple files expected for this assignment. The first one should be 01-gen_collatz.R
(not solution.R
).
Congratulations on passing autograder! 🎉 |
Added the codes for the solutions.
Added contibution declaration
Edited the png files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very informative code. Good job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straight forward code to read and follow.
Not a fan of the many notes in 5-open.R, should be in the README instead. Otherwise, well done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you all were very creative and for each task it is very informative. But perhaps next time when updating the codes add descriptions. I didn't quite know that there's easier way to do the codes especially for task 1 and 2 but as of the other I think you can make it shorter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really love how everything is fully explained here, but I think the actual code overwhelmed by the comments/notes/explanation.
slice_head(n = 10) %>% | ||
select(start) | ||
|
||
top10longest <- as_tibble(t(top10longest)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo transposing the matrix seems like a good idea! I was wondering how you managed to create different colours for each points but I understand now!
if (value == 1) { | ||
break | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing, but this may not be necessary, because the last term in a sequence will be 1 anyways!
Regarding the commit messages, it will be very helpful to write more information or details on what you have committed so it is easier for you to track the changes made |
max_count <- function(seq, start) { | ||
sum(seq > start) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't actually how you should count the number of backtracking in a sequence! Remember that you have to wait until a term goes below the starting number first, then count from there! This is counting immediately from the start!
|
||
max_after_backtrack <- t(max_after_backtrack) | ||
|
||
max_after_backtrack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think printing this is a good idea 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all great work! i really like how detailed it 😀 the only thing i'd like to comment is that explanations on the task5 r file should have been put into the readme instead, and also it would be alright to just show the outputs only on your readme file and link the rcode files. Overall, this is great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow! i didn't think of computing this! it's unique! but maybe the explanations would be more suitable on the readme repo instead of in this r file since essentially r file focuses mainly on writing rcodes only.
y = length) | ||
) + | ||
geom_point() + | ||
geom_point(data = head(backtracks_df, 10), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what went wrong here! You forgot to arrange the backtracks_df
by descending order of length first before using head()
! So it ended up simply highlighting the first 10 rows of backtracks_df instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing happened to the other highlighted points here! You may want to validate that your plot comes out as you expected!
scale_x_continuous( | ||
limits = c(0, 2000)) + | ||
scale_y_continuous( | ||
limits = c(0,100)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! Yes, it is a good idea to zoom in to important points once you have shown the full plot before!
# 2) Creating a scatterplot of the highest value reached in the sequence | ||
|
||
max_after_backtrack_df <- backtracks_df %>% | ||
mutate(max_val_reached = pmap_dbl(list(seq, start), max_val_reached)) | ||
|
||
ggplot(data = max_after_backtrack_df, | ||
aes(x = start, | ||
y = max_val_reached)) + | ||
geom_point() + | ||
geom_point(data = head(max_after_backtrack_df, 10), | ||
aes(colour = factor(start)), | ||
size = 5) + | ||
labs( | ||
title = "The Highest Value Reached in the Sequence", | ||
x = "Starting Integer", | ||
y = "Maximum Value Reached", | ||
colour = "Top 10 Starting Integer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a good idea to use logarithmic scale for the y-axis in here, as the rest of the points are very squished together that it's difficult to see what patterns the other points might have made!
Try adding + scale_y_log10()
to the bottom of this code!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty insightful! The explanation seems to better fit for the README though! Comments are good, but too many of them makes it difficult to look at the code as a whole!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, there are some changes that need to be corrected, but nice work everyone, and love the construction of your README.md.
Task4(Graph 2.1).png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give more information about legend and correct the plot since you've stated more than 1 colour in the legend differ from the dotted plot of black-pink.
y = "Sequence Length", | ||
color = "Parity") + | ||
|
||
theme_minimal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Plot! That is another nice way of using different types of plots, that is using geom_line()
to see the changes of the sequence lengths over a range of starting integers, instead of using geom_point()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool plot! I really appreciate how easy it is to see how even starting integer compares to odd starting integers in terms of sequence length!
Hello, well done on this repo! Here are some general issues I need to point out:
And then personal comments:
Once again, great job! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looking at your team's simple code made me realise how much I overthink on how to code HAHA i learn a lot from your coding style, well done!
readme__1.md
Outdated
max_count <- function(seq, start) { | ||
sum(seq > start) | ||
} | ||
|
||
count_df <- backtracks_df %>% | ||
mutate(count=pmap_int(list(seq,start),max_count)) | ||
|
||
mode_backtrack <- count_df %>% | ||
group_by(count) %>% | ||
summarise(seq_count = n()) %>% | ||
filter(seq_count == max(seq_count)) %>% | ||
pull(count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh! so that's how you do it... got me all stressing for just missing one function to pass the autograde :') great work and neat coding!
even_odd_avg_len <- collatz_df %>% | ||
group_by(parity) %>% | ||
summarise(avg = mean(length)) %>% | ||
arrange(avg) %>% | ||
select(avg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooh! your code is simple and easy to understand! that's so cool how you figure out the code and pass the autograde that fast! well done
👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to
main
since the assignment started. Your teacher can see this too.Notes for teachers
Use this PR to leave feedback. Here are some tips:
main
since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.main
. Click a commit to see specific changes.For more information about this pull request, read “Leaving assignment feedback in GitHub”.
Subscribed: @SyafiqahIsa @BazilahHM19 @Hilalina13 @Fiqah-Alihan