I would like to make a simple comparison between C.F. filtered features and avaraged CNN features.

  • The evaluation will be based on top 10 ranking items.
  • The data set will be from Scrap_images_for_view2buy, which contains events that have > 20 viewed items and we have extracted features as well as images.

Todo

  1. Plot images and visualize how item-similarity-based CF predicts the similar items.
  2. Based on recommended similar items for each view_item, extract features from all of those similar items and average them as user_features.
  3. From step 2, compare the prediction between these new user_features and original user_features.

Result

  1. The rationale is correct, but the procedure of data processing is inaccurate in the end, thus the uer_CF_features and user_Ori_features are not correct.
  2. However, I corrected it in the Evaluation again with CF... notebook. The real ranking and real score will be revealed there.

In [1]:
import pandas as pd
import numpy as np
import os
import scipy as sp
from sklearn.metrics.pairwise import cosine_similarity
import operator
import cv2
import glob
from keras.preprocessing import image
from matplotlib import pyplot as plt
import seaborn as sns
%matplotlib inline


Using TensorFlow backend.

In [2]:
os.chdir('/Users/Walkon302/Desktop/deep-learning-models-master/view2buy')

In [3]:
df = pd.read_pickle('view2buy_url.pkl')

In [4]:
df.shape


Out[4]:
(17460, 15)

In [5]:
df.head()


Out[5]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt view_secondes view_features buy_features spu url
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/...
1 529805243\t103096245561765919\t10010102\t334\t... 529805243 103096245561765919 10010102 334 14150170026959126 10010102 334 37794 4 66 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.467, 0.385, 0.0, 0.043, 0.292, 0.0, 0.448, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/...
2 3748045464\t446777176556679168\t10005711\t334\... 3748045464 446777176556679168 10005711 334 14150170026959126 10010102 334 18820 1 34 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.018, 0.161, 0.088, 0.141, 0.231, 0.0, 0.036... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/...
3 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/...
4 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/...

In [26]:
df_cf = df.groupby(['view_spu','user_id', 'view_cnt']).count()

In [27]:
df_cf = df_cf.reset_index()[['user_id', 'view_spu', 'view_cnt']]
df_cf.head()


Out[27]:
user_id view_spu view_cnt
0 1429699002 357872333107204 2
1 2158456481 357872333107204 4
2 2182405033 357872333107204 1
3 3292098022 357872333107204 1
4 1480300841 357875526680651 2

In [28]:
piv = df_cf.pivot_table(index=['user_id'], columns=['view_spu'], values='view_cnt')

In [31]:
piv.head()


Out[31]:
view_spu 357872333107204 357875526680651 357882254983171 357901107539985 639360131194904 639369692328147 639371126526005 639389503180805 639392717246493 920816362999808 ... 9037674851989819400 9038237806216196097 9039645182176481286 9039926651803541506 9041615583843246080 9088621908743286785 9089747807251402752 9090029283626840066 9090592232181542912 9094251405871296512
user_id
3440325 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... 1.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN
7052311 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
9254280 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
15286946 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
32626686 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

5 rows × 2155 columns


In [34]:
# Normalized to average of clickes
piv_norm = piv.apply(lambda x: (x/np.mean(x)), axis=1)

In [35]:
piv_norm.head()


Out[35]:
view_spu 357872333107204 357875526680651 357882254983171 357901107539985 639360131194904 639369692328147 639371126526005 639389503180805 639392717246493 920816362999808 ... 9037674851989819400 9038237806216196097 9039645182176481286 9039926651803541506 9041615583843246080 9088621908743286785 9089747807251402752 9090029283626840066 9090592232181542912 9094251405871296512
user_id
3440325 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... 0.438356 NaN NaN NaN NaN NaN NaN NaN NaN NaN
7052311 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
9254280 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
15286946 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
32626686 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

5 rows × 2155 columns


In [36]:
piv_norm.fillna(0, inplace=True)

In [38]:
piv_norm = piv_norm.T
piv_norm = piv_norm.loc[:, (piv_norm != 0).any(axis=0)]

In [39]:
piv_sparse = sp.sparse.csr_matrix(piv_norm.values)

In [40]:
piv_sparse


Out[40]:
<2155x361 sparse matrix of type '<type 'numpy.float64'>'
	with 12778 stored elements in Compressed Sparse Row format>

In [41]:
item_similarity = cosine_similarity(piv_sparse)
user_similarity = cosine_similarity(piv_sparse.T)

In [42]:
item_sim_df = pd.DataFrame(item_similarity, index = piv_norm.index, columns = piv_norm.index)
user_sim_df = pd.DataFrame(user_similarity, index = piv_norm.columns, columns = piv_norm.columns)

In [329]:
item_sim_df.head()


Out[329]:
view_spu 357872333107204 357875526680651 357882254983171 357901107539985 639360131194904 639369692328147 639371126526005 639389503180805 639392717246493 920816362999808 ... 9037674851989819400 9038237806216196097 9039645182176481286 9039926651803541506 9041615583843246080 9088621908743286785 9089747807251402752 9090029283626840066 9090592232181542912 9094251405871296512
view_spu
357872333107204 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.00000 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0
357875526680651 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.00000 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0
357882254983171 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.63211 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0
357901107539985 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.00000 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.013268 0.0
639360131194904 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.00000 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0

5 rows × 2155 columns


In [44]:
def top_product(product_name):
    count = 1
    print('Similar products to {} include:\n'.format(product_name))
    for item in item_sim_df.sort_values(by = product_name, ascending = False).index[1:11]:
        print('No. {}: {}'.format(count, item))
        count +=1
    return item_sim_df.sort_values(by = product_name, ascending = False).index[1:11]

In [111]:
def top_product_noprint(product_name):
    return list(item_sim_df.sort_values(by = product_name, ascending = False).index[1:11])

In [112]:
b = top_product_noprint(639371126526005)

In [113]:
b


Out[113]:
[2166589220222894080,
 444243906496860160,
 461132458872606754,
 452406680821547008,
 937950908773744640,
 1586187811960238082,
 1099236096233168896,
 1102050800015937536,
 98311167513120777,
 8951824985835937792]

In [105]:
item_sim_df.sort_values(by = 639371126526005, ascending = False)[1:11]


Out[105]:
view_spu 357872333107204 357875526680651 357882254983171 357901107539985 639360131194904 639369692328147 639371126526005 639389503180805 639392717246493 920816362999808 ... 9037674851989819400 9038237806216196097 9039645182176481286 9039926651803541506 9041615583843246080 9088621908743286785 9089747807251402752 9090029283626840066 9090592232181542912 9094251405871296512
view_spu
2166589220222894080 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
444243906496860160 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
461132458872606754 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
452406680821547008 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
937950908773744640 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1586187811960238082 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1099236096233168896 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1102050800015937536 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
98311167513120777 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
8951824985835937792 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

10 rows × 2155 columns


In [46]:
def top_users(user):
    
    if user not in piv_norm.columns:
        return('No data available on user {}'.format(user))
    
    print('Most Similar Users:\n')
    sim_values = user_sim_df.sort_values(by=user, ascending=False).loc[:,user].tolist()[1:11]
    sim_users = user_sim_df.sort_values(by=user, ascending=False).index[1:11]
    zipped = zip(sim_users, sim_values,)
    for user, sim in zipped:
        print('User #{0}, Similarity value: {1:.2f}'.format(user, sim))

In [47]:
def similar_user_recs(user):
    
    if user not in piv_norm.columns:
        return('No data available on user {}'.format(user))
    
    sim_users = user_sim_df.sort_values(by=user, ascending=False).index[1:11]
    best = []
    most_common = {}
    
    for i in sim_users:
        max_score = piv_norm.loc[:, i].max()
        best.append(piv_norm[piv_norm.loc[:, i]==max_score].index.tolist())
    for i in range(len(best)):
        for j in best[i]:
            if j in most_common:
                most_common[j] += 1
            else:
                most_common[j] = 1
    sorted_list = sorted(most_common.items(), key=operator.itemgetter(1), reverse=True)
    return sorted_list[:5]

In [48]:
def predicted_rating(anime_name, user):
    sim_users = user_sim_df.sort_values(by=user, ascending=False).index[1:1000]
    user_values = user_sim_df.sort_values(by=user, ascending=False).loc[:,user].tolist()[1:1000]
    rating_list = []
    weight_list = []
    for j, i in enumerate(sim_users):
        rating = piv.loc[i, anime_name]
        similarity = user_values[j]
        if np.isnan(rating):
            continue
        elif not np.isnan(rating):
            rating_list.append(rating*similarity)
            weight_list.append(similarity)
    return sum(rating_list)/sum(weight_list)

In [49]:
view_image = pd.DataFrame(glob.glob('view_data_image/*.jpg'))

In [50]:
view_image['produuct'] = view_image[0].apply(lambda x: int(x[16:-4]))

In [51]:
view_image.columns = [['file', 'product']]

