Skip to content

Instantly share code, notes, and snippets.

View Krishna829's full-sized avatar

Krishna R Krishna829

View GitHub Profile
@Krishna829
Krishna829 / cb_recommend_movies.py
Created June 11, 2020 13:12
Recommender System #RecommenderSystem
from sklearn.feature_extraction.text import TfidfVectorizer
tf = TfidfVectorizer(analyzer='word',ngram_range=(1, 2),min_df=0, stop_words='english')
tfidf_matrix = tf.fit_transform(movies['genres'])
from sklearn.metrics.pairwise import linear_kernel
cosine_sim = linear_kernel(tfidf_matrix, tfidf_matrix)
# Build a 1-dimensional array with movie titles
titles = movies['title']
@Krishna829
Krishna829 / createRepo.sh
Created October 14, 2019 14:57
create github repo
#!/bin/sh
reponame="$1"
if [ "$reponame" = "" ]; then
read -p "Enter Github Repository Name: " reponame
fi
mkdir ./$reponame
cd $reponame
curl -u USERNAME https://api.github.com/user/repos -d "{\"name\":\"$reponame\"}"
git init
echo "ADD README CONTENT" > README.md
# Set the width and height of the plot
f, ax = plt.subplots(figsize=(10, 10))
# Generate correlation matrix
corr_matrix = data.corr()
# Plot using seaborn library
sns.heatmap(corr_matrix, mask=np.zeros_like(corr_matrix,dtype=np.bool),
square=True, ax=ax, annot=True)