[{"data":1,"prerenderedAt":123},["ShallowReactive",2],{"term-l\u002Flinear-regression":3,"related-l\u002Flinear-regression":108},{"id":4,"title":5,"acronym":6,"body":7,"category":90,"description":91,"difficulty":92,"extension":93,"letter":94,"meta":95,"navigation":53,"path":96,"related":97,"seo":102,"sitemap":103,"stem":106,"subcategory":6,"__hash__":107},"terms\u002Fterms\u002Fl\u002Flinear-regression.md","Linear Regression",null,{"type":8,"value":9,"toc":84},"minimark",[10,15,19,23,26,30,73,77,80],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 - The Vibe Check",[16,17,18],"p",{},"Linear regression is drawing the single straightest line through a scatter of dots that comes closest to all of them at once, then using that line to guess where a new dot would land. Give it square footage and it'll draw the line that best predicts house prices, then tell you what an 1,800 square foot house should cost based on where it falls on that line.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"Linear regression models the relationship between one or more input features and a continuous target variable by fitting a straight line, or hyperplane in higher dimensions, that minimizes the sum of squared errors between predicted and actual values. It's one of the oldest and most interpretable algorithms in statistics, and remains a strong baseline before reaching for anything more complex.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from sklearn.linear_model import LinearRegression\n\nmodel = LinearRegression()\nmodel.fit(X_train, y_train)\nprint(model.coef_, model.intercept_)\n","python","",[38,39,40,48,55,61,67],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"from sklearn.linear_model import LinearRegression\n",[41,49,51],{"class":43,"line":50},2,[41,52,54],{"emptyLinePlaceholder":53},true,"\n",[41,56,58],{"class":43,"line":57},3,[41,59,60],{},"model = LinearRegression()\n",[41,62,64],{"class":43,"line":63},4,[41,65,66],{},"model.fit(X_train, y_train)\n",[41,68,70],{"class":43,"line":69},5,[41,71,72],{},"print(model.coef_, model.intercept_)\n",[11,74,76],{"id":75},"when-youll-hear-this","When You'll Hear This",[16,78,79],{},"\"Start with linear regression as a baseline before you reach for a neural network.\" \u002F \"The coefficients from the linear regression tell us square footage matters way more than the year built.\"",[81,82,83],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":85},[86,87,88,89],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":75,"depth":50,"text":76},"ai","Linear regression is drawing the single straightest line through a scatter of dots that comes closest to all of them at once, then using that line to guess...","beginner","md","l",{},"\u002Fterms\u002Fl\u002Flinear-regression",[98,99,100,101],"Logistic Regression","Gradient Descent","Feature Engineering","scikit-learn",{"title":5,"description":91},{"changefreq":104,"priority":105},"weekly",0.7,"terms\u002Fl\u002Flinear-regression","YGxdECoPgor33tlGAWe8occpMnRlVSBnBV9IviTr6_8",[109,113,117,120],{"title":100,"path":110,"acronym":6,"category":90,"difficulty":111,"description":112},"\u002Fterms\u002Ff\u002Ffeature-engineering","intermediate","Feature engineering is the unglamorous, hugely important work of turning raw, messy real-world data into the specific columns a model can actually learn fr...",{"title":99,"path":114,"acronym":6,"category":90,"difficulty":115,"description":116},"\u002Fterms\u002Fg\u002Fgradient-descent","advanced","Gradient Descent is how an AI learns — it's the algorithm that nudges the model's weights in the right direction after each mistake.",{"title":98,"path":118,"acronym":6,"category":90,"difficulty":111,"description":119},"\u002Fterms\u002Fl\u002Flogistic-regression","Despite the name, logistic regression isn't about predicting a number, it's about predicting yes or no: spam or not spam, will churn or won't.",{"title":101,"path":121,"acronym":6,"category":90,"difficulty":92,"description":122},"\u002Fterms\u002Fs\u002Fscikit-learn","scikit-learn is the toolbox that made classical machine learning boringly easy in Python: it gives you dozens of ready-to-use algorithms, from linear regre...",1792528096569]