Practical File of AI and ML
Practical File of AI and ML
Practical File of AI and ML
STATE
UNIVERSITY,FEROZEPUR,
PUNJAB
Data pre-processing
Finding the optimal number of clusters using the
elbow method
Training the K-Means algorithm on the training
data set
Visualizing the clusters
…………………………………….
PRACTICAL No.4
Build a Movie Recommendation System in
Python using Machine Learning
cosine_sim2 = cosine_similarity(count_matrix,
count_matrix)
print(cosine_sim2.shape)
movies_df = movies_df.reset_index()
indices = pd.Series(movies_df.index,
index=movies_df['title'])
def get_recommendations(title,
cosine_sim=cosine_sim):
idx = indices[title]
similarity_scores = list(enumerate(cosine_sim[idx]))
similarity_scores= sorted(similarity_scores,
key=lambda x: x[1], reverse=True)
similarity_scores= sim_scores[1:11]
# (a, b) where a is id of movie, b is similarity_scores
………………………
PRACTICAL No.5
Predicting when Employee will Leave your
company
…………………………………..