sanctus Posted September 15, 2017 Report Posted September 15, 2017 I should not even be allowed to ask this, since I work in coding, but I still struggle to get the reason of existence for classes in data science.In general , I can see the reason why one uses them like this example found everywhere about a pet class and then cat is an instance of it and dog another or they are own classes inherited from the pet class.When you are building ML-models though I don't get it, because say you just make some model with a random forest classifier. So you need your data (if python a dataframe) and your target.I see often classes like DataFrameBuilder or MakeFeatures, but I never understood why making it a class. I mean I can do standard functional approach, read data-->clean it-->select the feature columns--> run model --> analyze models. Or I can use classes like MyDataframe=instance of DataframeBuilder with path to data as input (which can also clean data) and then send class instance MyDataFrame to intialise another class MakeFeatures and then run the model.I am sure I am wrong, but the only difference I see in this 2 approaches is that functional is easier to read (kind of line by line) but messier to maintain, while latter is harder to read (have to look up all class definitions) but easier to maintain.ANyone wants to enlighten me? :-) Quote
sanctus Posted September 15, 2017 Author Report Posted September 15, 2017 Exactly and I am asking why? :-) Quote
sanctus Posted September 15, 2017 Author Report Posted September 15, 2017 No you did not give 2 answers, you asked whether it could be due to inheritance wanted and that it is apparently the industry standard :-) So a "could" and an "apparently" do not answer the question as to why :-) Quote
Maine farmer Posted September 15, 2017 Report Posted September 15, 2017 I think it comes about naturally as a way of sorting information to make it easier to find specific information when needed. Perhaps it is like the way squirrels sort their nutshttps://www.mnn.com/earth-matters/animals/blogs/fox-quirrels-use-chunking-sort-and-organize-their-nuts Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.