Author Topic: Multiple custom filters in version 7.7?  (Read 2378 times)

Quantíto

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Multiple custom filters in version 7.7?
« on: January 19, 2015, 10:51:54 AM »
I'm a new user and already appreciative of the Peer Lending Server, version 7.7, running on a Mac.  One question, however, that I can't seem to find the answer to.  Previous threads and even the documentation allude to there being a way to run multiple filters but I can't seem to figure out how to do that.  Here's what I would like to do:

1) Download the new listings
2) Run 10 filters against the new listings
3) Place an order for any new loans that pass through the filters

It seems as though the PLS version 7.7 is only capable of having one custom filter.  Is that correct?  And, if correct, the only way I can figure out how to run 10 custom filters is to run 10 different instances of PLS within the Virtual Box, each with it's own custom filter.  The problem with doing that, however, seems to be that I would then have 10 instances of PLS all trying to download the new listings at nearly identical times and running into this issue; that I believe that Lending Club's API limits the number of queries to it's servers from the same API credential to 1 time per second.  If that's the case, then the queries from 10 instances of PLS all hitting LC's servers at the same time will crash into each other and violate the 1 time per second rule.  Then there's a second issue with this workaround; that I might be ordering a specific loan multiple times if that loan happens to pass through more than one filter (even though my filters do not overlap each other very much, there are probably a few areas in which they do overlap...but I only want to order the loan one time even if it does pass through multiple filters).

Any comments or suggestions?  Thanks!

Quantíto
« Last Edit: January 19, 2015, 11:04:34 AM by quintíto »

sociallender

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
    • Email
Re: Multiple custom filters in version 7.7?
« Reply #1 on: January 19, 2015, 11:25:09 AM »
Yes, the new version of PLS is a significant departure from the the previous version.  The previous version did have the ability to run multiple filters.  However, the new version currently does not have that feature.  I need to find the time to update the current documentation.  I may be able to add this into a new release but I need to think about how this should work.  The previous version basically combined multiple filters using a logical "or" and applied them all at once.  However, does it make sense to run them sequentially (one after the other)?  The difference being the former allows for a more complex single filter while the latter provides a sequential/logical approach.  Here is a very simple example:

Filter A:  C notes AND intRate > 16
Filter B:  C notes AND intRate < 10

Combining in the first method would be a single filter:

( C notes AND intRate > 16 ) OR ( C notes AND intRate < 10 )

So, The above would purchase the union (without duplication) in one single order.

The latter method which may take significantly longer to code would be:

Apply first filter: C notes AND intRate > 16
Order notes, calculate remaining cash, add notes ordered to lock file then
C notes AND intRate < 10
Send another order excluding notes already ordered then finish...

Please provide some feedback as I am not sure what direction to take (I only use a single filter)...


Quantíto

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Multiple custom filters in version 7.7?
« Reply #2 on: January 19, 2015, 12:07:59 PM »
Thanks for the quick reply SL.  In my mind, and if I were coding it myself (which I don't know how to do), I would try it like this:

1) download the new loans list
2) run filter 1, and, if any loans make it through the filter, save the Loan ID and/or Note ID (whatever is needed to eventually place the order) to a temp file (or whatever you use to record temp info)
3) run filters 2-10 (or ideally unlimited...or at least 20, maybe 25 filters) the same way, the idea being that after running the loans through the 10 filters, you end up with a temp file (or whatever you use to record temp info) that has the loans listed that you want to order
4) As there may be some duplicate loans listed in the temp file (having made it through more than one filter), first remove the duplicates and then submit the resulting list to LC to order all the unique loans that made it through the multiple filters.

It would also be nice to be able to specify per filter how much you would like to invest in loans that make it through that specific filter.  I realize this would complicate the coding even further but this would be the ideal...at least for me.  One caveat here, though, would be that the resulting list of temp info in the temp info file might have a duplicate loan for which one filter wants to loan $25 and another filter wants to loan $50.  For me, I would want to specify the higher amount to be my loan amount (because the loan presumably made it through a more rigorous filter).

That enough?  Hah!  BTW, I really appreciate your efforts with PLS.  I can see it ending up as a great tool!

Quantito

sociallender

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
    • Email
Re: Multiple custom filters in version 7.7?
« Reply #3 on: January 19, 2015, 04:19:59 PM »
Ok, sounds good. I am putting it on my todo list.  However, I have a few updates that are higher in the queue.  Plus, this is going to take some time to code...

lascott

  • Hero Member
  • *****
  • Posts: 1254
    • View Profile
    • Appreciate my post and want to try LendingRobot? URL below
Re: Multiple custom filters in version 7.7?
« Reply #4 on: April 09, 2015, 02:13:35 AM »
Can you consider adding a common filter (predicate) i.e. filter 0

For example:
Filter 0: (Employment > 2 years) and (Public Recs = 0) -- common filter used with all others

Filter 1: (Grade = D) and (FICO >= 680)
Filter 2: (Grade = E) and (FICO >= 670)

If you wanted to do them all at once then the result would be:
Code: [Select]
(Employment > 2 years) and (Public Recs = 0)
AND
  (
    ((Grade = D) and (FICO >= 680))
     OR
    ((Grade = E) and (FICO >= 670))
  )

Individually as Quantito example:
Code: [Select]
(Employment > 2 years) and (Public Recs = 0) AND (Grade = D) and (FICO >= 680)
Code: [Select]
(Employment > 2 years) and (Public Recs = 0) AND (Grade = E) and (FICO >= 670)
Aside: I could see in the future that there could be a unique set of the above for 36 month loans and 60 month loans. ie. for 60 month perhaps you want to use FICO 700 for Ds and 690 for Es.

** Yes, I realize some of my parens are extraneous
Tools I use: (main) BlueVestment: https://www.bluevestment.com/app/pricing + https://www.interestradar.com/ , (others) Lending Robot referral link: https://www.lendingrobot.com/ref/scott473/  & Peercube referral code: DFVA9Y

lascott

  • Hero Member
  • *****
  • Posts: 1254
    • View Profile
    • Appreciate my post and want to try LendingRobot? URL below
Re: Multiple custom filters in version 7.7?
« Reply #5 on: April 09, 2015, 10:06:56 AM »
Note with the above common filter criteria (predicate) "Filter 0" is optional for the end user to use.  Allows for a KISS usage and just one filter for novice or beginner users.

Alternatively end user can just code Filter 1 and 2 on their own and hard code the common criteria within each.
* just use Filter 1 as:  (Employment > 2 years) and (Public Recs = 0) AND (Grade = D) and (FICO >= 680)
* just use Filter 2 as:  (Employment > 2 years) and (Public Recs = 0) AND (Grade = E) and (FICO >= 670)
Tools I use: (main) BlueVestment: https://www.bluevestment.com/app/pricing + https://www.interestradar.com/ , (others) Lending Robot referral link: https://www.lendingrobot.com/ref/scott473/  & Peercube referral code: DFVA9Y

sociallender

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
    • Email
Re: Multiple custom filters in version 7.7?
« Reply #6 on: April 10, 2015, 10:44:54 AM »
The custom filter box in the filter configuration window allows you to create a complex filter using joins and grouping.  You should be able to accomplish what you are asking by including the correct filter in the custom filter input box.  Note that custom filters use a slightly different syntax than standard SQL.  The bottom right portion of the filter screen shows how a filter is created (syntax) in real time when building from the GUI.  If the filter is incorrect, you should see errors on the right of the screen or no notes listed.  & and | are used for and and or.  Parenthesis are used for grouping.

SL