[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:ml-engineer\u002Fcml-gradient-boosting-mechanics":4,"config":149},null,{"field_key":5,"field_name":6,"seniority":7,"topic_key":8,"topic_name":9,"spec_key":7,"spec_name":7,"locale":10,"cell_total":11,"field_total":12,"seniorities":13,"topics":17,"specs":58,"samples":63},"ml-engineer","ML Engineer","","cml-gradient-boosting-mechanics","Cml Gradient Boosting Mechanics","en",75,1050,[14,15,16],"junior","mid","senior",[18,21,22,25,28,31,34,37,40,43,46,49,52,55],{"key":19,"name":20,"count":11},"cml-distance-clustering-dimreduction","Cml Distance Clustering Dimreduction",{"key":8,"name":9,"count":11},{"key":23,"name":24,"count":11},"cml-linear-logistic-internals","Cml Linear Logistic Internals",{"key":26,"name":27,"count":11},"cml-probabilistic-models-calibration","Cml Probabilistic Models Calibration",{"key":29,"name":30,"count":11},"cml-svm-kernels-margins","Cml Svm Kernels Margins",{"key":32,"name":33,"count":11},"cml-trees-randomforest-internals","Cml Trees Randomforest Internals",{"key":35,"name":36,"count":11},"ml-data-preparation","Ml Data Preparation",{"key":38,"name":39,"count":11},"ml-deployment-serving","Ml Deployment Serving",{"key":41,"name":42,"count":11},"ml-experimentation-reproducibility","Ml Experimentation Reproducibility",{"key":44,"name":45,"count":11},"ml-model-selection-tuning","Ml Model Selection Tuning",{"key":47,"name":48,"count":11},"ml-model-training-evaluation","Ml Model Training Evaluation",{"key":50,"name":51,"count":11},"ml-monitoring-drift","Ml Monitoring Drift",{"key":53,"name":54,"count":11},"ml-problem-framing","Ml Problem Framing",{"key":56,"name":57,"count":11},"ml-scaling-performance","Ml Scaling Performance",[59],{"key":60,"name":61,"count":62},"classical-ml","Classical ML",450,[64,82,96,110,123,136],{"id":65,"topic":9,"difficulty":66,"body":67,"options":68,"correct_key":79,"explanation":81},"01a03e80-25a8-7054-9b88-256457fe84cd",1,"In gradient boosting, what is each newly added tree fit to predict?",[69,72,75,78],{"key":70,"text":71},"a","The original target again, so that every tree in the ensemble becomes an independent estimate of it.",{"key":73,"text":74},"b","A bootstrap resample of the target, drawn separately for each tree in the boosting sequence.",{"key":76,"text":77},"c","The average of the predictions that all previously fitted trees produced for that same row.",{"key":79,"text":80},"d","Whatever the current ensemble still gets wrong, expressed as the negative gradient of the loss.","Boosting is additive: the prediction is an initial estimate plus the shrunken output of each tree in turn, and every tree is fit to the negative gradient of the loss at the current prediction. Fitting the raw target independently, or bootstrapping it per tree, describes bagging-style ensembles such as random forests. Averaging earlier predictions would add no new information at all.",{"id":83,"topic":9,"difficulty":84,"body":85,"options":86,"correct_key":73,"explanation":95},"01a03e80-25ab-702e-abb4-3730a8d9fc8d",2,"scikit-learn 1.6:\n\n```python\nimport numpy as np\nfrom sklearn.ensemble import GradientBoostingRegressor\n\nX = np.array([[1.], [2.], [3.], [4.]])\ny = np.array([2., 4., 6., 20.])\ng = GradientBoostingRegressor(n_estimators=1, learning_rate=0.1,\n                              max_depth=1, loss='squared_error').fit(X, y)\nprint(g.predict([[4.]]))\n```\n\nThe single stump splits between x=3 and x=4. What is printed?",[87,89,91,93],{"key":70,"text":88},"[8.0]",{"key":73,"text":90},"[9.2]",{"key":76,"text":92},"[20.0]",{"key":79,"text":94},"[6.8]","The initial estimate is the mean of y, 8.0, so the residuals are [-6, -4, -2, 12]. The stump isolates x=4 in a leaf whose value is 12, and the learning rate shrinks that step: 8.0 + 0.1 * 12 = 9.2. Staying at 8.0 would mean the tree contributed nothing, reaching 20.0 would need a learning rate of 1.0, and 6.8 comes from subtracting the leaf value instead of adding it.",{"id":97,"topic":9,"difficulty":98,"body":99,"options":100,"correct_key":76,"explanation":109},"01a03e80-25ad-7660-911e-24bac40ac132",3,"A team fits `GradientBoostingRegressor(loss='quantile', alpha=0.9)` in scikit-learn 1.6 on a target with a long right tail. What does `predict` estimate?",[101,103,105,107],{"key":70,"text":102},"The mean of the conditional target distribution, with `alpha` shrinking each tree's contribution by a further factor of 0.9.",{"key":73,"text":104},"The mean of the conditional target distribution, with `alpha` widening a prediction interval reported separately.",{"key":76,"text":106},"The 90th percentile of the conditional target distribution, so about nine rows in ten fall below the prediction.",{"key":79,"text":108},"The 10th percentile of the conditional target distribution, since `alpha` names the tail mass the estimate leaves above itself.","The quantile loss weights positive and negative errors asymmetrically — under-prediction is charged `alpha` and over-prediction `1 - alpha` — so the constant minimising it is the alpha-quantile and the boosted fit tracks that quantile conditionally. On a fitted model roughly `alpha` of the training rows sit at or below the prediction. Shrinkage is set by `learning_rate`, and nothing here estimates the mean or reverses the tail.",{"id":111,"topic":9,"difficulty":84,"body":112,"options":113,"correct_key":79,"explanation":122},"01a03e80-25af-7354-a91a-1e0b74cd7731","A binary `GradientBoostingClassifier` is fit on data where 20% of the labels are positive. What raw score does the model start from before any tree contributes?",[114,116,118,120],{"key":70,"text":115},"0.20, the positive rate used directly on the probability scale.",{"key":73,"text":117},"0.0, because the raw score scale is always centred at the start of boosting.",{"key":76,"text":119},"log(0.2), about -1.609, the natural logarithm of the positive rate.",{"key":79,"text":121},"log(0.2 \u002F 0.8), about -1.386, the log-odds of the training prior.","Boosting for log loss operates on the raw logit scale, and the constant that minimises log loss there is the log-odds of the class prior, log(p \u002F (1 - p)). With p = 0.2 that is about -1.386, which maps back through the logistic function to a probability of 0.2. Using the rate itself, or its plain logarithm, mixes the probability scale up with the raw score scale.",{"id":124,"topic":9,"difficulty":84,"body":125,"options":126,"correct_key":70,"explanation":135},"01a03e80-25b1-7ddf-8451-d32d3cb81f42","A team lowers `learning_rate` from 0.1 to 0.01 in `GradientBoostingClassifier` and leaves `n_estimators` at 100. Both training and validation loss get clearly worse. What is going on?",[127,129,131,133],{"key":70,"text":128},"Each tree now contributes a tenth as much, so 100 rounds no longer cover the signal and the model underfits.",{"key":73,"text":130},"A smaller learning rate makes each tree deeper, and the deeper trees memorised training noise.",{"key":76,"text":132},"Below 0.05 the learning rate switches the objective to absolute error, which fits a centred target poorly.",{"key":79,"text":134},"Shrinkage that small disables the initial estimate, so the ensemble has to start from a raw score of zero.","The learning rate multiplies every tree's output before it is added, so total progress after n rounds scales roughly with rate times n. Cutting the rate tenfold without raising the round count leaves the ensemble far short of the fit it had, and worse loss on both splits is the signature of underfitting rather than overfitting. The learning rate does not touch tree depth, the objective, or the initial estimate.",{"id":137,"topic":9,"difficulty":66,"body":138,"options":139,"correct_key":70,"explanation":148},"01a03e80-25b4-7ce3-a88b-2e21cb6ef6f8","The `learning_rate` parameter of scikit-learn's gradient boosting (called `eta` in XGBoost) multiplies which quantity?",[140,142,144,146],{"key":70,"text":141},"The output of each new tree, before that output is added to the running prediction.",{"key":73,"text":143},"The depth budget granted to each individual tree as boosting proceeds through its rounds.",{"key":76,"text":145},"The gradient used to score candidate splits, leaving the leaf values untouched.",{"key":79,"text":147},"The fraction of training rows drawn at random for each boosting round of the fit.","Shrinkage scales the contribution of every fitted tree, so the ensemble takes many small steps instead of a few large ones; XGBoost describes `eta` as shrinking the new weights to make boosting more conservative. Depth is set separately by `max_depth` or `max_leaf_nodes` and row sampling by `subsample`, and the shrinkage lands on the leaf values themselves rather than only on the split search.",{"fields":150,"seniorities":370,"interview_shapes":371,"locales":376,"oauth":378,"question_count":381,"coach_enabled":382,"jd_match_enabled":382},[151,176,196,212,236,249,268,287,309,328,343,365],{"key":152,"name_tr":153,"name_en":153,"sort":66,"specializations":154},"backend","Backend",[155,158,161,164,167,170,173],{"key":156,"name":157,"field":152},"general","Genel",{"key":159,"name":160,"field":152},"go","Go",{"key":162,"name":163,"field":152},"python","Python",{"key":165,"name":166,"field":152},"java","Java",{"key":168,"name":169,"field":152},"csharp","C#\u002F.NET",{"key":171,"name":172,"field":152},"nodejs","Node.js",{"key":174,"name":175,"field":152},"php","PHP",{"key":177,"name_tr":178,"name_en":178,"sort":84,"specializations":179},"frontend","Frontend",[180,181,184,187,190,193],{"key":156,"name":157,"field":177},{"key":182,"name":183,"field":177},"javascript","JavaScript",{"key":185,"name":186,"field":177},"typescript","TypeScript",{"key":188,"name":189,"field":177},"react","React",{"key":191,"name":192,"field":177},"vue","Vue",{"key":194,"name":195,"field":177},"angular","Angular",{"key":197,"name_tr":198,"name_en":198,"sort":98,"specializations":199},"fullstack","Fullstack",[200,201,202,203,204,205,206,207,208,209,210,211],{"key":156,"name":157,"field":197},{"key":159,"name":160,"field":152},{"key":162,"name":163,"field":152},{"key":165,"name":166,"field":152},{"key":168,"name":169,"field":152},{"key":171,"name":172,"field":152},{"key":174,"name":175,"field":152},{"key":182,"name":183,"field":177},{"key":185,"name":186,"field":177},{"key":188,"name":189,"field":177},{"key":191,"name":192,"field":177},{"key":194,"name":195,"field":177},{"key":213,"name_tr":214,"name_en":214,"sort":215,"specializations":216},"devops-cloud","DevOps \u002F Cloud",4,[217,218,221,224,227,230,233],{"key":156,"name":157,"field":213},{"key":219,"name":220,"field":213},"aws","AWS",{"key":222,"name":223,"field":213},"gcp","GCP",{"key":225,"name":226,"field":213},"azure","Azure",{"key":228,"name":229,"field":213},"kubernetes","Kubernetes",{"key":231,"name":232,"field":213},"terraform","Terraform",{"key":234,"name":235,"field":213},"linux","Linux",{"key":237,"name_tr":238,"name_en":238,"sort":239,"specializations":240},"ai-engineer","AI Engineer",5,[241,242,243,246],{"key":156,"name":157,"field":237},{"key":162,"name":163,"field":237},{"key":244,"name":245,"field":237},"llm-rag","LLM\u002FRAG",{"key":247,"name":248,"field":237},"mlops","MLOps",{"key":250,"name_tr":251,"name_en":252,"sort":253,"specializations":254},"database","Veritabanı","Database",6,[255,256,259,262,265],{"key":156,"name":157,"field":250},{"key":257,"name":258,"field":250},"postgresql","PostgreSQL",{"key":260,"name":261,"field":250},"mysql","MySQL",{"key":263,"name":264,"field":250},"mongodb","MongoDB",{"key":266,"name":267,"field":250},"redis","Redis",{"key":269,"name_tr":270,"name_en":271,"sort":272,"specializations":273},"mobile","Mobil","Mobile",7,[274,275,278,281,284],{"key":156,"name":157,"field":269},{"key":276,"name":277,"field":269},"ios-swift","iOS (Swift)",{"key":279,"name":280,"field":269},"android-kotlin","Android (Kotlin)",{"key":282,"name":283,"field":269},"flutter","Flutter",{"key":285,"name":286,"field":269},"react-native","React Native",{"key":288,"name_tr":289,"name_en":290,"sort":291,"specializations":292},"security","Güvenlik","Security",8,[293,294,297,300,303,306],{"key":156,"name":157,"field":288},{"key":295,"name":296,"field":288},"appsec","AppSec",{"key":298,"name":299,"field":288},"offensive-pentest","Offensive \u002F Pentest",{"key":301,"name":302,"field":288},"cloud-security","Cloud Security",{"key":304,"name":305,"field":288},"devsecops","DevSecOps",{"key":307,"name":308,"field":288},"blue-team-incident","Blue Team \u002F Incident",{"key":310,"name_tr":311,"name_en":312,"sort":313,"specializations":314},"qa-test-automation","QA \u002F Test Otomasyonu","QA \u002F Test Automation",9,[315,316,319,322,325],{"key":156,"name":157,"field":310},{"key":317,"name":318,"field":310},"test-automation","Test Automation",{"key":320,"name":321,"field":310},"sdet","SDET",{"key":323,"name":324,"field":310},"performance-testing","Performance Testing",{"key":326,"name":327,"field":310},"mobile-qa","Mobile QA",{"key":329,"name_tr":330,"name_en":330,"sort":331,"specializations":332},"data-engineer","Data Engineer",10,[333,334,337,340],{"key":156,"name":157,"field":329},{"key":335,"name":336,"field":329},"pipelines-etl","Pipelines \u002F ETL",{"key":338,"name":339,"field":329},"streaming","Streaming",{"key":341,"name":342,"field":329},"warehousing","Warehousing",{"key":344,"name_tr":345,"name_en":346,"sort":347,"specializations":348},"game-dev","Oyun Geliştirme","Game Development",11,[349,350,353,356,359,362],{"key":156,"name":157,"field":344},{"key":351,"name":352,"field":344},"unity-csharp","Unity (C#)",{"key":354,"name":355,"field":344},"unreal-cpp","Unreal (C++)",{"key":357,"name":358,"field":344},"gameplay","Gameplay",{"key":360,"name":361,"field":344},"graphics-rendering","Graphics \u002F Rendering",{"key":363,"name":364,"field":344},"multiplayer-netcode","Multiplayer \u002F Netcode",{"key":5,"name_tr":6,"name_en":6,"sort":366,"specializations":367},12,[368,369],{"key":156,"name":157,"field":5},{"key":60,"name":61,"field":5},[14,15,16],{"junior":372,"mid":374,"senior":375},{"questions":373,"median_sec":3},20,{"questions":373,"median_sec":3},{"questions":373,"median_sec":3},[377,10],"tr",[379,380],"google","github",27600,true]