In [52]:
def plot_top_rank(product_id):
    candidate = top_product(product_id)
    candidate_df = view_image[view_image['product'].isin(candidate)]
    test_view = candidate_df['file']
    
    fig,axes = plt.subplots(1, len(test_view))

    for i in range(len(test_view)):
        img = image.load_img(test_view.iloc[i], target_size=(224, 224))
        # images
        axes[i].imshow(img)
        axes[i].set_xticklabels([])
        #axes[0,i].get_xaxis().set_visible(False)
        axes[i].get_xaxis().set_ticks([])
        axes[i].get_yaxis().set_visible(False)

In [53]:
plot_top_rank(639371126526005)


Similar products to 639371126526005 include:

No. 1: 2166589220222894080
No. 2: 444243906496860160
No. 3: 461132458872606754
No. 4: 452406680821547008
No. 5: 937950908773744640
No. 6: 1586187811960238082
No. 7: 1099236096233168896
No. 8: 1102050800015937536
No. 9: 98311167513120777
No. 10: 8951824985835937792

In [121]:
df['CF_item'] = df['view_spu'].apply(lambda x: top_product_noprint(x))

In [152]:
df


Out[152]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt view_secondes view_features buy_features spu url CF_item
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747...
1 529805243\t103096245561765919\t10010102\t334\t... 529805243 103096245561765919 10010102 334 14150170026959126 10010102 334 37794 4 66 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.467, 0.385, 0.0, 0.043, 0.292, 0.0, 0.448, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747...
2 3748045464\t446777176556679168\t10005711\t334\... 3748045464 446777176556679168 10005711 334 14150170026959126 10010102 334 18820 1 34 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.018, 0.161, 0.088, 0.141, 0.231, 0.0, 0.036... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747...
3 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747...
4 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747...
5 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 99155636687355977 10023064 334 18202 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
6 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 99155636687355977 10023064 334 11066 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
7 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 99155636687355977 10023064 334 11401 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
8 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 82548613061427358 10023064 334 18053 2 10 [0.261, 1.139, 0.074, 2.173, 0.081, 0.0, 0.158... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 82548613061427358 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
9 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 82548613061427358 10023064 334 10917 2 10 [0.261, 1.139, 0.074, 2.173, 0.081, 0.0, 0.158... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 82548613061427358 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
10 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 82548613061427358 10023064 334 11252 2 10 [0.261, 1.139, 0.074, 2.173, 0.081, 0.0, 0.158... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 82548613061427358 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
11 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 74104320184119307 10004616 334 6801 10 62 [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 74104320184119307 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
12 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 74104320184119307 10004616 334 0 10 62 [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 74104320184119307 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
13 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 443118006171230222 10004616 334 15671 2 10 [0.349, 0.113, 0.013, 0.515, 0.542, 0.0, 0.097... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 443118006171230222 http://a.vpimg2.com/upload/merchandise/pdc/222... [455221430169571357, 453532580309307392, 44311...
14 452067350\t447621605798383646\t10004616\t334\t... 452067350 447621605798383646 10004616 334 443118006171230222 10004616 334 30651 3 19 [0.349, 0.113, 0.013, 0.515, 0.542, 0.0, 0.097... [0.035, 0.03, 0.0, 0.271, 0.988, 0.0, 0.26, 0.... 443118006171230222 http://a.vpimg2.com/upload/merchandise/pdc/222... [455221430169571357, 453532580309307392, 44311...
15 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 443118006171230222 10004616 334 8535 2 10 [0.349, 0.113, 0.013, 0.515, 0.542, 0.0, 0.097... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 443118006171230222 http://a.vpimg2.com/upload/merchandise/pdc/222... [455221430169571357, 453532580309307392, 44311...
16 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 443118006171230222 10004616 334 8870 2 10 [0.349, 0.113, 0.013, 0.515, 0.542, 0.0, 0.097... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 443118006171230222 http://a.vpimg2.com/upload/merchandise/pdc/222... [455221430169571357, 453532580309307392, 44311...
17 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 455221430169571357 10004616 334 15829 2 25 [0.128, 1.575, 0.0, 0.03, 0.0, 0.0, 0.013, 0.0... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 455221430169571357 http://a.vpimg2.com/upload/merchandise/pdcvis/... [443118006171230222, 453532580309307392, 99155...
18 452067350\t447621605798383646\t10004616\t334\t... 452067350 447621605798383646 10004616 334 455221430169571357 10004616 334 30803 2 19 [0.128, 1.575, 0.0, 0.03, 0.0, 0.0, 0.013, 0.0... [0.035, 0.03, 0.0, 0.271, 0.988, 0.0, 0.26, 0.... 455221430169571357 http://a.vpimg2.com/upload/merchandise/pdcvis/... [443118006171230222, 453532580309307392, 99155...
19 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 455221430169571357 10004616 334 8693 2 25 [0.128, 1.575, 0.0, 0.03, 0.0, 0.0, 0.013, 0.0... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 455221430169571357 http://a.vpimg2.com/upload/merchandise/pdcvis/... [443118006171230222, 453532580309307392, 99155...
20 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 455221430169571357 10004616 334 9028 2 25 [0.128, 1.575, 0.0, 0.03, 0.0, 0.0, 0.013, 0.0... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 455221430169571357 http://a.vpimg2.com/upload/merchandise/pdcvis/... [443118006171230222, 453532580309307392, 99155...
21 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 453532580309307392 10004616 334 0 13 149 [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 453532580309307392 http://a.vpimg2.com/upload/merchandise/pdc/392... [82548613061427358, 443680956124434457, 872045...
22 452067350\t447621605798383646\t10004616\t334\t... 452067350 447621605798383646 10004616 334 453532580309307392 10004616 334 30439 2 6 [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... [0.035, 0.03, 0.0, 0.271, 0.988, 0.0, 0.26, 0.... 453532580309307392 http://a.vpimg2.com/upload/merchandise/pdc/392... [82548613061427358, 443680956124434457, 872045...
23 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 438895881520357521 10004616 334 7136 10 77 [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 438895881520357521 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
24 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 438895881520357521 10004616 334 0 10 77 [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 438895881520357521 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
25 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 461976829617950723 10004616 334 15660 1 10 [0.006, 0.131, 0.0, 0.44, 0.406, 0.002, 0.198,... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 461976829617950723 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
26 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 461976829617950723 10004616 334 8524 1 10 [0.006, 0.131, 0.0, 0.44, 0.406, 0.002, 0.198,... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 461976829617950723 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
27 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 461976829617950723 10004616 334 8859 1 10 [0.006, 0.131, 0.0, 0.44, 0.406, 0.002, 0.198,... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 461976829617950723 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
28 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 74104337169281026 10004616 334 15606 1 4 [0.054, 0.782, 0.0, 0.269, 0.0, 0.0, 0.164, 0.... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 74104337169281026 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
29 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 74104337169281026 10004616 334 8470 1 4 [0.054, 0.782, 0.0, 0.269, 0.0, 0.0, 0.164, 0.... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 74104337169281026 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
17430 3911343638\t322365288165343239\t10014336\t334\... 3911343638 322365288165343239 10014336 334 296469590308003913 10014336 334 57409 1 5 [0.49, 0.574, 0.0, 0.798, 0.495, 0.087, 0.0, 2... [0.198, 0.7, 0.0, 0.766, 0.072, 0.159, 0.208, ... 296469590308003913 http://a.vpimg2.com/upload/merchandise/pdcvis/... [320394944213688325, 24846205651685917, 940890...
17431 3911343638\t322365288165343239\t10014336\t334\... 3911343638 322365288165343239 10014336 334 24846205651685917 10000236 334 27969 2 6 [0.195, 0.578, 0.011, 0.381, 0.152, 0.414, 0.3... [0.198, 0.7, 0.0, 0.766, 0.072, 0.159, 0.208, ... 24846205651685917 http://a.vpimg2.com/upload/merchandise/pdcvis/... [320394944213688325, 24846205651685917, 940890...
17432 3911343638\t322365288165343239\t10014336\t334\... 3911343638 322365288165343239 10014336 334 94089060200394781 10014937 334 283155 1 3 [0.495, 0.011, 0.164, 0.074, 0.049, 0.131, 0.5... [0.198, 0.7, 0.0, 0.766, 0.072, 0.159, 0.208, ... 94089060200394781 http://a.vpimg2.com/upload/merchandise/pdcvis/... [320394944213688325, 24846205651685917, 940890...
17433 3911343638\t322365288165343239\t10014336\t334\... 3911343638 322365288165343239 10014336 334 16683450073329829 10014935 334 282693 1 5 [0.0, 0.073, 0.077, 2.275, 0.892, 0.112, 2.694... [0.198, 0.7, 0.0, 0.766, 0.072, 0.159, 0.208, ... 16683450073329829 http://a.vpimg2.com/upload/merchandise/pdcvis/... [320394944213688325, 24846205651685917, 940890...
17434 3911343638\t322365288165343239\t10014336\t334\... 3911343638 322365288165343239 10014336 334 294217781419814982 10005149 334 282853 1 3 [0.136, 1.584, 0.041, 0.77, 0.472, 0.0, 0.219,... [0.198, 0.7, 0.0, 0.766, 0.072, 0.159, 0.208, ... 294217781419814982 http://a.vpimg2.com/upload/merchandise/pdcvis/... [320394944213688325, 24846205651685917, 940890...
17435 3911343638\t322365288165343239\t10014336\t334\... 3911343638 322365288165343239 10014336 334 294217781419814982 10005149 334 282853 1 3 [0.136, 1.584, 0.041, 0.77, 0.472, 0.0, 0.219,... [0.198, 0.7, 0.0, 0.766, 0.072, 0.159, 0.208, ... 294217781419814982 http://a.vpimg2.com/upload/merchandise/pdcvis/... [320394944213688325, 24846205651685917, 940890...
17436 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 306321168550178838 10010632 334 0 13 131 [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 306321168550178838 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17437 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 306321168550178838 10010632 334 0 13 131 [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 306321168550178838 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17438 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 306321168550178838 10010632 334 0 13 131 [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 306321168550178838 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17439 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 318987551984439312 10004555 334 74803 6 71 [0.048, 0.091, 0.0, 1.76, 0.138, 0.25, 0.216, ... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 318987551984439312 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17440 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 307447096769863685 10015669 334 76479 2 43 [1.109, 0.152, 0.202, 0.621, 0.771, 0.75, 0.0,... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 307447096769863685 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17441 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 436362635423064564 10004555 334 76237 2 11 [0.433, 0.463, 0.0, 1.107, 0.163, 0.617, 0.182... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 436362635423064564 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17442 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 91837257329438722 10004555 334 75317 2 11 [0.408, 0.072, 0.0, 2.766, 0.0, 1.02, 1.066, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 91837257329438722 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17443 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 10209541474324698 10014085 334 74382 1 3 [0.179, 2.094, 0.0, 0.207, 0.14, 0.054, 0.0, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 10209541474324698 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17444 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 10209541474324698 10014085 334 74382 1 3 [0.179, 2.094, 0.0, 0.207, 0.14, 0.054, 0.0, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 10209541474324698 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17445 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 10209541474324698 10014085 334 74382 1 3 [0.179, 2.094, 0.0, 0.207, 0.14, 0.054, 0.0, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 10209541474324698 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17446 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 10209541474324698 10014085 334 74382 1 3 [0.179, 2.094, 0.0, 0.207, 0.14, 0.054, 0.0, 0... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 10209541474324698 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17447 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 293654815629480211 10004555 334 75231 4 24 [0.141, 0.413, 0.0, 0.879, 0.035, 0.39, 0.733,... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 293654815629480211 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17448 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 90148410183647233 10014935 334 37600 1 7 [0.675, 1.354, 0.0, 2.279, 0.112, 0.008, 0.07,... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 90148410183647233 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17449 780111768\t306321168550178838\t10010632\t334\t... 780111768 306321168550178838 10010632 334 74948761441271810 10014935 334 37548 2 11 [0.588, 1.416, 0.0, 0.608, 0.684, 0.0, 0.701, ... [0.092, 0.151, 0.0, 0.981, 0.06, 0.0, 0.102, 0... 74948761441271810 http://a.vpimg2.com/upload/merchandise/pdcvis/... [318987551984439312, 293654815629480211, 30744...
17450 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 300128739550408715 10014793 334 12340 1 25 [0.196, 0.731, 0.015, 0.222, 0.154, 0.0, 0.529... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 300128739550408715 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17451 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 297314002868527124 10012320 334 12924 1 4 [1.458, 1.84, 0.039, 0.44, 0.071, 0.0, 0.317, ... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 297314002868527124 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17452 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 89304008517624104 10014085 334 13009 1 68 [0.134, 1.968, 0.014, 1.057, 0.228, 0.008, 0.2... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 89304008517624104 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17453 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 89304008517624104 10014085 334 13009 1 68 [0.134, 1.968, 0.014, 1.057, 0.228, 0.008, 0.2... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 89304008517624104 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17454 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 3172644484366424 10012320 334 12743 1 1 [0.706, 0.552, 0.0, 0.55, 0.241, 0.0, 0.43, 0.... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 3172644484366424 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17455 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 462821279656333429 10014872 334 13083 1 6 [0.094, 1.658, 0.0, 0.499, 0.603, 0.026, 0.17,... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 462821279656333429 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17456 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 439458865467551753 10014793 334 12730 1 0 [0.345, 0.741, 0.073, 0.378, 0.111, 0.101, 0.2... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 439458865467551753 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17457 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 315046913029713936 10021264 334 12558 1 10 [1.037, 1.816, 0.067, 0.334, 0.272, 0.04, 0.65... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 315046913029713936 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17458 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 316735778810167299 10001187 334 11933 1 1 [0.08, 0.398, 0.029, 1.069, 0.522, 0.147, 0.28... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 316735778810167299 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...
17459 3822883947\t465073060372287493\t10021264\t334\... 3822883947 465073060372287493 10021264 334 461695358101766158 10021264 334 13476 1 11 [0.214, 2.829, 0.094, 1.479, 0.307, 0.0, 0.248... [0.56, 0.809, 0.0, 0.332, 0.001, 0.012, 0.327,... 461695358101766158 http://a.vpimg2.com/upload/merchandise/pdcvis/... [315046913029713936, 461695358101766158, 46282...

17460 rows × 16 columns


In [123]:
#df.to_pickle('view2buy_url_CF.pkl')

In [149]:
df_spu = pd.DataFrame(df.groupby('spu').count().reset_index()['spu'])

In [156]:
df_spu.head()


Out[156]:
spu
0 357872333107204
1 357875526680651
2 357882254983171
3 357901107539985
4 639360131194904

In [170]:
# assign CF_item to each spu
df_spu['CF_item'] = df_spu.apply(lambda x: df[df['spu'] == x['spu']]['CF_item'].iloc[0], axis = 1)

In [174]:
# Assign item feature for each spu
df_spu['spu_features'] = df_spu.apply(lambda x: df[df['spu'] == x['spu']]['view_features'].iloc[0], axis = 1)

In [175]:
df_spu.head()


Out[175]:
spu CF_item spu_features
0 357872333107204 [8952950888272863232, 1664156381170176000, 284... [0.035, 0.385, 0.112, 0.014, 0.0, 0.123, 0.438...
1 357875526680651 [2046769978417582, 461413925257830545, 3255052... [0.132, 1.678, 0.061, 0.918, 0.462, 0.342, 0.4...
2 357882254983171 [459725075493814272, 8582811288237465674, 1976... [0.026, 0.936, 0.056, 0.614, 0.139, 0.0, 0.302...
3 357901107539985 [2466922956389351424, 8459806721299259392, 780... [0.229, 0.543, 0.132, 0.144, 0.295, 0.018, 0.0...
4 639360131194904 [451843765076328474, 81141212316332372, 320394... [1.113, 0.5, 0.758, 0.218, 0.0, 0.0, 0.335, 1....

In [208]:
# Assign item_features for all CF_item
df_spu['CF_features'] = df_spu.apply(lambda x: [df_spu[df_spu['spu'] == i]['spu_features'] for i in x['CF_item']], axis = 1)

In [209]:
df_spu.head()


Out[209]:
spu CF_item spu_features CF_features
0 357872333107204 [8952950888272863232, 1664156381170176000, 284... [0.035, 0.385, 0.112, 0.014, 0.0, 0.123, 0.438... [[[0.462, 0.551, 0.068, 0.833, 0.0, 0.0, 0.0, ...
1 357875526680651 [2046769978417582, 461413925257830545, 3255052... [0.132, 1.678, 0.061, 0.918, 0.462, 0.342, 0.4... [[[0.357, 2.503, 0.0, 0.641, 0.143, 0.0, 0.104...
2 357882254983171 [459725075493814272, 8582811288237465674, 1976... [0.026, 0.936, 0.056, 0.614, 0.139, 0.0, 0.302... [[[1.884, 0.52, 0.0, 3.98, 0.175, 0.008, 0.663...
3 357901107539985 [2466922956389351424, 8459806721299259392, 780... [0.229, 0.543, 0.132, 0.144, 0.295, 0.018, 0.0... [[[0.124, 0.819, 0.0, 0.596, 0.306, 0.043, 0.2...
4 639360131194904 [451843765076328474, 81141212316332372, 320394... [1.113, 0.5, 0.758, 0.218, 0.0, 0.0, 0.335, 1.... [[[0.501, 0.12, 0.0, 0.0, 0.23, 0.108, 0.377, ...

In [265]:
# Calculate the average features from 10 CF_recommended items for each spu
def CF_ave(CF_list):
    return [np.mean(i) for i in zip(*[list(x)[0] for x in CF_list])]

In [267]:
df_spu['ave_CF_fea'] = df_spu.apply(lambda x: CF_ave(x['CF_features']), axis = 1)

In [272]:
df_spu.head()


Out[272]:
spu CF_item spu_features CF_features ave_CF_fea
0 357872333107204 [8952950888272863232, 1664156381170176000, 284... [0.035, 0.385, 0.112, 0.014, 0.0, 0.123, 0.438... [[[0.462, 0.551, 0.068, 0.833, 0.0, 0.0, 0.0, ... [0.4269, 0.6321, 0.101, 0.9695, 0.2211, 0.131,...
1 357875526680651 [2046769978417582, 461413925257830545, 3255052... [0.132, 1.678, 0.061, 0.918, 0.462, 0.342, 0.4... [[[0.357, 2.503, 0.0, 0.641, 0.143, 0.0, 0.104... [0.4727, 0.8078, 0.0697, 0.5796, 0.3075, 0.009...
2 357882254983171 [459725075493814272, 8582811288237465674, 1976... [0.026, 0.936, 0.056, 0.614, 0.139, 0.0, 0.302... [[[1.884, 0.52, 0.0, 3.98, 0.175, 0.008, 0.663... [0.6206, 0.8754, 0.1066, 0.7549, 0.2387, 0.186...
3 357901107539985 [2466922956389351424, 8459806721299259392, 780... [0.229, 0.543, 0.132, 0.144, 0.295, 0.018, 0.0... [[[0.124, 0.819, 0.0, 0.596, 0.306, 0.043, 0.2... [0.4016, 0.6379, 0.2088, 0.7764, 0.3335, 0.012...
4 639360131194904 [451843765076328474, 81141212316332372, 320394... [1.113, 0.5, 0.758, 0.218, 0.0, 0.0, 0.335, 1.... [[[0.501, 0.12, 0.0, 0.0, 0.23, 0.108, 0.377, ... [0.2916, 0.5296, 0.0964, 0.3321, 0.1873, 0.022...

In [273]:
#df_spu.to_pickle('spu_CF_features.pkl')

In [275]:
# Assign user_CF_fea back to df
df2 = pd.merge(df, df_spu[['spu', 'CF_item', 'ave_CF_fea']], on='spu')

In [283]:
#df2.to_pickle('view2buy_url_CF_fea.pkl')

In [ ]:


In [155]:
plot_top_rank(82548613061427358)


Similar products to 82548613061427358 include:

No. 1: 438895881520357521
No. 2: 74104320184119307
No. 3: 443680956124434457
No. 4: 8720452635027472384
No. 5: 3061398180775350287
No. 6: 97185268274397914
No. 7: 93807568553869425
No. 8: 82548613061427358
No. 9: 461976829617950723
No. 10: 99155636687355977

In [324]:
df[['view_spu', 'CF_item']].head()


Out[324]:
view_spu CF_item
0 14150170026959126 [82267097285177879, 12742773141631009, 3341747...
1 14150170026959126 [82267097285177879, 12742773141631009, 3341747...
2 14150170026959126 [82267097285177879, 12742773141631009, 3341747...
3 14150170026959126 [82267097285177879, 12742773141631009, 3341747...
4 14150170026959126 [82267097285177879, 12742773141631009, 3341747...

In [285]:
def dot(K, L):
    if len(K) != len(L): return 0
    return sum(i[0]*i[1] for i in zip(K, L))

def similarity(item_1, item_2):
    return dot(item_1, item_2) / np.sqrt(dot(item_1, item_1)*dot(item_2, item_2))

def average(lists):
    return [np.mean(i) for i in zip(*[l for l in lists])]

In [284]:
df2.head()


Out[284]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt view_secondes view_features buy_features spu url CF_item_x CF_item_y ave_CF_fea
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070...
1 529805243\t103096245561765919\t10010102\t334\t... 529805243 103096245561765919 10010102 334 14150170026959126 10010102 334 37794 4 66 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.467, 0.385, 0.0, 0.043, 0.292, 0.0, 0.448, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070...
2 3748045464\t446777176556679168\t10005711\t334\... 3748045464 446777176556679168 10005711 334 14150170026959126 10010102 334 18820 1 34 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.018, 0.161, 0.088, 0.141, 0.231, 0.0, 0.036... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070...
3 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070...
4 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070...

In [286]:
CF_user_fea = df2.groupby(['user_id'])['ave_CF_fea'].apply(lambda x: average(x))
CF_user_fea = pd.DataFrame(CF_user_fea)
CF_user_fea = CF_user_fea.reset_index()
df2 = pd.merge(df2, CF_user_fea, on='user_id')

In [289]:
df2.rename(columns = {'ave_CF_fea_y':'user_features'}, inplace = True)
df2.head()


Out[289]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt view_secondes view_features buy_features spu url CF_item_x CF_item_y ave_CF_fea_x user_features
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164...
1 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164...
2 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164...
3 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 99155636687355977 10023064 334 18202 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164...
4 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 99155636687355977 10023064 334 11066 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164...

In [290]:
df2['CF_sim'] = df2.apply(lambda x: similarity(x['buy_features'], x['user_features']), axis=1)

In [294]:
df2['CF_rank'] = df2.groupby('user_id')['CF_sim'].rank(ascending=False)

In [312]:
float(len(df2.query('buy_spu == view_spu & CF_rank <= 20')))/float(len(df2.query('buy_spu == view_spu'))) * 100


Out[312]:
52.52173913043479

In [300]:
ori_user_fea = df2.groupby(['user_id'])['view_features'].apply(lambda x: average(x))
ori_user_fea = pd.DataFrame(ori_user_fea)
ori_user_fea = ori_user_fea.reset_index()
df2 = pd.merge(df2, ori_user_fea, on='user_id')

In [302]:
df2.rename(columns = {'view_features_y':'ori_user_features'}, inplace = True)
df2.head()


Out[302]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt ... buy_features spu url CF_item_x CF_item_y ave_CF_fea_x user_features CF_sim CF_rank ori_user_features
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 ... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.844045 41.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0...
1 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 ... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.856012 8.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0...
2 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 ... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.848547 24.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0...
3 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 99155636687355977 10023064 334 18202 1 ... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.844045 41.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0...
4 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 99155636687355977 10023064 334 11066 1 ... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.856012 8.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0...

5 rows × 22 columns


In [303]:
df2['ori_sim'] = df2.apply(lambda x: similarity(x['buy_features'], x['ori_user_features']), axis=1)

In [304]:
df2['ori_rank'] = df2.groupby('user_id')['ori_sim'].rank(ascending=False)

In [305]:
df2.head()


Out[305]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt ... url CF_item_x CF_item_y ave_CF_fea_x user_features CF_sim CF_rank ori_user_features ori_sim ori_rank
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.844045 41.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0... 0.846224 25.5
1 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.856012 8.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0... 0.858529 8.5
2 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.5528, 1.3589, 0.0329, 0.2652, 0.1121, 0.070... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.848547 24.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0... 0.832240 42.5
3 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 99155636687355977 10023064 334 18202 1 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.844045 41.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0... 0.846224 25.5
4 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 99155636687355977 10023064 334 11066 1 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.856012 8.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0... 0.858529 8.5

5 rows × 24 columns


In [311]:
float(len(df2.query('buy_spu == view_spu & ori_rank <= 20')))/float(len(df2.query('buy_spu == view_spu'))) * 100


Out[311]:
53.391304347826086

In [313]:
df2.query('buy_spu == view_spu & ori_rank <= 20')


Out[313]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt ... url CF_item_x CF_item_y ave_CF_fea_x user_features CF_sim CF_rank ori_user_features ori_sim ori_rank
19 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 438895881520357521 10004616 334 0 10 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.146, 0.7319, 0.0257, 0.6735, 0.1741, 0.0252... [0.239576, 0.810066, 0.035606, 0.628386, 0.164... 0.856012 8.5 [0.19106, 0.82626, 0.0194, 0.53946, 0.18018, 0... 0.858529 8.5
59 529805243\t103096245561765919\t10010102\t334\t... 529805243 103096245561765919 10010102 334 103096245561765919 10010102 334 0 15 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [432984919028166664, 103096245561765919, 88845... [432984919028166664, 103096245561765919, 88845... [0.4964, 1.4481, 0.0383, 0.2953, 0.1801, 0.064... [0.491673913043, 1.41827826087, 0.0395, 0.2952... 0.870670 12.0 [0.42652173913, 1.05895652174, 0.0372608695652... 0.862389 12.0
151 452067350\t447621605798383646\t10004616\t334\t... 452067350 447621605798383646 10004616 334 447621605798383646 10004616 334 0 34 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [443118006171013127, 441147681334038541, 45634... [443118006171013127, 441147681334038541, 45634... [0.3717, 0.5098, 0.0997, 0.4122, 0.351, 0.0193... [0.34255, 0.609228571429, 0.0829642857143, 0.4... 0.848445 14.5 [0.37725, 0.702392857143, 0.0561071428571, 0.3... 0.812620 14.5
156 15286946\t453532609002410015\t10004555\t334\t4... 15286946 453532609002410015 10004555 334 453532609002410015 10004555 334 0 17 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [34416385332351047, 305758246909599747, 420981... [34416385332351047, 305758246909599747, 420981... [0.3937, 0.8731, 0.1322, 0.7968, 0.2441, 0.150... [0.352367857143, 0.822589285714, 0.08528214285... 0.815574 14.5 [0.321392857143, 0.776428571429, 0.14339285714... 0.810338 14.5
346 3223935950\t97185296913813714\t10021212\t334\t... 3223935950 97185296913813714 10021212 334 97185296913813714 10021212 334 0 11 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [81985618826645681, 291684485703237653, 294217... [81985618826645681, 291684485703237653, 294217... [0.4359, 0.6037, 0.0134, 0.5149, 0.1817, 0.051... [0.375063636364, 0.858648484848, 0.05751212121... 0.856785 17.0 [0.323515151515, 0.714272727273, 0.06439393939... 0.859584 17.0
414 592461982\t84800366075408747\t10000799\t334\t8... 592461982 84800366075408747 10000799 334 84800366075408747 10000799 334 0 4 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [84800366075408747, 318987586043674889, 451562... [84800366075408747, 318987586043674889, 451562... [0.4656, 0.5098, 0.1457, 0.8828, 0.3535, 0.232... [0.421535897436, 0.595582051282, 0.11993846153... 0.741503 20.0 [0.47958974359, 0.648820512821, 0.104, 0.88682... 0.729918 20.0
489 3994880652\t2885476247461195776\t10015294\t334... 3994880652 2885476247461195776 10015294 334 2885476247461195776 10015294 334 0 17 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [306321212091695188, 458317700514025542, 40524... [306321212091695188, 458317700514025542, 40524... [0.67, 0.5411, 0.0644, 0.868, 0.3529, 0.1367, ... [0.472656923077, 0.707832307692, 0.10590615384... 0.805711 13.0 [0.4698, 0.919953846154, 0.126323076923, 0.963... 0.827058 13.0
630 2608322838\t106755436261761039\t10014872\t334\... 2608322838 106755436261761039 10014872 334 106755436261761039 10014872 334 0 12 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [24001773283258462, 1675133904153440256, 45353... [24001773283258462, 1675133904153440256, 45353... [0.6804, 0.8802, 0.1442, 1.1184, 0.1597, 0.274... [0.454444303797, 0.78082278481, 0.098739240506... 0.778231 13.0 [0.387848101266, 0.805202531646, 0.10164556962... 0.790961 13.0
650 2947561985\t441710676888072337\t10011806\t334\... 2947561985 441710676888072337 10011806 334 441710676888072337 10011806 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [94933478395359303, 290840081699287083, 308010... [94933478395359303, 290840081699287083, 308010... [0.3463, 0.981, 0.102, 0.5711, 0.2106, 0.0935,... [0.360673076923, 0.939880769231, 0.10343846153... 0.787629 6.5 [0.429, 0.855384615385, 0.0958461538462, 0.746... 0.813535 6.5
651 2947561985\t441710676888072337\t10011806\t334\... 2947561985 441710676888072337 10011806 334 441710676888072337 10011806 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [94933478395359303, 290840081699287083, 308010... [94933478395359303, 290840081699287083, 308010... [0.3463, 0.981, 0.102, 0.5711, 0.2106, 0.0935,... [0.360673076923, 0.939880769231, 0.10343846153... 0.787629 6.5 [0.429, 0.855384615385, 0.0958461538462, 0.746... 0.813535 6.5
652 2947561985\t441710676888072337\t10011806\t334\... 2947561985 441710676888072337 10011806 334 441710676888072337 10011806 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [94933478395359303, 290840081699287083, 308010... [94933478395359303, 290840081699287083, 308010... [0.3463, 0.981, 0.102, 0.5711, 0.2106, 0.0935,... [0.360673076923, 0.939880769231, 0.10343846153... 0.787629 6.5 [0.429, 0.855384615385, 0.0958461538462, 0.746... 0.813535 6.5
657 2947561985\t313921037505220642\t10014085\t334\... 2947561985 313921037505220642 10014085 334 313921037505220642 10014085 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [81704173194727564, 34416350528626695, 3032249... [81704173194727564, 34416350528626695, 3032249... [0.3438, 0.9272, 0.1035, 0.2514, 0.2723, 0.075... [0.360673076923, 0.939880769231, 0.10343846153... 0.723379 19.5 [0.429, 0.855384615385, 0.0958461538462, 0.746... 0.782643 19.5
658 2947561985\t313921037505220642\t10014085\t334\... 2947561985 313921037505220642 10014085 334 313921037505220642 10014085 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [81704173194727564, 34416350528626695, 3032249... [81704173194727564, 34416350528626695, 3032249... [0.3438, 0.9272, 0.1035, 0.2514, 0.2723, 0.075... [0.360673076923, 0.939880769231, 0.10343846153... 0.723379 19.5 [0.429, 0.855384615385, 0.0958461538462, 0.746... 0.782643 19.5
685 3907786223\t91837265020604424\t10001187\t334\t... 3907786223 91837265020604424 10001187 334 91837265020604424 10001187 334 0 14 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [459725075493814272, 8582811288237465674, 1976... [459725075493814272, 8582811288237465674, 1976... [0.6206, 0.8754, 0.1066, 0.7549, 0.2387, 0.186... [0.586863333333, 0.858, 0.105576666667, 0.7250... 0.858075 15.5 [0.630233333333, 0.937433333333, 0.1205, 0.510... 0.849566 15.5
799 3095161062\t1103458172424577024\t10004542\t334... 3095161062 1103458172424577024 10004542 334 1103458172424577024 10004542 334 0 4 ... http://a.vpimg2.com/upload/merchandise/pdc/024... [4776143761154269185, 5152194332838232081, 100... [4776143761154269185, 5152194332838232081, 100... [0.3285, 0.6416, 0.0749, 0.3455, 0.1458, 0.078... [0.264690625, 0.6069375, 0.1147203125, 0.72568... 0.770290 18.5 [0.205546875, 0.711296875, 0.1264375, 0.829984... 0.764178 18.5
800 3095161062\t1103458172424577024\t10004542\t334... 3095161062 1103458172424577024 10004542 334 1103458172424577024 10004542 334 0 4 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [4776143761154269185, 5152194332838232081, 100... [4776143761154269185, 5152194332838232081, 100... [0.3285, 0.6416, 0.0749, 0.3455, 0.1458, 0.078... [0.264690625, 0.6069375, 0.1147203125, 0.72568... 0.770290 18.5 [0.205546875, 0.711296875, 0.1264375, 0.829984... 0.764178 18.5
862 1214726068\t304913827234218339\t10012320\t334\... 1214726068 304913827234218339 10012320 334 304913827234218339 10012320 334 0 10 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [19216723034046465, 443399498093764624, 158390... [19216723034046465, 443399498093764624, 158390... [0.3609, 0.6857, 0.1052, 0.8821, 0.2156, 0.079... [0.390289285714, 0.588753571429, 0.11518928571... 0.787193 14.5 [0.364571428571, 0.483571428571, 0.12882142857... 0.787836 14.5
923 47836480\t6926894069614792705\t10015294\t334\t... 47836480 6926894069614792705 10015294 334 6926894069614792705 10015294 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdc/705... [1382681401252843521, 452969637486940179, 2813... [1382681401252843521, 452969637486940179, 2813... [0.2775, 0.5055, 0.1901, 1.4445, 0.2465, 0.094... [0.378215816327, 0.578622959184, 0.11155255102... 0.830655 20.0 [0.405234693878, 0.484617346939, 0.09638775510... 0.817952 20.0
1412 3931127949\t2898705571343994880\t10015294\t334... 3931127949 2898705571343994880 10015294 334 2898705571343994880 10015294 334 0 32 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [4984998197125672960, 1374237151951519744, 461... [4984998197125672960, 1374237151951519744, 461... [0.1447, 0.595, 0.0917, 0.553, 0.2508, 0.0339,... [0.3405625, 0.6164125, 0.157433333333, 0.78712... 0.788478 12.5 [0.262875, 0.499833333333, 0.0689583333333, 0.... 0.822268 12.5
1427 3136294128\t2894764921674170372\t10015294\t334... 3136294128 2894764921674170372 10015294 334 2894764921674170372 10015294 334 0 16 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [1686111429343629315, 28786891111616513, 25972... [1686111429343629315, 28786891111616513, 25972... [0.4038, 0.5557, 0.1597, 0.707, 0.1769, 0.0678... [0.331554545455, 0.6447, 0.0935727272727, 0.84... 0.724110 14.5 [0.570227272727, 0.649272727273, 0.19804545454... 0.762314 14.5
1428 3136294128\t2894764921674170372\t10015294\t334... 3136294128 2894764921674170372 10015294 334 2894764921674170372 10015294 334 0 16 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [1686111429343629315, 28786891111616513, 25972... [1686111429343629315, 28786891111616513, 25972... [0.4038, 0.5557, 0.1597, 0.707, 0.1769, 0.0678... [0.331554545455, 0.6447, 0.0935727272727, 0.84... 0.724110 14.5 [0.570227272727, 0.649272727273, 0.19804545454... 0.762314 14.5
1438 3136294128\t4137758510770995353\t10021322\t334... 3136294128 4137758510770995353 10021322 334 4137758510770995353 10021322 334 0 8 ... http://a.vpimg2.com/upload/merchandise/pdc/353... [72696949585612823, 4405441215173906448, 44268... [72696949585612823, 4405441215173906448, 44268... [0.2407, 0.7008, 0.0805, 0.5976, 0.3137, 0.057... [0.331554545455, 0.6447, 0.0935727272727, 0.84... 0.780314 3.5 [0.570227272727, 0.649272727273, 0.19804545454... 0.821538 3.5
1452 2866108398\t2913060795180240896\t10015294\t334... 2866108398 2913060795180240896 10015294 334 2913060795180240896 10015294 334 0 26 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [19498211566673985, 86207743836479514, 1044066... [19498211566673985, 86207743836479514, 1044066... [0.5035, 0.7571, 0.1417, 1.0378, 0.2314, 0.043... [0.38429375, 0.6408875, 0.108209375, 0.8628718... 0.764523 16.5 [0.4126875, 0.70590625, 0.09915625, 1.1130625,... 0.779121 16.5
1720 555484648\t4121995912075198481\t10021322\t334\... 555484648 4121995912075198481 10021322 334 4121995912075198481 10021322 334 0 39 ... http://a.vpimg2.com/upload/merchandise/pdc/465... [5135587309212303375, 94370508260995072, 51516... [5135587309212303375, 94370508260995072, 51516... [0.1532, 0.6543, 0.1207, 0.4399, 0.2678, 0.039... [0.203568, 0.823736, 0.084388, 0.4788, 0.18318... 0.763103 13.0 [0.22572, 0.81372, 0.09384, 0.62872, 0.2912, 0... 0.791346 13.0
1721 555484648\t4121995912075198481\t10021322\t334\... 555484648 4121995912075198481 10021322 334 4121995912075198481 10021322 334 0 39 ... http://a.vpimg2.com/upload/merchandise/pdc/481... [5135587309212303375, 94370508260995072, 51516... [5135587309212303375, 94370508260995072, 51516... [0.1532, 0.6543, 0.1207, 0.4399, 0.2678, 0.039... [0.203568, 0.823736, 0.084388, 0.4788, 0.18318... 0.763103 13.0 [0.22572, 0.81372, 0.09384, 0.62872, 0.2912, 0... 0.791346 13.0
1731 1648797497\t2458760182748074014\t10015294\t334... 1648797497 2458760182748074014 10015294 334 2458760182748074014 10015294 334 0 12 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [29068318645403648, 22594394538049536, 4762070... [29068318645403648, 22594394538049536, 4762070... [0.2256, 0.5529, 0.053, 0.4374, 0.1225, 0.0524... [0.279984313725, 0.680384313725, 0.15253725490... 0.797642 9.5 [0.240882352941, 0.805862745098, 0.14235294117... 0.807198 9.5
1846 4187980304\t2595275618659840000\t10015294\t334... 4187980304 2595275618659840000 10015294 334 2595275618659840000 10015294 334 0 8 ... http://a.vpimg2.com/upload/merchandise/pdc/000... [1319349531493003264, 7095497481938001920, 479... [1319349531493003264, 7095497481938001920, 479... [0.2193, 0.6489, 0.1581, 0.8104, 0.2348, 0.025... [0.336240425532, 0.5653, 0.134685106383, 0.889... 0.744095 5.5 [0.320085106383, 0.447191489362, 0.14465957446... 0.786269 14.5
1869 4187980304\t2835936651544625153\t10015294\t334... 4187980304 2835936651544625153 10015294 334 2835936651544625153 10015294 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdc/153... [26535057988575267, 31320122316476689, 2830870... [26535057988575267, 31320122316476689, 2830870... [0.1611, 0.5368, 0.3609, 0.8776, 0.328, 0.039,... [0.336240425532, 0.5653, 0.134685106383, 0.889... 0.743770 15.0 [0.320085106383, 0.447191489362, 0.14465957446... 0.811477 5.0
1981 243514462\t6926894069614792705\t10015294\t334\... 243514462 6926894069614792705 10015294 334 6926894069614792705 10015294 334 0 10 ... http://a.vpimg2.com/upload/merchandise/pdc/705... [1382681401252843521, 452969637486940179, 2813... [1382681401252843521, 452969637486940179, 2813... [0.2775, 0.5055, 0.1901, 1.4445, 0.2465, 0.094... [0.3012125, 0.508129166667, 0.106933333333, 0.... 0.822983 12.5 [0.229541666667, 0.474708333333, 0.12166666666... 0.822220 12.5
2096 2426888536\t2813418653354196992\t10015294\t334... 2426888536 2813418653354196992 10015294 334 2813418653354196992 10015294 334 0 6 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [8662750181586251776, 1377051901718601729, 137... [8662750181586251776, 1377051901718601729, 137... [0.5332, 0.7492, 0.1144, 0.6, 0.2844, 0.1967, ... [0.3456325, 0.594905, 0.1108925, 0.8120675, 0.... 0.816760 10.5 [0.4451, 0.650325, 0.1355, 0.73595, 0.272725, ... 0.823144 10.5
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
16553 3610682986\t445369815557148672\t10010632\t334\... 3610682986 445369815557148672 10010632 334 445369815557148672 10010632 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [14150187009179680, 324335616658632710, 450999... [14150187009179680, 324335616658632710, 450999... [0.2689, 1.4142, 0.0927, 0.4585, 0.189, 0.2361... [0.312529411765, 1.24116470588, 0.079729411764... 0.821057 17.5 [0.448382352941, 0.997647058824, 0.11223529411... 0.794806 17.5
16571 1554339984\t8596322085984735235\t10010280\t334... 1554339984 8596322085984735235 10010280 334 8596322085984735235 10010280 334 0 17 ... http://a.vpimg2.com/upload/merchandise/pdc/235... [297032538646515795, 317298713887711240, 24528... [297032538646515795, 317298713887711240, 24528... [0.3147, 0.5983, 0.0038, 0.6514, 0.1253, 0.027... [0.249162962963, 0.728766666667, 0.0156, 0.558... 0.860755 15.5 [0.252185185185, 0.871037037037, 0.00603703703... 0.838798 12.5
16581 1554339984\t1110495040348078080\t10010280\t334... 1554339984 1110495040348078080 10010280 334 1110495040348078080 10010280 334 0 23 ... http://a.vpimg2.com/upload/merchandise/pdc/080... [8951262033821691904, 2452849280114839553, 297... [8951262033821691904, 2452849280114839553, 297... [0.2385, 0.8556, 0.0151, 0.5059, 0.183, 0.0098... [0.249162962963, 0.728766666667, 0.0156, 0.558... 0.849272 23.5 [0.252185185185, 0.871037037037, 0.00603703703... 0.840784 4.5
16626 1861947064\t74104361364131879\t10013882\t334\t... 1861947064 74104361364131879 10013882 334 74104361364131879 10013882 334 0 13 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [85926310385987705, 76637636154437685, 9746678... [85926310385987705, 76637636154437685, 9746678... [0.4335, 1.2381, 0.0453, 0.4612, 0.2093, 0.042... [0.414565454545, 1.21283818182, 0.042285454545... 0.811194 42.0 [0.312781818182, 1.19885454545, 0.047454545454... 0.841305 14.0
16681 1331828431\t454095538070356542\t10026622\t334\... 1331828431 454095538070356542 10026622 334 454095538070356542 10026622 334 0 12 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [439740327790035131, 317580194884001797, 44368... [439740327790035131, 317580194884001797, 44368... [0.2207, 0.6618, 0.0132, 0.5461, 0.1297, 0.035... [0.342635897436, 0.834548717949, 0.06031282051... 0.839829 10.5 [0.20141025641, 0.368769230769, 0.024717948717... 0.828540 10.5
16682 1331828431\t454095538070356542\t10026622\t334\... 1331828431 454095538070356542 10026622 334 454095538070356542 10026622 334 0 12 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [439740327790035131, 317580194884001797, 44368... [439740327790035131, 317580194884001797, 44368... [0.2207, 0.6618, 0.0132, 0.5461, 0.1297, 0.035... [0.342635897436, 0.834548717949, 0.06031282051... 0.839829 10.5 [0.20141025641, 0.368769230769, 0.024717948717... 0.828540 10.5
16784 7052311\t299847271351230626\t10026622\t334\t29... 7052311 299847271351230626 10026622 334 299847271351230626 10026622 334 0 7 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [309698895536103451, 454095538070356232, 32152... [309698895536103451, 454095538070356232, 32152... [0.33, 0.9287, 0.0633, 0.5098, 0.2855, 0.0818,... [0.298287628866, 0.715673195876, 0.06029896907... 0.834799 49.0 [0.271969072165, 0.610474226804, 0.12303092783... 0.840693 17.0
16785 7052311\t299847271351230626\t10026622\t334\t29... 7052311 299847271351230626 10026622 334 299847271351230626 10026622 334 0 7 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [309698895536103451, 454095538070356232, 32152... [309698895536103451, 454095538070356232, 32152... [0.33, 0.9287, 0.0633, 0.5098, 0.2855, 0.0818,... [0.298287628866, 0.715673195876, 0.06029896907... 0.834799 49.0 [0.271969072165, 0.610474226804, 0.12303092783... 0.840693 17.0
16798 3815843178\t444243941831672034\t10010852\t334\... 3815843178 444243941831672034 10010852 334 444243941831672034 10010852 334 0 8 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [441710662032580745, 308291524115485102, 10394... [441710662032580745, 308291524115485102, 10394... [0.2824, 0.683, 0.2229, 1.1594, 0.2255, 0.0681... [0.3311875, 0.766478125, 0.17661875, 1.0785562... 0.785073 16.5 [0.36471875, 0.88796875, 0.1501875, 0.86159375... 0.810796 16.5
16892 2362121317\t316735767206387720\t10000646\t334\... 2362121317 316735767206387720 10000646 334 316735767206387720 10000646 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdc/720... [436081137000575364, 454095577685246122, 30238... [436081137000575364, 454095577685246122, 30238... [0.401, 0.2909, 0.0293, 0.5172, 0.1946, 0.0116... [0.354632142857, 0.477289285714, 0.04255357142... 0.892519 4.0 [0.335178571429, 0.345071428571, 0.02464285714... 0.906572 4.0
16901 2362121317\t309417417811898397\t10000646\t334\... 2362121317 309417417811898397 10000646 334 309417417811898397 10000646 334 0 8 ... http://a.vpimg2.com/upload/merchandise/pdc/397... [22031466590310437, 436081137000575364, 316735... [22031466590310437, 436081137000575364, 316735... [0.3388, 0.3196, 0.0293, 0.4387, 0.1932, 0.012... [0.354632142857, 0.477289285714, 0.04255357142... 0.889411 13.5 [0.335178571429, 0.345071428571, 0.02464285714... 0.892091 13.5
16944 1400789170\t441710668753739784\t10026622\t334\... 1400789170 441710668753739784 10026622 334 441710668753739784 10026622 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [304350870978601448, 290840072096489614, 43579... [304350870978601448, 290840072096489614, 43579... [0.2363, 0.3551, 0.0772, 0.4849, 0.1982, 0.111... [0.272166666667, 0.7871, 0.06516, 0.5238733333... 0.813167 34.0 [0.1806, 0.376044444444, 0.0948666666667, 0.55... 0.828966 12.0
16945 1400789170\t441710668753739784\t10026622\t334\... 1400789170 441710668753739784 10026622 334 441710668753739784 10026622 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [304350870978601448, 290840072096489614, 43579... [304350870978601448, 290840072096489614, 43579... [0.2363, 0.3551, 0.0772, 0.4849, 0.1982, 0.111... [0.272166666667, 0.7871, 0.06516, 0.5238733333... 0.813167 34.0 [0.1806, 0.376044444444, 0.0948666666667, 0.55... 0.828966 12.0
16946 1400789170\t441710668753739784\t10026622\t334\... 1400789170 441710668753739784 10026622 334 441710668753739784 10026622 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [304350870978601448, 290840072096489614, 43579... [304350870978601448, 290840072096489614, 43579... [0.2363, 0.3551, 0.0772, 0.4849, 0.1982, 0.111... [0.272166666667, 0.7871, 0.06516, 0.5238733333... 0.813167 34.0 [0.1806, 0.376044444444, 0.0948666666667, 0.55... 0.828966 12.0
16966 1297772861\t16964899245101247\t10026622\t334\t... 1297772861 16964899245101247 10026622 334 16964899245101247 10026622 334 0 7 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [313921020186763439, 105629510176649216, 29956... [313921020186763439, 105629510176649216, 29956... [0.2629, 0.4592, 0.0386, 0.568, 0.1762, 0.0906... [0.314216129032, 0.641490322581, 0.04300645161... 0.829101 16.0 [0.277935483871, 0.36564516129, 0.073193548387... 0.838432 16.0
16967 1297772861\t16964899245101247\t10026622\t334\t... 1297772861 16964899245101247 10026622 334 16964899245101247 10026622 334 0 7 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [313921020186763439, 105629510176649216, 29956... [313921020186763439, 105629510176649216, 29956... [0.2629, 0.4592, 0.0386, 0.568, 0.1762, 0.0906... [0.314216129032, 0.641490322581, 0.04300645161... 0.829101 16.0 [0.277935483871, 0.36564516129, 0.073193548387... 0.838432 16.0
16993 3080939532\t22875915877388897\t10005711\t334\t... 3080939532 22875915877388897 10005711 334 22875915877388897 10005711 334 0 4 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [465917531270578213, 29631314239610880, 724155... [465917531270578213, 29631314239610880, 724155... [0.3323, 1.1037, 0.0659, 0.4129, 0.2991, 0.115... [0.340742857143, 0.854877142857, 0.07964285714... 0.760087 18.0 [0.273857142857, 0.912171428571, 0.11057142857... 0.764699 18.0
17013 1480300841\t3317258936357195776\t10021264\t334... 1480300841 3317258936357195776 10021264 334 3317258936357195776 10021264 334 0 39 ... http://a.vpimg2.com/upload/merchandise/pdc/776... [467043384438747175, 3184121272375554048, 3094... [467043384438747175, 3184121272375554048, 3094... [0.2251, 0.911, 0.0301, 0.6545, 0.262, 0.089, ... [0.453677777778, 0.795475, 0.0692444444444, 0.... 0.809553 18.5 [0.3505, 0.729388888889, 0.0519166666667, 0.96... 0.802779 18.5
17078 3129312134\t324054133432799257\t10014872\t334\... 3129312134 324054133432799257 10014872 334 324054133432799257 10014872 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [34416350528626695, 288588255925760016, 932446... [34416350528626695, 288588255925760016, 932446... [0.3159, 0.9209, 0.0855, 0.284, 0.305, 0.0511,... [0.339005263158, 1.00874210526, 0.0829, 0.4202... 0.863632 19.5 [0.351605263158, 0.916947368421, 0.12915789473... 0.848548 19.5
17079 3129312134\t324054133432799257\t10014872\t334\... 3129312134 324054133432799257 10014872 334 324054133432799257 10014872 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [34416350528626695, 288588255925760016, 932446... [34416350528626695, 288588255925760016, 932446... [0.3159, 0.9209, 0.0855, 0.284, 0.305, 0.0511,... [0.339005263158, 1.00874210526, 0.0829, 0.4202... 0.863632 19.5 [0.351605263158, 0.916947368421, 0.12915789473... 0.848548 19.5
17162 2554589799\t309980370512814101\t10026622\t334\... 2554589799 309980370512814101 10026622 334 309980370512814101 10026622 334 0 4 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [316172820000448823, 460006515688595666, 46507... [316172820000448823, 460006515688595666, 46507... [0.4522, 0.6524, 0.044, 0.3867, 0.1926, 0.0614... [0.473242105263, 0.821097368421, 0.04580526315... 0.797980 29.0 [0.480684210526, 0.683868421053, 0.02315789473... 0.833283 10.0
17181 1666356501\t4139447361057607680\t10013185\t334... 1666356501 4139447361057607680 10013185 334 4139447361057607680 10013185 334 0 5 ... http://a.vpimg2.com/upload/merchandise/pdc/680... [299565811565789193, 84518910604566528, 456065... [299565811565789193, 84518910604566528, 456065... [0.3648, 0.2411, 0.109, 0.6285, 0.4356, 0.0976... [0.367395652174, 0.301826086957, 0.09733913043... 0.888677 12.0 [0.329347826087, 0.457956521739, 0.09339130434... 0.865719 12.0
17218 3033602072\t8949291790987165704\t10014937\t334... 3033602072 8949291790987165704 10014937 334 8949291790987165704 10014937 334 0 15 ... http://a.vpimg2.com/upload/merchandise/pdc/704... [3267437868394533012, 446214279005298700, 8937... [3267437868394533012, 446214279005298700, 8937... [0.3988, 0.9781, 0.0402, 0.8639, 0.2708, 0.123... [0.386937931034, 0.872413793103, 0.03714137931... 0.757592 15.0 [0.507551724138, 0.769517241379, 0.04313793103... 0.748415 15.0
17227 385159642\t80015314527277239\t10000812\t334\t8... 385159642 80015314527277239 10000812 334 80015314527277239 10000812 334 0 13 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [467606351777165639, 290840078882562181, 44424... [467606351777165639, 290840078882562181, 44424... [0.3945, 0.9122, 0.1044, 1.3778, 0.33, 0.2702,... [0.397207142857, 0.906828571429, 0.10218571428... 0.827269 7.5 [0.417357142857, 0.944357142857, 0.12442857142... 0.847852 7.5
17251 443287238\t8664720590950785055\t10015020\t334\... 443287238 8664720590950785055 10015020 334 8664720590950785055 10015020 334 0 6 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [9094251405871296512, 103940709769723904, 2925... [9094251405871296512, 103940709769723904, 2925... [0.5268, 0.7429, 0.0497, 1.1377, 0.1507, 0.299... [0.539741176471, 0.947832352941, 0.05190294117... 0.732443 17.5 [0.428205882353, 1.02947058824, 0.078588235294... 0.763068 17.5
17348 2480858877\t1037874485481308160\t10010280\t334... 2480858877 1037874485481308160 10010280 334 1037874485481308160 10010280 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [2481841146450706432, 315328370355912704, 1035... [2481841146450706432, 315328370355912704, 1035... [0.2085, 0.333, 0.0415, 0.6203, 0.3165, 0.1576... [0.264388888889, 0.651352777778, 0.03633333333... 0.842196 10.0 [0.313805555556, 0.497388888889, 0.04544444444... 0.815807 10.0
17389 2635089954\t436644093725405288\t10005149\t334\... 2635089954 436644093725405288 10005149 334 436644093725405288 10005149 334 0 12 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [84800400172249093, 297314006163628534, 436644... [84800400172249093, 297314006163628534, 436644... [0.371, 0.7426, 0.0304, 0.5118, 0.1884, 0.0459... [0.376003448276, 0.737079310345, 0.03230689655... 0.883764 15.0 [0.388413793103, 0.74275862069, 0.044482758620... 0.880103 15.0
17421 692250685\t29631292293525510\t10010280\t334\t2... 692250685 29631292293525510 10010280 334 29631292293525510 10010280 334 0 14 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [942172993399627776, 288869744512020505, 88975... [942172993399627776, 288869744512020505, 88975... [0.3378, 0.4677, 0.0113, 0.5358, 0.1654, 0.037... [0.290460606061, 0.593093939394, 0.04335151515... 0.891379 25.5 [0.325636363636, 0.446545454545, 0.01033333333... 0.900943 8.5
17426 3673391202\t433266429406154772\t10021264\t334\... 3673391202 433266429406154772 10021264 334 433266429406154772 10021264 334 0 9 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [437488556136837122, 296188100116926918, 46732... [437488556136837122, 296188100116926918, 46732... [0.3493, 0.6946, 0.1288, 1.2265, 0.2617, 0.103... [0.284362162162, 0.973864864865, 0.13361891891... 0.798339 19.0 [0.310972972973, 1.00864864865, 0.130405405405... 0.816167 7.0
17459 3673391202\t450999316113584132\t10021264\t334\... 3673391202 450999316113584132 10021264 334 450999316113584132 10021264 334 0 11 ... http://a.vpimg2.com/upload/merchandise/pdcvis/... [439740353870500018, 15839007868620828, 282239... [439740353870500018, 15839007868620828, 282239... [0.2881, 1.0109, 0.1309, 0.8878, 0.125, 0.1252... [0.284362162162, 0.973864864865, 0.13361891891... 0.833449 6.5 [0.310972972973, 1.00864864865, 0.130405405405... 0.797039 19.5

307 rows × 24 columns


In [325]:
#df2.to_pickle('view2buy_url_CF_fea_sim.pkl')

In [322]:
# The average of similarity between original view_features and buy_features
np.mean(df2.query('buy_spu == view_spu')['ori_sim'])


Out[322]:
0.8022949340937618

In [323]:
# The average of similarity between CF_view_features and buy_features
np.mean(df2.query('buy_spu == view_spu')['CF_sim'])


Out[323]:
0.790564987299363

From this point, the original features is slightly better than CF_features. This may be caused of that 10 recommended items are too many and there are more noise.

Try decrease the number of recommended items for each view item from 10 to 5 and see how this altered CF_sim


In [330]:
def top_product_noprint(product_name):
    return list(item_sim_df.sort_values(by = product_name, ascending = False).index[1:6])

In [331]:
df['CF_item'] = df['view_spu'].apply(lambda x: top_product_noprint(x))

In [332]:
df_spu = pd.DataFrame(df.groupby('spu').count().reset_index()['spu'])

In [333]:
# assign CF_item to each spu
df_spu['CF_item'] = df_spu.apply(lambda x: df[df['spu'] == x['spu']]['CF_item'].iloc[0], axis = 1)

In [334]:
# Assign item feature for each spu
df_spu['spu_features'] = df_spu.apply(lambda x: df[df['spu'] == x['spu']]['view_features'].iloc[0], axis = 1)

In [335]:
# Assign item_features for all CF_item
df_spu['CF_features'] = df_spu.apply(lambda x: [df_spu[df_spu['spu'] == i]['spu_features'] for i in x['CF_item']], axis = 1)

In [336]:
df_spu['ave_CF_fea'] = df_spu.apply(lambda x: CF_ave(x['CF_features']), axis = 1)

In [337]:
# Assign user_CF_fea back to df
df2 = pd.merge(df, df_spu[['spu', 'CF_item', 'ave_CF_fea']], on='spu')

In [340]:
CF_user_fea = df2.groupby(['user_id'])['ave_CF_fea'].apply(lambda x: average(x))
CF_user_fea = pd.DataFrame(CF_user_fea)
CF_user_fea = CF_user_fea.reset_index()
df2 = pd.merge(df2, CF_user_fea, on='user_id')

In [341]:
df2.rename(columns = {'ave_CF_fea_y':'user_features'}, inplace = True)
df2.head()


Out[341]:
0 user_id buy_spu buy_sn buy_ct3 view_spu view_sn view_ct3 time_interval view_cnt view_secondes view_features buy_features spu url CF_item_x CF_item_y ave_CF_fea_x user_features
0 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 14150170026959126 10010102 334 21114 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.6808, 1.0456, 0.065, 0.1332, 0.14, 0.136, 0... [0.20164, 0.93442, 0.038836, 0.305916, 0.11476...
1 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 14150170026959126 10010102 334 13978 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.6808, 1.0456, 0.065, 0.1332, 0.14, 0.136, 0... [0.20164, 0.93442, 0.038836, 0.305916, 0.11476...
2 4209887493\t74104320184119307\t10004616\t334\t... 4209887493 74104320184119307 10004616 334 14150170026959126 10010102 334 14313 1 11 [0.135, 1.078, 0.06, 0.241, 0.213, 0.22, 0.039... [0.078, 2.304, 0.132, 0.191, 0.0, 0.087, 0.341... 14150170026959126 http://a.vpimg2.com/upload/merchandise/pdcvis/... [82267097285177879, 12742773141631009, 3341747... [82267097285177879, 12742773141631009, 3341747... [0.6808, 1.0456, 0.065, 0.1332, 0.14, 0.136, 0... [0.20164, 0.93442, 0.038836, 0.305916, 0.11476...
3 4209887493\t453532580309307392\t10004616\t334\... 4209887493 453532580309307392 10004616 334 99155636687355977 10023064 334 18202 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.1, 1.804, 0.049, 0.883, 0.092, 0.053, 0.042... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.091, 0.888, 0.0276, 0.1686, 0.0782, 0.05, 0... [0.20164, 0.93442, 0.038836, 0.305916, 0.11476...
4 4209887493\t438895881520357521\t10004616\t334\... 4209887493 438895881520357521 10004616 334 99155636687355977 10023064 334 11066 1 22 [0.349, 0.394, 0.007, 2.666, 0.009, 0.0, 0.0, ... [0.036, 0.439, 0.0, 0.074, 0.194, 0.0, 0.331, ... 99155636687355977 http://a.vpimg2.com/upload/merchandise/pdcvis/... [438895881520357521, 74104320184119307, 443680... [438895881520357521, 74104320184119307, 443680... [0.091, 0.888, 0.0276, 0.1686, 0.0782, 0.05, 0... [0.20164, 0.93442, 0.038836, 0.305916, 0.11476...

In [342]:
df2['CF_sim'] = df2.apply(lambda x: similarity(x['buy_features'], x['user_features']), axis=1)
df2['CF_rank'] = df2.groupby('user_id')['CF_sim'].rank(ascending=False)
float(len(df2.query('buy_spu == view_spu & CF_rank <= 20')))/float(len(df2.query('buy_spu == view_spu'))) * 100


Out[342]:
52.52173913043479

In [343]:
ori_user_fea = df2.groupby(['user_id'])['view_features'].apply(lambda x: average(x))
ori_user_fea = pd.DataFrame(ori_user_fea)
ori_user_fea = ori_user_fea.reset_index()
df2 = pd.merge(df2, ori_user_fea, on='user_id')
df2.rename(columns = {'view_features_y':'ori_user_features'}, inplace = True)
df2['ori_sim'] = df2.apply(lambda x: similarity(x['buy_features'], x['ori_user_features']), axis=1)
df2['ori_rank'] = df2.groupby('user_id')['ori_sim'].rank(ascending=False)
float(len(df2.query('buy_spu == view_spu & ori_rank <= 20')))/float(len(df2.query('buy_spu == view_spu'))) * 100


Out[343]:
53.391304347826086

This is the average of similarity of from CF_5.


In [345]:
np.mean(df2.query('buy_spu == view_spu')['CF_sim'])


Out[345]:
0.7892732779012652

It turns out decreasing the number of recommended items also decreased the similarity. Thus, the next step will be choosing user more wisely that only select users who have the same trajectory to lower the noise.


In [ ]: