<jupyter_start><jupyter_text>Tutorial links:    Neural network version with tensorflow, kerashttps://keras.io/examples/structured_data/collaborative_filtering_movielens/        https://towardsdatascience.com/movie-recommendation-system-based-on-movielens-ef0df580cd0e            https://www.kaggle.com/indralin/movielens-project-1-2-collaborative-filtering        https://realpython.com/build-recommendation-engine-collaborative-filtering/     Day 3: 100 days of Daily Coding!    [Recommender system]From Today and for the next few days, i'm develloping, recommendation enginein python.A recommendation engine is a model  suggest product, service to users based on their preference, behaivoir, experience present in the data. The final goal of this series is to build recommendation engine for movie lens data.In our life, as human we can says how things be alike, similary or diffrent. But in data, we use the "distance" metric to says how much euclidean: more the value is less, the more the two vector is alike in eulidean distancecosine similarity: it represent the angles between the two vector.<jupyter_code>import numpy as np
def euclidean(x, y):
    diff = x- y
    return np.sqrt( np.dot(diff,diff))

def cosine_similarity( x , y):
    ''' x , y are np arrary
    dot_product(xy)//(norm(x)* norm(y ))
    '''
    return  np.arccos(  np.dot(x, y)/ np.sqrt( (np.dot(x,x) * np.dot(y,y)) )  ) 

a = np.array([1, 2])
b = np.array( [2, 4])
c = np.array( [3 ,1 ])
d = np.array( [-1,-2] )
print("euclidean")
print(euclidean(c, a) )
print(euclidean(c, b))
print( euclidean(c, d) )
print('cosine')
print(cosine_similarity(a , b))
print(cosine_similarity(a , d)) # pi- in opposite direction 
print(cosine_similarity(c , d))<jupyter_output>euclidean
2.23606797749979
3.1622776601683795
5.0
cosine
0.0
3.141592653589793
2.356194490192345
{'fraction_non_alphanumeric': 0.11292962356792144, 'fraction_numerical': 0.04746317512274959, 'mean_word_length': 4.362573099415204, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '183296', 'license': 'MIT', 'n_tokens_mistral': 696, 'n_tokens_neox': 625, 'n_words': 188, 'path': 'day3/day3.ipynb', 'repo_name': 'mamitiana/100DaysOfCode', 'size': '1833'}