Simple python function, we always use in python code to reverse the order in list or string. #python
Method : reverse()
we can use another way reverse the list by [::-1]
Method : reverse() or [::-1]
#pythoncode #dailycoding #refresh

Share the knowledge about the Data Science
Simple python function, we always use in python code to reverse the order in list or string. #python
Method : reverse()
we can use another way reverse the list by [::-1]
Method : reverse() or [::-1]
#pythoncode #dailycoding #refresh

Here the sample code which i used recent model building for the LGBM for classification model to predict the click count based on the data given by WNS (item details, view log) from z bay company and train and test data features from partner website which customer clicking the ad’s!
Actually its very informative to work with data set for find the click ratio based on user_id and the session details.
feature extracting based on the merging the item and view log details:
usr_data = train.groupby(“user_id”).agg({“is_click”: [“sum”, “count”], “app_code”: “nunique”, “Hour”: [“mean”, “std”], “Weekday”:[“mean”, “std”]})
usr_data.columns = [“total_interest”, “total_adclicks”, “app_part”, “hour_mean”, “hour_std”,”dayofweek_mean”, “dayofweek_std”]
usr_data[‘user_id’]=usr_data.index
usr_data = usr_data.reset_index(drop=True)
usr_data.head()
from sklearn.model_selection import StratifiedKFold,train_test_splitfrom lightgbm import LGBMClassifierX,y=df_train.drop(['impression_id','is_click'],axis=1),df_train['is_click'] Xtest=df_test.drop(['impression_id','is_click'],axis=1)X_train,X_val,y_train,y_val = train_test_split(X,y,test_size=0.25,random_state = 1994,stratify=y)
Attached link contain the LGBM and Catboost code implementation
WNS HACKATHON SOURCE CODE GITHUB
In this example you can see the basic pandas function and graph view of Sales and weather reports.
Question 1 – In the lab, you filtered the data to show only weekdays (Monday – Friday) and sorted it by temperature.
#On which date was the lowest weekday temperature recorded?
#Month ?
#Day ?
Question 2
#What was the lowest weekday temperature recorded?
Question 3 a:
#In the lab, you calculated the total number of flyers that Rosie distributed.
#How many flyers did Rosie distribute for the entire year?
Question 3 b
#How many flyers did Rosie distribute in January?
Question 4:
#Based on your examination of the data, which two of the folowing statements are true?
Option1: Sales tend to be higher on days with high temperatures.
Option2: Sales tend to be lower on days with high temperatures.
Option3: Sales tend to be higher on days with high rainfall.
Option4: Sales tend to be higher on days with low rainfall.