prmr / Creco

Recommendation System for Consumer Products
Apache License 2.0
6 stars 2 forks source link

Add Sliders to Features Form #111

Closed enewe101 closed 10 years ago

enewe101 commented 10 years ago

@asutcl @MariamN :

I have an idea, I want to know if you'd be interested.

I really do think the sliders would be a great thing to get in for the release. But it's a big job. I think that maybe we could split this task up to make it realistic, and I want to propose a split.

Firstly @MariamN , I think you're already working on this? Could you post whether that's the case, and if so maybe tell us what you've done already?

The split I was thinking was along the lines of: 1) Handle all aspects having to do with the slider control itself, and making a well-formed request to Creco. Also, make the features form aware of the Attribute ids, not just there names, so that this can be sent in the request. 2) Perform all necessary changes within the call to ConcreteServiceFacade.sendFeaturesList() as well as all the methods/classes that it delegates to, except for the handling of scoring used in ProductRanker 3) Alter the ProductRanker (or, perhaps just write an alternative one and make use of inheritance) so that it takes the user's expression of interest (slider position) into account, in a way that is mathematically sound and behaves well.

So basically item 2) is the meat of the original problem. The point of splitting off 1) and 3) is that it would lighten the burden for the person taking on 2) with a fairly clean division of work (I think).

What do you think @asutcl and @MariamN , and are you interested? Obviously, this might be moot depending, @MariamN , an what you've already done, so maybe you could fill us in. If it is true that you were planning to take on this task, then maybe @asutcl and I can make it easier by taking parts 1) and 3) ?

asutcl commented 10 years ago

As I said in #99 I would be much more comfortable with the back end work so 2) and 3). It wouldn't take me too long either. I've already done part of the work but I stashed it. 1) on the other hand I haven't touched much of all of the semester. It would take me much longer to do any work on there than someone who has.

The issue is I can't work on this over the weekend and I have little time next week. So I basically need to get done most of what I can do today.

@MariamN, if you could just take a few minutes today to post what you are working on, where you are at and when you expect to finish it, that would help a lot with organisation.

enewe101 commented 10 years ago

Ok, I'm happy in the world of JS so I'd love to do the front-end part and make the actual slider controls (1)

MariamN commented 10 years ago

@enewe101 @asutcl Yes I'm currently working on the sliders, I have my code in branch issue101, feel free to check it out. Basically, I have the sliders in place initialized by the correlation score. The things left is to take the user input (interaction with the slider) and pass it to the backend in json message and do the necessary changes to the back end and include this variable in the product ranker.

I don't have a problem with the division you suggested. I can continue working on (1) and incorporate the attributes ids as well, or I can work on 2 or 3, as I'm comfortable with the back end too.

Let me know what you guys think?

asutcl commented 10 years ago

Ok that's good. I will start the back end this afternoon and finish it by tonight. It would help though if the message passed back could have a structure that links the ids and the values.

Also, we could just initialise the overall score to max value and all others to 0, and have that be passed as soon as you pick the category. That way we get a simple default that shows up after the category pick, which would correspond to overall score ranking. This will also show the Overall bar graph. What do you all think?

On 17 April 2014 13:06, Mariam Nouh notifications@github.com wrote:

@enewe101 https://github.com/enewe101 @asutclhttps://github.com/asutclYes I'm currently working on the sliders, I have my code in branch issue101, feel free to check it out. Basically, I have the sliders in place initialized by the correlation score. The things left is to take the user input (interaction with the slider) and pass it to the backend in json message and do the necessary changes to the back end and include this variable in the product ranker.

I don't have a problem with the division you suggested. I can continue working on (1) and incorporate the attributes ids as well, or I can work on 2 or 3, as I'm comfortable with the back end too.

Let me know what you guys think?

— Reply to this email directly or view it on GitHubhttps://github.com/prmr/Creco/issues/111#issuecomment-40737639 .

forgues commented 10 years ago

I like the idea of initializing overall score slider to max value and all others to 0. This gives a clear visual indication that products are ranked according to overall score by default.

I'm also available to make changes for part 3). We could pass around a Map<String, Double> with a key for each attribute ID, where the values represent the weight selected with the slider. If a structure like that is given as a parameter to the ProductRanker, it will be very easy to modify the ranking algorithm to use the attribute weights from this map instead of the attribute weights computed by correlation.

asutcl commented 10 years ago

I will create a wrapper class right now around ScoredAttribute, it will have access to all the same functions but it will also have a user score. Then we will have an interface and we can create those once we have the response and then pass them to the product ranker which would have to through minimal changes since previous functionality will still be available. This wrapper will also have a comparator in order to sort it.

Does sound reasonable?

On 17 April 2014 13:34, Gabriel Forgues notifications@github.com wrote:

I like the idea of initializing overall score slider to max value and all others to 0. This gives a clear visual indication that products are ranked according to overall score by default.

I'm also available to make changes for part 3). We could pass around a Map with a key for each attribute ID, where the values represent the weight selected with the slider. If a structure like that is given as a parameter to the ProductRanker, it will be very easy to modify the ranking algorithm to use the attribute weights from this map instead of the attribute weights computed by correlation.

