This repository has been archived by the owner on Dec 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
92% price accuracy #275
Merged
Merged
92% price accuracy #275
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
2558ea5
Get trainer running on image out-rule from webext-commerce.
erikrose ca8d4c8
Add a trainee for each out() rule so we can choose them from the Trai…
erikrose ce27b0d
Respell a regex for clarity.
erikrose d8e6f43
Bring up to date with 9813ba8b59e6125b9ab18f51499e47bb2ec55745 in htt…
erikrose 46b61d9
Rewrite isAboveTheFold using trapezoid() and fuzzy-logic scores.
erikrose 2eb12b8
Refactor largerImage as well. This completes the image coefficients. …
erikrose 51e6b30
Rewrite image y-axis scorer to constrain to 0..1 and for simplicity.
erikrose 6909520
Retrain to fix the priceish coeff for isAboutTheFold().
erikrose 8d38da1
Change rules that look for "price" in IDs and classes to emit fuzzy c…
erikrose 525bd54
Re-express font-size rule as a confidence.
erikrose b567dd9
Rewrite rule that give a bonus to prices near the winning image.
erikrose 90423da
Express hasPriceishPattern as a fuzzy truth.
erikrose 74658e9
Fix the bugs that immediately kept the trainer from training.
erikrose c52af18
Remove a now-unused constant and an out-of-date comment.
erikrose 737ca67
Add new coeffs to get to 100% on the training set!
erikrose 47bbc7a
Rename hasPriceIn, since it doesn't actually have "price" hard-coded …
erikrose 307fa3d
Consider divs with background images as well as img tags.
erikrose e1f4479
Typos
erikrose f0eba0d
There's no need to say "node". All scoring functions take nodes.
erikrose 3fc5856
Add a rule to punish extreme aspect ratios and another to punish back…
erikrose dd16bf0
Hard-code a height for aboveTheFold so a user's different window size…
erikrose 418a9cf
Make the image trainee train only the image-affecting coeffs, for speed.
erikrose 3486879
Move tuned image coeffs into master vector.
erikrose 9217d83
Make a more efficient training vector for price.
erikrose 89da723
Improve price coeffs: 100% on 12-16.
erikrose 0c888cb
Improve price coeffs. 93.3% on 12-16, 1-10. 92% on 1-25.
erikrose 1735fe3
Improve price coeffs: 98.7% on all current training samples (1-25 and…
erikrose 82709cf
Copy tuned price coeffs to master vector.
erikrose ac1d304
Put the glue code back how I found it, and move the coeffs back into …
erikrose ba89ed4
Fix a mistranscribed coefficient.
erikrose fd6b043
Make linter happy.
erikrose 6ce3ea9
Rename trapezoid() to linearScale().
erikrose 5d55d10
Use single-line doclets where possible. Put a newline after double as…
erikrose 45db392
Rename contains() functions to indicate what returns bools and what r…
erikrose e9edf39
Un-inline the aspect ratio rule.
erikrose c0570d3
Un-inline hasBackgroundInID().
erikrose a57656a
Stick types in local names.
erikrose 4cca17a
Remove unneeded !!.
erikrose ea275aa
Teach the application bits how to extract from CSS background-images.
erikrose 57ca295
Damn you, linter.
erikrose aa4bd88
Use slice() for brevity and great justice.
erikrose 3c6649a
Merge branch 'master' into 90%-price
Osmose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
{ | ||
"hasDollarSignCoeff": 8, | ||
"hasPriceInClassNameCoeff": 2, | ||
"hasPriceInIDCoeff": 17, | ||
"hasPriceishPatternCoeff": 15, | ||
"isAboveTheFoldImageCoeff": 13, | ||
"isAboveTheFoldPriceCoeff": 33, | ||
"isNearbyImageXAxisPriceCoeff": 5, | ||
"backgroundIdImageCoeff": 4, | ||
"bigFontCoeff": 14, | ||
"bigImageCoeff": 9, | ||
"extremeAspectCoeff": 3, | ||
"hasDollarSignCoeff": 3, | ||
"hasPriceInClassNameCoeff": 7, | ||
"hasPriceInIDCoeff": 8, | ||
"hasPriceInParentClassNameCoeff": -1, | ||
"hasPriceInParentIDCoeff": -2, | ||
"hasPriceishPatternCoeff": 4, | ||
"isAboveTheFoldImageCoeff": 5, | ||
"isAboveTheFoldPriceCoeff": -19, | ||
"isNearbyImageYAxisTitleCoeff": 5, | ||
"largerFontSizeCoeff": 7, | ||
"largerImageCoeff": 2 | ||
"isNearImageCoeff": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of a nit, but I've always found that function declarations at the top break the flow of the function and make it harder to read. The function name helps the readability, but a variable can do just as well without interrupting the order:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted this to be ScreechinglyObviousCode. With magic numbers like 5 and -2, it's not otherwise screechingly obvious that what we're trying to do is pull the param out of
url("…")
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extra variable name, then?
(Or not. This is very much yak shaving at this point.)