What will be the logic to show top rated item? - rating-system

I want to show items in my website sorted by its rating.
I don't want to show highest rated items by the average of rating. Could anyone suggest some formula to define highest rated item.

You could weight each item's average rating by the number of people who have entered in a rating. This would ensure items with both high number of rating and high average rating would float to the top instead of just items with a singular rating.
projectedRating = item.AverageRating * item.Ratings.Count
Additionally, you could consider normalizing this so it only makes a difference between say 1 and 100 rating applied.
projectedRating = item.AverageRating * Max(item.Ratings.Count, 100)
This way run away votes on an item, even with a low average rating, wouldn't end up on the top all the time.
Outside of that, I think you'll need to provide more information on what basis you'd like to indicate an item is a top item. Total views on it, marking it as most popular, could be an option as well.

Your definition of the score for an item is likely to be a function of:
Average rating
Highest rating, lowest rating
Number of rates
A time weighting

Related

Woocommerce - Is it possible to add a custom number that increases by 1 with each order?

in Woocommerce I am using "Single Products" to create events, and then the Product Addon plugin to add a food menu to each event. The idea is that customers can pre-order & pay food for the event they already have a ticket for. Each Event (= single product) is limit to a certain number of people, which I am solving with the normal stock management.
What I need now in addition, is to automatically assign a table number to each order per Event (= single product). So I basically need a number that increases by 1 with each order for that specific product.
In addition to that, we have two kind of tables: 64 normal tables and 30 high / bar tables. So, ideally, I would need two separate order numbers, one that starts at 1 and goes up to 64 and one that starts at 65 and goes up to 95. Depending on the money value of the order per product, the order should either be assigned to the normal or high / bar tables.
Example 1: Order value is over 50$, so order gets assigned to a normal table, meaning a number from 1-65 gets assigned to the order
Example 2: Order value is under 50$, so order gets assigned to a high / bar table, meaning a number from 65-95 gets assigned to the order
Is that even possible?

Tableau graph average and sum

I have transactional data for a sales team showing the transaction amount per transaction, the sales person for that transaction, his team and his salary. Every row denotes a unique transaction (please refer image). I need to make a team-level graph which shows the correlation between the salary they are paid and the revenue they generate for the company i.e. a simple stacked bar chart with salesTeam name on X axis and amounts on the y axis with every bar representing the total salary and total revenue(Amount) for a team.
In the example I've highlighted team 'Central', for which the salary paid is 25k (10k for salesperson A + 15k for salesperson B) and the revenue they make for the company is 430k. Please note that the salaries for some salespersons may be missing (eg. for E). The issue I'm facing is that sum(Salary) adds up the salaries for every row, so for salesperson A it becomes 20k instead of 10k. I tried avg(Salary) but that doesn't work as Tableau calculates the average for the entire column instead of average per salesperson. How can I solve this issue?
Thanks
Here you have a level of detail problem. Basically, Tableau will calculate a formula at the level of detail of the visualisation, so if salesperson is not in your view it will roll up the equation to calculate at the highest level. This is great when you want a dynamic calculation but that doesn't sound like what you are trying to achieve.
Your best option would be to aggregate the data into Tableau so you only have 1 line per sales person with a total of their revenue for all transactions. This would avoid the complexity of the calculated field (and make Tableau perform better).
However, if this is not possible the good news is the answer is a Level of Detail expression (i recommend doing some reading on this if you havent come across before). Basically, you tell Tableau at what level you want the calculation at.
If I understand you want to calculate the ratio of transaction amount and salary paid for each team.
So create a calculated field as follows:
{ FIXED [Team]
: sum(([Amount]))/
(sum({ FIXED [Sales person]:
AVG([Salary])}))
}
What this does is calculates for each team the ratio between the amount and the salary. The use of the second fixed equation that is nested within it (Salesperson) ensures that the salary is not summed for the number of transactions of a salesperson.
Using this I got a result of 17.2 for Central. Is this what you would expect? Do you need a way to account for salaries that are not known?

How to scale no. of page hits?

I'll start with describing my problem.
I have n pages each with its own popularity factor. Popularity factor is on a scale of 10. Now, I have total page hits for each of the pages with me and I want to use those total page hits for calculating the popularity factor again on a scale of 10.
The total page hits is an absolute number and I have these values for only 1,70,000 pages. The total pages which I have with me is 41,00,000.
Now, my problem is I don't know how to normalize these total page hits for all of the total pages.
I tried doing this:
Popularity factor for each page = Total page hits for all the pages/total no. of pages.
I'll assume that the pages with no data will be having at least 1 total page hits. But that way my denominator becomes really big number and in the process of scaling on a scale of 10, I'm lost.
Can anyone please help with how can I approach it ?
There are several ways to do it. Here are some examples:
Absolute popularity
Find the number of hits of the most popular page.
Assign a popularity score bases on the number of hits compared to the most popular page:
0-10% = popularity 1, 10-20% = popularity 2 and so on.
Relative popularity
Sort all pages according to number of page hits.
Assign a popularity score based on the position in the list:
0-10% = popularity 1, 10-20% = popularity 2 and so on.
Popularity of pages without statistics
I can't give you any advice on how to handle these. If you don't know how many times a page has been accessed it is really hard to give it a popularity score.

