×
BigML is working hard to support a wide range of browsers. Your experience will be better with:
English
Sign up / in
Sign up
Sign in
or Sign in with...
Amazon
Github
GitLab
Google
Toggle navigation
PRODUCT
Features
Releases
What's New
GETTING STARTED
PRICING
Subscriptions
Private Deployments
Training
Certifications
BigML for Education
SUPPORT
Toggle navigation
PRODUCT
Features
Releases
What's New
GETTING STARTED
PRICING
Subscriptions
Private Deployments
Training
Certifications
BigML for Education
SUPPORT
License
Oops!
We could not process your request!
Apply offsets qwk | BigML.com
×
Embed this Script in your web site
Copy & Paste this code into your HTML code:
whizzml
Public
whizzml's
Scripts
77
Models
0
Datasets
0
0
FREE
BUY
Apply Offsets QWK
Details:
Created
Thu, 8 Oct 2026 15:00:44 +0000
Published
Thu, 8 Oct 2026 17:26:18 +0000
Description:
Apply offsets to a dataset regression predictor to miminize QWK
Tags:
BigMLer
BigMLer_ThuOct0826_170043
URL:
https://bigml.com/user/whizzml/gallery/script/6ac7b01c5810b446e9cfdbfc
Script
FREE
Source code
;;------------------------------------------------------- ;; A useful BigML function ;; From "Auto-complete Missing Fields" script (Charles Parker) ;; Retrieves ID of a field given its name (define (id-from-fields fields name) (some (lambda (fid) (when (= ((fields fid) "name") name) fid)) (keys fields))) ;; A useful BigML function ;;------------------------------------------------------- ;; Resolves a field ID given the input. ;; Choose the default if it's empty. (define (get-field use-field dataset-id name input) (let (fds ((fetch dataset-id) "fields")) (cond (not use-field) false (empty? input) (dataset-get-objective-id dataset-id) (contains? fds input) input (let (oid (id-from-fields fds input)) (if oid oid (raise (str name " field '" input "' not found!"))))))) ;; Extract offset table from estimation results ;; Returns a list of offsets (define (extract-offsets offsets) (map (lambda (x) [(x "columnk") (x "columnl")]) offsets)) ;; Build flatline script (Jao) ;; Returns the flatline processor (define (build-flatline prediction-id offset-table) (let (p prediction-id ts (map head offset-table) vs (map last offset-table) d ((offset-table 0) 1) clauses (map (lambda (t v) (flatline "(>= x {t}) {v}")) (reverse ts) (reverse vs))) (flatline "(let (x (f {{p}})) (cond @{clauses} {d}))"))) ;; Apply prediction offsets using flatline ;; Returns the corrected dataset (define (apply-offsets dataset-id prediction-id offset-table) (let (fop (build-flatline prediction-id offset-table)) (create-and-wait-dataset {"origin_dataset" dataset-id "all_fields" true "new_fields" [{"field" fop "name" "OffsetPrediction"}]}))) ;; Fetch execution result ;; Returns the raw offset information (define (fetch-execution-result execution-id) (let (ex (try (fetch execution-id) (catch e (raise (str "Invalid execution: " e)))) ofs (try (ex ["execution" "result" "optimized" "offsets"]) (catch e (raise (str "Invalid execution: " e))))) ofs)) ;; Apply offsets as batch correction ;; Top level function to sequence process of applying corrections. ;; Returns the ID of the dataset with corrections. (define (batch-corrections dataset-id prediction-field execution-id) (let (prediction-id (get-field true dataset-id "Prediction" prediction-field) ot (extract-offsets (fetch-execution-result execution-id))) (apply-offsets dataset-id prediction-id ot))) (define corrected-dataset (batch-corrections dataset-id prediction-field execution-id))
Description
Apply offsets to a dataset regression predictor to miminize QWK
Apply offsets to a dataset regression predictor to miminize QWK
Show more
Inputs
Outputs
License:
Creative Commons Zero V1.0
Script
FREE
Apply offsets qwk | BigML.com
Sending Request...
Sending Request...