Aml Weather
Aml Weather
WEATHER PREDICTION
USING MACHINE LEARNING MODEL:
By
1.RAKSHITHA H - 1NT22EC128
2.SWAPNA R TADALAGI - 1NT23EC415
2. R² Score
Fig 7: Predict Using the Model
- R² Score (R-squared) is a statistical measure that represents
the proportion of the variance for the dependent variable
Step 6: Predict Using the Model (temperature) that's explained by the independent variable
The trained model is used to predict the temperature for a new (index).
date (index 15 in this case). This demonstrates the model's - An R² value closer to 1 suggests that the model explains a
ability to make future predictions based on learned data. large portion of the variance in the dependent variable,
indicating a good fit.
3. Predicted Temperature
- This is the temperature value predicted by the model for a new
date index (15 in this case). It demonstrates the model's ability
to extrapolate and make predictions on data points outside the
initial training range.
Graph Explanation
Regression Line
- Red Line: This line represents the linear relationship that the
model has learned from the data. It shows the predicted
temperature values over the range of date indices used in the
dataset.
- The slope and intercept of this line are determined by the
linear regression model to minimize the error between the
actual and predicted values.
Plot Elements
- Title: "Linear Regression Model for Temperature" describes
what the graph represents.
- X-axis Label: "Index" indicates the independent variable,
which in this simplified model is just the index of the dates.
- Y-axis Label: "Temperature (Celsius)" shows the dependent
variable, which is the temperature.
- Legend: Helps differentiate between actual data points, the
regression line, and the predicted point.
- Grid: Adds a grid to the background for better readability and
alignment with the data points.
1. Trend Line: The red regression line provides a visual STEP 1: Load the dataset into the python and import the
representation of the general trend in temperature over time libraries STEP 2: Data pre-processing
(indexed by days). The slope of the line indicates the direction
and rate of temperature change. Step 2.1: Drop the unnecessary column from the dataset
2. Model Fit: The closeness of the blue data points to the red
line indicates how well the model fits the actual data. If the
points are closely clustered around the line, the model has a Step 2.2: Delete all values from te pressure which has a value -
good fit. 9999
3. Prediction Capability: The green dot (predicted temperature
for index 15) shows the model's ability to predict future Step 2.3: Taking all the features into x variable and y for
temperatures. The position of this dot relative to the regression prediction
line shows where the predicted temperature lies in the context
of the model's learned trend. Step 2.4: Set the dummies value as a level for the weather
classification Step
In summary, the outputs and the graph together provide a
comprehensive understanding of how the linear regression
model performs, its accuracy, and its prediction capabilities.
CONCLUSION
Step 3.1: Splitting Dataset into train set and test set
STEP 7: Output