Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
group18
taskA
Commits
cd90dcfa
Commit
cd90dcfa
authored
Aug 27, 2016
by
SHRADDHEYA SHENDRE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding collab-filter.py after taking care of the fact that order of movies can be different
parent
54d15904
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
collab-filter.py
collab-filter.py
+37
-0
No files found.
collab-filter.py
0 → 100755
View file @
cd90dcfa
#!/usr/bin/python3
import
csv
file
=
open
(
'movie-ratings.csv'
)
readerObj
=
csv
.
reader
(
file
)
data
=
list
(
readerObj
)
userFile
=
open
(
'user_preference.csv'
)
userObj
=
csv
.
reader
(
userFile
)
temp
=
list
(
userObj
)
def
map
(
str
):
if
str
==
"The Godfather"
:
return
1
elif
str
==
"Pulp Fiction"
:
return
2
elif
str
==
"Gone With the Wind"
:
return
3
elif
str
==
"12 Angry Men"
:
return
4
elif
str
==
"Lawrence of Arabia"
:
return
5
elif
str
==
"Raging Bull"
:
return
6
elif
str
==
"The Clockwork Orange"
:
return
7
elif
str
==
"Cinema Paradiso"
:
return
8
elif
str
==
"Wild Strawberries"
:
return
9
else
:
return
10
userRatings
=
[
"MyUser"
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
]
for
i
in
range
(
10
):
userRatings
[
map
(
temp
[
0
][
i
])]
=
temp
[
1
][
i
]
data
.
append
(
userRatings
)
file
.
close
()
userFile
.
close
()
print
(
data
)
#data is complete at this point
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment