I am working on a library which will provide functionality to program machine learning algorithms from scratch. It’s in very early stage and contains only basic functionalities, I am working on it. Please go through it once and provide valuable feedback and suggestions.
I wish there was an easier way of commenting on committed code in GitHub!
Some things I noticed with a 5 minute once over…
- Don’t use
func (d *DataFrame)
when you aren’t modifyingd
just usefunc (d DataFrame)
-DataFrame
is a slice and very cheap to pass around. It will make your code cleaner too! (Same with Matrix) -
make(DataFrame, row, row)
is redundant, justmake(DataFrame, row)
is fine - Rather than doing
n := m.Row()
thenfor i := 0; i < n; i++ {
I’d just dofor i := range m {
but YMMV -
ReadCsvMatrix
should be calledReadCSVMatrix
-
ReadCsvMatrix
should return(Matrix, error)
- don’t print errors and returnnil
, return them! -
dropFrist
is spelled wrong -dropFirst
- Advanced:
defer f.Close()
where you are writing tof
can mask errors - you should check the error here
Good luck!
Thanks for providing some feedback, I will make changes suggested by you.
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.