Here’s a simple example of a Machine Learning (ML) model using Python and Scikit-Learn to predict house prices using Linear Regression . 📌 Step 1: Install Required Libraries If you haven’t installed scikit-learn and pandas , install them first: bash pip install scikit-learn pandas numpy matplotlib 📌 Step 2: Import Libraries python import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_absolute_error, mean_squared_error 📌 Step 3: Create Sample Data python # Creating a small dataset (house size vs. price) data = { "House_Size" : [ 750 , 800 , 850 , 900 , 950 , 1000 , 1050 , 1100 , 1150 , 1200 ], "Price" : [ 150000 , 160000 , 170000 , 180000 , 190000 , 200000 , 210000 , 220000 , 230000 , 240000 ] } df = pd.DataFrame(data) print (df.head()) # Display first few rows 📌 Step 4: ...
Comments
Post a Comment