Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart history #419

Closed
eevleevs opened this issue Mar 8, 2016 · 32 comments
Closed

Smart history #419

eevleevs opened this issue Mar 8, 2016 · 32 comments

Comments

@eevleevs
Copy link

eevleevs commented Mar 8, 2016

As far as I understand, the search function orders the results in a way that should be most relevant to the user. Could we have an option to apply a similar logic to the history, so that the elements can be also weighted by relevancy? For example, apps that are used often could fall back in history slower than others.

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 8, 2016

Yes, i like that idea too.
How would you code that?

@eevleevs
Copy link
Author

eevleevs commented Mar 8, 2016

I would imagine to keep a relevancy score for every app, say from 0 for the most relevant to 1 for the least relevant. Then I would order the history by:

score * time_passed_from_last_launch

A further refinement would be to add a user setting to adjust the sensitivity of the weight. For this I would have a slider setting from 0 to 1 and order the history by

(1 - slider + slider * score) * time_passed_from_last_launch

@jumper047
Copy link

There is an interesting app launcher, Hangar https://github.com/corcoran/Hangar. It ranges apps by time of usage.

@eevleevs
Copy link
Author

eevleevs commented Mar 9, 2016

I know it, but it is not the same thing. Hangar works either as a notification bar or a widget, and handles only apps as far as I can remember.

@jumper047
Copy link

But i think idea is interesting. For example: i have conversation in chat, and some interesting pages in browser. I don't use kiss for switching between them, because android's last apps are convenient for this. So, kiss dont know that chat and browser are popular, and move them away(if it uses your formula).

@austil
Copy link

austil commented Mar 9, 2016

As is said in #397 :

When i discovered KISS a sentence caught my attention :

KISS becomes smarter and smarter as you use it, pushing forward results you're more likely to select.

I was expecting a launcher that present me the "most supposed to be used now" apps like Z launcher or Aviate launcher. But it only does that for search result apparently.

So i'm interested too.

@eevleevs
Copy link
Author

eevleevs commented Mar 9, 2016

I don't use kiss for switching between them, because android's last apps are convenient for this. So, kiss dont know that chat and browser are popular, and move them away(if it uses your formula).

I see your point, but also right now you will not see your app coming to the bottom if you use the Android recent apps. Maybe analysis of recents can be used as one of the parameters to build the "score".

@robberer
Copy link
Contributor

I would like to jump on to this train. A weighted history would be great.

I launch a lot of apps during the day but, some apps more often than other apps. An expected behaviour would be that the most often used apps are almost always at the bottom and easily accessible. I'm not only talking about apps but all results.

At the moment the only alternative way to access most used programms are favorites. But I do not like the way it is implemented to cover fast access. To complicated IMO:

  1. point at that small circle
  2. yeah, look at those tiny icons. (on a 1080x1920 5" display)
  3. again, point at small things

If we get the history smart then, yeah, perfect.

@robberer
Copy link
Contributor

Maybe I just implement the favorites in another way so I can access them without pressing kissbar circle. I have some spare DP :-)

@austil
Copy link

austil commented Mar 13, 2016

@robberer #404

@robberer
Copy link
Contributor

@austil GREAT, you already did the job 👍

So the only thing left is to discuss the postion of the favorite bar ? I'm with you.

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 13, 2016

I think the #404 is still a mockup, I don't know if anyone has already implemented anything :-)

@eevleevs
Copy link
Author

Sorry but 404 seems quite a different thing. Can we continue on the history here?

@quite
Copy link

quite commented Mar 15, 2016

Yeah, this issue is for thinking about a more relevant, possibly weighted, and more "smart" history. Your proposal @eevleevs of a weighted history sounds like a way forward to me.

How is the history working currently, it seems to be sorted purely on most recently used. Right?

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 15, 2016

So, if I get it right @eevleevs suggested a slide to tune between recently used apps and frequently used apps. If the user selects one side, you see history ordered by most recently used apps (as of now) and if he selects the other side, history is ordered by most frequently used apps (something similar but not exactly the same as the freeze history feature)
I can see the potential of that but I somehow fear that it is not that intuitive.
Any opinions (from older members) ?

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 28, 2016

How about not changing the position of an item in history (when clicked) if that item is already visible in the front page?

@eevleevs
Copy link
Author

Not sure I understand. How does that help?

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 29, 2016

if an application is on a visible place in history and you select it, then it remains on the same spot, thus you don't have to look for it on the history list the next time you try to launch it.
If the application is not visible and you launch it, then it will be added to history and push upwards entries that are less frequent. However, very frequent entries will remain on the same spot on history.

not sure it that would be nice

@eevleevs
Copy link
Author

