Close Menu
    Trending
    • How This Entrepreneur Built a Bay Area Empire — One Hustle at a Time
    • How Deep Learning Is Reshaping Hedge Funds
    • Boost Team Productivity and Security With Windows 11 Pro, Now $15 for Life
    • 10 Common SQL Patterns That Show Up in FAANG Interviews | by Rohan Dutt | Aug, 2025
    • This Mac and Microsoft Bundle Pays for Itself in Productivity
    • Candy AI NSFW AI Video Generator: My Unfiltered Thoughts
    • Anaconda : l’outil indispensable pour apprendre la data science sereinement | by Wisdom Koudama | Aug, 2025
    • Automating Visual Content: How to Make Image Creation Effortless with APIs
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»When Linear Regression Doesn’t Work: Analysis of House Prices in Canada | by Natalia Goncharenko | Jul, 2025
    Machine Learning

    When Linear Regression Doesn’t Work: Analysis of House Prices in Canada | by Natalia Goncharenko | Jul, 2025

    Team_AIBS NewsBy Team_AIBS NewsJuly 24, 2025No Comments3 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Zoom picture shall be displayed

    Linear regression is a primary machine studying software usually used to foretell numbers. It’s easy and clear, nevertheless it wants the correct information to work nicely. On this challenge, I attempted to foretell home costs in Canada utilizing a dataset from Kaggle (Canadian House Prices for Top Cities). The outcomes weren’t nice, however I discovered lots about what linear regression can and may’t do. This text explains my steps, outcomes, and classes.

    The dataset has details about homes in huge Canadian cities. It consists of:

    • Value (what we need to predict)
    • Variety of bedrooms and bogs
    • Metropolis, province, inhabitants, and household earnings
    • Location (latitude, longitude) and addresses

    The dataset has 35,768 homes. However some information was unusual, like homes with 60+ bedrooms, so I wanted to scrub it.

    To get the information prepared, I did these steps:

    1. Eliminated columns that don’t work for the mannequin: Tackle, Metropolis, Latitude, Longitude.

    2. Modified Province into numbers (one-hot encoding) to make use of location.

    3. Modified the Value with a math trick (logarithm) as a result of costs have been very totally different (from 21,500 to 37,000,000).

    4. Made numbers like Inhabitants, Family_Income, Bedrooms, and Bogs related in measurement utilizing a software (StandardScaler).

    5. Eliminated unusual homes with greater than 10 bedrooms or bogs (12 homes).

    After cleansing, the dataset had 35,756 homes and 12 options.

    I cut up the information: 80% to coach the mannequin and 20% to check it. I used linear regression on the modified costs, then turned predictions again to regular costs to test outcomes. The scores have been:

    • R²: 0.2492 (how nicely the mannequin explains the information)
    • RMSE: 964,286.98 (how huge the errors are)

    The R² rating (0.2492) was low, so the mannequin didn’t clarify the costs nicely. The RMSE (964,286.98) confirmed huge errors in predictions. Linear regression didn’t work as a result of home costs depend upon many issues not within the dataset, like home measurement or neighborhood.

    To make issues simpler, I made a smaller dataset with solely homes from Winnipeg (455 homes). I used simply two options: Bedrooms and Bogs. I didn’t change the costs this time as a result of they have been much less excessive (from 69,900 to 968,800).

    I cut up the information once more: 80% for coaching, 20% for testing. I used linear regression. The scores have been:

    • R²: 0.3786
    • RMSE: 149,399.03

    The R² rating (0.3786) was a bit higher, however nonetheless not good. The RMSE (149,399.03) confirmed the mannequin nonetheless made huge errors. Even with less complicated information, linear regression didn’t work nicely as a result of costs depend upon extra than simply bedrooms and bogs.

    This challenge confirmed me what linear regression can’t do:

    1. Complicated Issues: Home costs depend upon many issues (measurement, age, location, financial system). Linear regression expects easy connections, however the information was too sophisticated.
    2. Dangerous Information: Unusual information (like 60+ bedrooms) and lacking essential options made the mannequin worse.
    3. Limits of the Software: Linear regression is robust for easy issues, nevertheless it wants the correct information. It received’t work on simply any dataset.

    This challenge helped me perceive linear regression higher. It’s a superb software, however not for each downside. To make it work, you want clear information with the correct options and easy connections.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleIn the Latest Space Race, It’s China vs. SpaceX
    Next Article Shopos Raises $20M, Backed by Binny Bansal: What’s Next for E-Commerce?
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    How Deep Learning Is Reshaping Hedge Funds

    August 2, 2025
    Machine Learning

    10 Common SQL Patterns That Show Up in FAANG Interviews | by Rohan Dutt | Aug, 2025

    August 2, 2025
    Machine Learning

    Anaconda : l’outil indispensable pour apprendre la data science sereinement | by Wisdom Koudama | Aug, 2025

    August 2, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    How This Entrepreneur Built a Bay Area Empire — One Hustle at a Time

    August 2, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    Football and other premium TV being pirated at ‘industrial scale’

    May 30, 2025

    Veed.IO Review and Alternatives – My Experience

    December 16, 2024

    Cognitive Computing Explained: How AI Mimics Human Thinking to Transform Industries | by Parth Dangroshiya | Jun, 2025

    June 2, 2025
    Our Picks

    How This Entrepreneur Built a Bay Area Empire — One Hustle at a Time

    August 2, 2025

    How Deep Learning Is Reshaping Hedge Funds

    August 2, 2025

    Boost Team Productivity and Security With Windows 11 Pro, Now $15 for Life

    August 2, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.