본문 바로가기

E-commerce Data 분석

3-3

## Environment : Anaconda-navigator
## Programming Language : Python 3
## Import Pandas
## import seaborn as sns
## import Numpy as np
## import matplotlib pyplot as plt

## from datetime import timedelta

## from datetime import datetime, date
## from scipy.sparse import csr_matrix
## from math import sqrt
## from tqdm import tqdm_notebook as tqdm
## from sklearn.metrics.pairwise import cosine_similarity
## from sklearn.model_selection import train_test_split
## from sklearn.metrics import mean_squared_error
## import plotly.express as px

 

 

1. 데이터를 불러오기 및 데이터 전처리
2. 데이터 분석
3. 추천시스템

 

 

 

기존 3-2 데이터를 이어서 하겠습니다.

https://datapractice0815.tistory.com/247

 

3-2

## Environment : Anaconda-navigator ## Programming Language : Python 3 ## Import Pandas ## import seaborn as sns ## import Numpy as np ## import matplotlib pyplot as plt ## from datetime import timedelta ## from datetime import datetime, date ## from scipy

datapractice0815.tistory.com

 

 

2-3 데이터 분석을 기반으로 10~12시, 20~24(0)시 feature를 만들어 추가하겠습니다.

sample_df['event_timestamp_hour'] = sample_df['event_timestamp_hour'].replace(0, 24)
sample_df['time_1'] = np.where((sample_df['event_timestamp_hour'] >= 10)&(sample_df["event_timestamp_hour"].values <= 12) , 1, 0)
sample_df['time_2'] = np.where((sample_df["event_timestamp_hour"].values >= 20), 1, 0)

 

epoch_loss = fit(X_sparse, y_data.values, config)

 

plt.plot(epoch_loss)
plt.title('Loss per epoch')
plt.show()

 

다른 추가적인 부분도 feature를 추가해보겠습니다.

반응형

'E-commerce Data 분석' 카테고리의 다른 글

3-5  (0) 2023.05.21
3-4  (0) 2023.05.21
3-2  (0) 2023.05.20
3-1  (0) 2023.05.20
2-7  (0) 2023.05.20