A Drupal view to show the top rated node per day, each day for a year?

I have a site with user generated stories. Stories are nodes. Stories are rated with Fivestar.
I want to create a calendar style view to list the top rated story - every day, for the current year. So at the end I will have a list of 365 stories.
I'm not sure how to approach this, any help would be great.
You could make a View that takes a Date argument, where you'll pass a specific day', and return results sorted by Fivestar rating, and limiting the View to 1 result.
Then in your custom calendar, loop over every day, and each time, calling the View and showing the result, which will be the 'top rated' note. Though this might be somewhat overkill, it's suitable for a Block which shows today's current top rated Node. I wouldn't actually use it for a whole month or even year view.
Another option could be, that every 24 hours - and a little past midnight - you use that View to get the top rated note for the previous day, and store or flag it as the top rated.
That way, only 1 Node a day will be flagged or stored, and you could build a view that lists all stored/flagged nodes, ordered by date. Rating is irrelevant here, since the View you ran in Cron already picked up the top rated one. Theme this View as a grid, and maybe with an argument Month, and you are close to a Calendar like Month view of your top rated Nodes per day.
Last option would be to build a View, which gets all nodes, and sort them by rating, and group them by day. Then make sure you only print 1 per group, namely, the top rated one.

Confusion over Google Analytics (GA) Absolute Unique Visitors data

GA Unique Visitors data isn't making sense to me. From the GA FAQ we get the following definition for 'Visits vs. Visitors'
"The initial session by a user during any given date range is considered to be an additional visit and an additional visitor. Any future sessions from the same user during the selected time period are counted as additional visits, but not as additional visitors. "
The part that I can't resolve with the GA graph is "Any future sessions from the same user during the selected time period are counted as additional visits, but not as additional visitors". For the graph below covering a 30-day period, I would understand the GA definition to mean that the data represents uniqueness across all 30 days, right? But if you look at the screen shot below, you see a regular pattern for each week over the 30-day period the report covers. From that, it seems the numbers we are seeing associated with each of the days of the graph (e.g. 3.92% (4142) for Tuesday, September 8) is a count of unique visitors just in the context of that one day - i.e. without correlating their uniqueness to the rest of the days in the 30-day period. If the graph actually showed uniqueness across the 30-day period, I would expect the daily numbers to start high in the early days of the period and decrease over the 30-day period as the number of already-seen visitors (i.e. returning visitors) increases, no?
What am I missing here?
UPDATE
Helpful clue from Jonathan S. below got me on the right track.
I think I understand now what the daily bar graph values mean, but it's a little counter-intuitive and I'd bet not what some others might be assuming as well. The reports states "39,822 Absolute Unique Visitors" at the top, which means just that: over the 30-day period we saw this many uniques. Fair enough. The confusing part is that the daily (or weekly) bar values in the graph below are not mutually exclusive uniques as I had assumed, but are values relative only to the 39,822 total - i.e. there is overlap between the unique visitor counts across any group of days. This means the sum of the daily % values > 100% and the sum of the daily count values > 39,822. The algorithm is: when you visit for the first time in the 30-day period, call that "today", you add 1 to the total (39,822) and 1 to the "today" bar value. When you show up again "tomorrow", you are NOT counted again in the total, but ARE counted as 1 in the "tomorrow" bar value.
alt text http://img.skitch.com/20090922-djti81ejj5gqn575ibf8cj1e8x.jpg
I believe it's just an issue of grouping. The top right of the graph has 3 icons to group by day, week, or month. It's currently grouping by day. So if I visit your site today and come back tomorrow, I'll be counted once for each day.
I tried looking at the month view for one of my sites but it didn't give me much meaningful data. I believe the above should answer your original confusion though.
Is it possible that you're searching for something what isn't existing anymore? Unique Visitors/Visits is old terminology. Check: https://www.seroundtable.com/google-analytics-sessions-users-18424.html
Then check how sessions and users are defined:
Sessions ("ex-visits", it's very detailed): https://support.google.com/analytics/answer/2731565?hl=en&ref_topic=1012046
Users in Google Analytics reporting are defined as "Users who have initiated at least one session during the date range". So IMHO it's not about 30 days, it's about the SELECTED date range.
I hope this helps.

Resources