I have a question about MVC. Particularly about models. Suppose that I have a category table in my database. Now I would like to get results both for a single category for detailed view and multiple categories for a listing. Also I may need to query a number of categories for different purposes.
Now the question is; Does it make more sense to have two separate models. Like category model for operations on a single category and categories model operations on multiple categories.
My thinking is that when I am using category
model I don't need additional details for multiple categories. So separating these makes sense to me. But I am not sure.
Any ideas?
A multimodel approach is defined as one in which more than one model-each derived from a different perspective, and utilizing correspondingly distinct reasoning and simulation strategies-are employed.
Combining multiple models While applying one model is good, using many models — an ensemble — is even better, particularly in complex problem domains. Here's why: models simplify. So, no matter how much data a model embeds, it will always miss some relevant variable or leave out some interaction.
The model is well suited for the customer- Learning on irrelevant data can hurt the accuracy of your ML model significantly. By training only on customer data you can make sure that all the training data is relevant and helps your model.
Combining different models is done to improve the performance of deep learning models. Building a new model by combination requires less time, data, and computational resources. The most common method to combine models is by averaging multiple models, where taking a weighted average improves the accuracy.
The thing is that your model should support handling single and multiple record queries.
So my advice is to use one model and develop your methods to retrieve the exact data you need.
Having two models for a single data source only complicates stuff...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With