# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
#directory i.e dataset/IPL2013.csv
ipl_auction_df=pd.read_csv('/Users/jagdishwarbiradar/PycharmProjects/AuctionPrice-Prediction/dataset/IPL2013.csv')

ipl_auction_df.info() # No missing values

# recognize the categorical variables


X_features = ipl_auction_df.columns

print(X_features)

# Encoding Categorical Features by dummy variable

categorical_features =['AGE','COUNTRY','PLAYING ROLE','CAPTAINCY EXP']

ipl_auction_encoded_df = pd.get_dummies(ipl_auction_df[X_features], columns = categorical_features,drop_first=True )

X_features = ipl_auction_encoded_df.columns

X_features


# + pycharm={"name": "#%%\n"}
import sklearn
from sklearn.model_selection import train_test_split
import statsmodels.api as sm
###############################
"""Splitting the dataset into train and Validation """
##spliting data into 80%:20%
X=sm.add_constant(ipl_auction_encoded_df)
Y=ipl_auction_encoded_df['SOLD PRICE']
train_x ,test_x,train_y,test_y=train_test_split(X,Y,train_size=0.8,random_state=42)

print(train_x ,test_x,train_y,test_y)




StarcoderdataJupyterScriptsDedupFiltered