— Reply to this email directly or view it on GitHubhttps://github.com/prmr/Creco/issues/111#issuecomment-40740653 .

enewe101 commented 10 years ago

Hey guys, I think we might have our roles materializing here. I think that between @MariamN, @asutcl, and @forgues, we have people who are very familiar with the bits of code in 1) 2) and 3) respectively. I'm thinking of stepping out of this issue and suggesting that you three take the issue on with roughly that division.

@asutcl -- your proposal sounds good to me, and that would come as part of 2) anyway. @forgues -- your proposal makes a lot of sense too. So let's agree that's the plan in terms of representing the feature slider positions to the back-end.

Post if you have an issue with this proposal!

For my part, I've got a few other things in mind to work on that I think will be worthwhile.

forgues commented 10 years ago

With @asutcl 's ScoredAttribute wrapper, we shouldn't the map I proposed. I'll wait for changes 1) and 2) to be done, then I can pass a list of the scoredattribute wrappers as a parameter to the ProductRanker, and this will contain all the information the ranking algorithm needs.

asutcl commented 10 years ago

I've just pushed a branch off of master that has UserScoredAttributes. Everything should work as it used to right now, but it is set up to handle the new user weights. For this to happen, the front end must change the implementaiton of sendCurrentFeatureList(String pUserFeatureList, String pCategoryId) to handle the passing of values front the UI, depending on how they decided to do that.

On the back end, the product ranking should be changes to take the userScore and not the Correlation. I think this is simply changing getCorrelation(), to getUserScore() if I am not mistaken.

I didn't fix the product ranking tests, so there are errors on tests.

Let me know if you have questions or comments.

On 17 April 2014 14:45, enewe101 notifications@github.com wrote:

Hey guys, I think we might have our roles materializing here. I think that between @MariamN https://github.com/MariamN, @asutclhttps://github.com/asutcl, and @forgues https://github.com/forgues, we have people who are very familiar with the bits of code in 1) 2) and 3) respectively. I'm thinking of stepping out of this issue and suggesting that you three take the issue on with roughly that division.

@asutcl https://github.com/asutcl -- your proposal sounds good to me, and that would come as part of 2) anyway. @forgues https://github.com/forgues -- your proposal makes a lot of sense too. So let's agree that's the plan in terms of representing the feature slider positions to the back-end.

Post if you have an issue with this proposal!

For my part, I've got a few other things in mind to work on that I think will be worthwhile.

— Reply to this email directly or view it on GitHubhttps://github.com/prmr/Creco/issues/111#issuecomment-40748421 .

asutcl commented 10 years ago

The branch is 0111_scored_attribute_wrapper. I pulled from master to make it easier to intergrate with @MariamN's sliders.

We will have to be careful because we also have a display branch that might cause conflicts once we merge the graphs with in line display with the sliders. I can take care of that merge at that point.

On 17 April 2014 14:50, Andrew Sutcliffe sutcliffea@gmail.com wrote:

I've just pushed a branch off of master that has UserScoredAttributes. Everything should work as it used to right now, but it is set up to handle the new user weights. For this to happen, the front end must change the implementaiton of sendCurrentFeatureList(String pUserFeatureList, String pCategoryId) to handle the passing of values front the UI, depending on how they decided to do that.

On the back end, the product ranking should be changes to take the userScore and not the Correlation. I think this is simply changing getCorrelation(), to getUserScore() if I am not mistaken.

I didn't fix the product ranking tests, so there are errors on tests.

Let me know if you have questions or comments.

On 17 April 2014 14:45, enewe101 notifications@github.com wrote:

Hey guys, I think we might have our roles materializing here. I think that between @MariamN https://github.com/MariamN, @asutclhttps://github.com/asutcl, and @forgues https://github.com/forgues, we have people who are very familiar with the bits of code in 1) 2) and 3) respectively. I'm thinking of stepping out of this issue and suggesting that you three take the issue on with roughly that division.

@asutcl https://github.com/asutcl -- your proposal sounds good to me, and that would come as part of 2) anyway. @forgues https://github.com/forgues -- your proposal makes a lot of sense too. So let's agree that's the plan in terms of representing the feature slider positions to the back-end.

Post if you have an issue with this proposal!

For my part, I've got a few other things in mind to work on that I think will be worthwhile.

— Reply to this email directly or view it on GitHubhttps://github.com/prmr/Creco/issues/111#issuecomment-40748421 .

MariamN commented 10 years ago

@forgues changes are now complete. You can incorporate user's scores into the ranking algorithm. Checkout Branch Issue101, I merged @asutcl code to it.

asutcl commented 10 years ago

Ok the sliders are in and everything works.

It is back in the master. One thing though is that I think we will need the slider to be aligned with each other. It't hard right now to compare them visually.

@forgues I also did the product ranking by user since I wanted to see if it worked and it was like a one liner, since it had been planned for.

asutcl commented 10 years ago

Sliders with long feature names don't appear right.

example http://localhost:8080/searchProducts?id=34687

mangalagb commented 10 years ago

When you search for "car repair shop", since all the products under this category are dead, nothing appears. But when you change the features, some products appear.