I still prefer the original idea. If the slider thing sounds unclear, just drop that and consider to use the first formula:

score * time_passed_from_last_launch

The user gets only the option to use smart history or not. Scoring can be based on the same principles as the search results (not sure what they are).

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 29, 2016

If i get it right, order of items in the history list will change even when no action is done by the user since the time_passed_from_last_launch will always increase.
Is that desired?

@eevleevs
Copy link
Author

Yes! That is why it's called smart: it does by itself :-)

The point is that the most relevant apps should disappear from the history at a slower speed.

@nmitsou
Copy link
Collaborator

nmitsou commented Mar 30, 2016

Lol, I will give it a try on the weekend but you would have to somehow persuade @Neamar to merge it :-D

@eevleevs
Copy link
Author

Ready to fight ;-)

@Neamar
Copy link
Owner

Neamar commented Mar 31, 2016

@eevleevs: why not, could be a usefule feature (there was something similar in the very early drafts of KISS, when it was still named "Summonß": I think the name was "frecency" for frequency / recent.

I'm not a huge fan of the slider (sounds too complex, and clearly not Keep It Simple), but an option to sort by frecency could be implemented and merged :)

@eevleevs
Copy link
Author

eevleevs commented Apr 1, 2016

Good :-) Then we have to find a reasonable set point.

@nmitsou
Copy link
Collaborator

nmitsou commented Apr 4, 2016

I have a running/basic implementation for this.
At the moment, for simplicity I don't use the time_passed_from_last_launch but the position_in_normal_history which indirectly indicates the order of launched apps.

What's the formula using score (how many times has been launched) and position_in_normal_history ?

Lets take an example:
App 1 is newly installed: 1st in normal history, score = 1
App 2 is very popular: 2nd in normal history, score = 350
App 3 is somehow popular: 3rd in normal history, score = 40

Should App 1 be first in SmartHistory since it has been recently launched (for the first time)?

@eevleevs
Copy link
Author

eevleevs commented Apr 4, 2016

We can use score * position_in_normal_history for the moment, but I would make score a little smarter to take into account that habits might change. In principle:

  • consider a score going from 0 (max popularity) to 100 (min popularity) (the formula then gives you a list ordered ascending)
  • every time the user launches an app, do score = score / 2
  • periodically (every day?), for all programs, do score = score + (100 - score) / 4

This should give you a basic scoring logic that will reset over time, if you quit using an app. We have to play a little with the divisors to find values that work.

When you start to use time, newly installed items should come first by just faking one launch.

@nmitsou
Copy link
Collaborator

nmitsou commented Apr 5, 2016

Hi @eevleevs, yes I understand your idea. The problem is that I would like to do the sorting of apps inside the sql and I wouldn't like to have a periodical update.

Can you and anyone else build from source?
if yes, you can try this alpha version:
https://github.com/nmitsou/KISS/tree/smartHistory2

I use this formula for weighting history items:

weight = number_of_launches_for_app / total_number_of_launches + 2.0 / (position_in_history_for_app + 1)^2

( in other words: weight = frequency + launch_recency_decayed )

You can find the formula in db/DBHelper.java line 60.
It is inside the sql so it might not be straightforward to understand which term is doing what.

To test, first go Settings> Advance> History mode> Frecency, then launch a "useless" app that you have never launched before (not in history) and wait to see this app first in history. Then I would launch a single favourite app many times and watch the useless app go up in the history list.

Edit: To be honest, I am not excited with the current result. Any opinions?

@nmitsou
Copy link
Collaborator

nmitsou commented Apr 6, 2016

Ok, for testing purposes I had to clear my history.
Now that the history starts to grow again, I can say that the feature works.
Non frequent items when launched go first on history but slowly start to move upwards (if not re-launched).
Loading the history is somehow slower due to the complex sqlite query (i have to measure times).
Unfortunately sqlite doesn't provide the exponential function out of the box (for an exponential decay)

@nmitsou nmitsou mentioned this issue Apr 9, 2016
@nmitsou
Copy link
Collaborator

nmitsou commented Apr 11, 2016

In the current commit, I switched back to the frequency * recency formula.
After using it for some time, it feels fine.
Maybe the recency could be tuned not to forget so fast less frequent items that have been recently launched. I guess this is also a personal preference.

I noticed also that on the weekends there is a big change on the type of apps that I launch. What do you think, should the smart history load apps based on the type of day (workday / weekend) or even time (morning / evening etc) ?

@licaon-kter
Copy link
Contributor

This should be closed?

@Neamar
Copy link
Owner

Neamar commented Jun 27, 2016

Good point :p

@Neamar Neamar closed this as completed Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants