image_output_1.png
from sklearn.linear_model import LinearRegression

from sklearn.model_selection import train_test_split

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

df = pd.read_csv('/kaggle/input/flight-dataset/Flight_data.csv')

sorted_df = df.sort_values('Customer ID', ascending=False)

Avg_ticket_price = df.groupby('Ticket Price').mean()
Avg_delay_min = df.groupby('Delay Minutes').mean()

df.dropna()

correlation_matrix = df.corr()

X = df[['Flight Duration', 'Ticket Price', 'Competitor Price', 'Demand']]
y = df['Delay Minutes']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
model = LinearRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)

for prediction in predictions:
    print(prediction)