Jump to content
Science Forums

Recommended Posts

Posted

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? :-)

Posted

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 :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...