Close Menu
    Trending
    • Side hustles so popular with millennials and gen Z, even people making $100,000 a year have one
    • 5 Language Apps That Can Change How You Do Business
    • Strength in Numbers: Ensembling Models with Bagging and Boosting
    • The Rise of Small Language Models: The Future of AI Isn’t Always Bigger | by Bolaji Adebayo Ikotun | May, 2025
    • You can’t prevent an economic recession, but you can ensure you're financially prepared to weather one
    • How Smart Entrepreneurs Write Press Releases That Actually Drive Growth in 2025
    • The Geospatial Capabilities of Microsoft Fabric and ESRI GeoAnalytics, Demonstrated
    • PowerBI vs Tableau vs Knowi vs Looker vs Sigma: BI in 2025 | by Nicholas Samuel | May, 2025
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Machine Learning»Machine Learning 🧠. A machine that learns. Sounds cool and
 | by Isbilya Nathifa | Mar, 2025
    Machine Learning

    Machine Learning 🧠. A machine that learns. Sounds cool and
 | by Isbilya Nathifa | Mar, 2025

    FinanceStarGateBy FinanceStarGateMarch 28, 2025No Comments3 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    First issues first open your Google Colab because it’s the medium we’ll be utilizing. Subsequent, like every other information evaluation venture, you must enter or make an information set that may be learn by the machine. On this introduction, we’re going to make use of a pre-made information set that encompass salaries of various folks and their components (variable) that, could or could not, impact their wage.

    import pandas as pd
    information = pd.read_csv('/content material/Salary_Data.csv')
    information.head() #that is to indicate the primary 5 information of the set

    Now, let’s have a look of what kind of knowledge every variable is. (*A variable is each information that isn’t what we try to foretell. On this case, variables are each information besides the wage)

    information.dtypes

    Discover how a number of the information are within the type of object. This can be a drawback we have to resolve. Why? As a result of a machine can’t predict a linear regression if the info saved are usually not numbers (this embody float and integer). That’s why our subsequent step is to vary each information which can be non numbers (objects) into numbers (float/integer).

    from sklearn.preprocessing import LabelEncoder
    categorical_column = information.select_dtypes(embody=['object']).columns

    label_encoders = {}

    for col in categorical_column:
    label_encoders[col] = LabelEncoder()
    information[col] = label_encoders[col].fit_transform(information[col])

    information.head() #this exhibits the primary 5 information of the brand new set

    Okay, now that’s carried out, you in all probability will assume that we will go straight to linear regression, hey? Nicely, dangerous information is
 not but. There’s another factor we’ve got to examine which is the NaN worth. “Why on earth do we’d like that?” NaN means there isn’t any worth within the information. No ‘0’, no ‘1’, no nothing. That is dangerous for the machine as a result of it signifies lacking information. In an effort to forestall the machine from getting confused for not getting a whole information set, we have to examine what number of NaN worth are within the set utilizing this straightforward code.

    information.isna().sum()

    As you’ll be able to see, there are some NaN, or lacking values, in a few of these information. In an effort to change that, we have to fill in these with values that may fairly characterize the info. There are lots of choices. You should utilize median, imply, or mode. However now we’re going to go along with the info imply of their variable.

    information.fillna(information.imply(), inplace=True)
    information.isna().sum()

    Okay, after some checking and setting, the info set is now prepared to make use of to foretell wage with linear regression.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleVarious Things Children Can Do To Earn Money For A Business
    Next Article Save Money on Software With This Microsoft 365 Plan That Covers Six Users
    FinanceStarGate

    Related Posts

    Machine Learning

    The Rise of Small Language Models: The Future of AI Isn’t Always Bigger | by Bolaji Adebayo Ikotun | May, 2025

    May 15, 2025
    Machine Learning

    PowerBI vs Tableau vs Knowi vs Looker vs Sigma: BI in 2025 | by Nicholas Samuel | May, 2025

    May 15, 2025
    Machine Learning

    MLE-Dojo: Training a New Breed of LLM Agents to Master Machine Learning Engineering | by ArXiv In-depth Analysis | May, 2025

    May 15, 2025
    Add A Comment

    Comments are closed.

    Top Posts

    Supervised, Unsupervised, Reinforcement Learning — What’s the Difference? | by P AJAY KUMAR | Mar, 2025

    March 11, 2025

    Causality, Correlation, and Regression: Differences and Real-Life Examples | by NasuhcaN | Feb, 2025

    February 22, 2025

    How Movement Grew Into the Largest Climbing Gym Network

    March 29, 2025

    3 Workplace Biases Inclusive Leaders Can Reduce Right Now

    April 18, 2025

    The Dangers of Deceptive Data–Confusing Charts and Misleading Headlines

    February 27, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    A faster way to solve complex planning problems | MIT News

    April 16, 2025

    PyScript vs. JavaScript: A Battle of Web Titans

    April 2, 2025

    What’s next for smart glasses

    February 5, 2025
    Our Picks

    From Signal Flows to Hyper-Vectors: Building a Lean LMU-RWKV Classifier with On-the-Fly Hyper-Dimensional Hashing | by Robert McMenemy | May, 2025

    May 10, 2025

    Is It Time to Pivot Your Business? 3 Clear Signs You Shouldn’t Ignore

    May 14, 2025

    Komputer yang Belajar Mendalam. Catatan Belajar Deep Learning | by ANHalfEngineer | Apr, 2025

    April 16, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

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