Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple models vs single model

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?

like image 846
Sinan Avatar asked Jan 20 '12 22:01

Sinan


People also ask

What is a multi model approach?

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.

Is there an advantage to using more than one model to analyze the data?

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.

Should I train a model for each customer or use one model for all of my customers?

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.

What is combining multiple models?

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.


1 Answers

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...

like image 81
Lucian Vasile Avatar answered Sep 20 '22 15:09

Lucian Vasile