• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python Netflix.netflix_solve函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中Netflix.netflix_solve函数的典型用法代码示例。如果您正苦于以下问题:Python netflix_solve函数的具体用法?Python netflix_solve怎么用?Python netflix_solve使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了netflix_solve函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_solve_1

 def test_solve_1(self):
     """ test solves input 1"""
     inp = StringIO("2043:\n1417435\n2312054\n462685\n")
     writer = StringIO()
     netflix_solve(inp, writer)
     self.assertEqual(
         writer.getvalue(), "2043:\n3.6\n4.6\n3.9\nRMSE: 2.087128003334406\n")
开发者ID:13lheytens,项目名称:Netflix-Prize,代码行数:7,代码来源:TestNetflix.py


示例2: test_solve_2

 def test_solve_2(self):
     """ test solves input 2"""
     inp = StringIO("1:\n30878\n2043:\n462685\n")
     writer = StringIO()
     netflix_solve(inp, writer)
     self.assertEqual(
         writer.getvalue(), "1:\n3.7\n2043:\n3.9\nRMSE: 0.2180552033726668\n")
开发者ID:13lheytens,项目名称:Netflix-Prize,代码行数:7,代码来源:TestNetflix.py


示例3: test_solve_3

 def test_solve_3(self):
     """ test solves input 3"""
     inp = StringIO("2043:\n2312054\n1:\n30878\n")
     writer = StringIO()
     netflix_solve(inp, writer)
     self.assertEqual(
         writer.getvalue(), "2043:\n4.6\n1:\n3.7\nRMSE: 2.5264965005457753\n")
开发者ID:13lheytens,项目名称:Netflix-Prize,代码行数:7,代码来源:TestNetflix.py


示例4: test_netflix_solve_3

 def test_netflix_solve_3 (self) :
     re = StringIO.StringIO("COSTUMERS_RATE\n1 3.4\n2 4.4\n3 2.4\n5 1.2\n4 2.2\nMOVIE_RATES\n2 2.5\n1 3.5")
     getCatch(re)
     r = StringIO.StringIO("1:\n2:")
     w = StringIO.StringIO()
     netflix_solve(r, w)
     self.assert_(w.getvalue() == "1:\n2:\n")
开发者ID:jaf2568,项目名称:cs373-netflix-tests,代码行数:7,代码来源:jaf2568-TestNetflix.py


示例5: test_netflix_solve_3

 def test_netflix_solve_3 (self) :
     r = StringIO('2043:\n1417435\n2312054\n462685\n2849:\n1198093\n1129293\n1417435\n1894792\n')
     w = StringIO()
     netflix_solve(r,w)
     val = findall(r'\d\.\d\d+',w.getvalue())
     # print(val)
     self.assertEqual(len(val),1)
     self.assertTrue(float(val[0]) < 1.75)
开发者ID:jh6779,项目名称:cs373-netflix,代码行数:8,代码来源:TestNetflix.py


示例6: test_netflix_solve_2

 def test_netflix_solve_2 (self) :
     r = StringIO('2043:\n1417435\n2312054\n462685\n2849:\n1198093\n1129293\n1417435\n1894792\n')
     w = StringIO()
     netflix_solve(r,w)
     self.assertNotEqual(w.getvalue(),'')
     self.assertTrue('RMSE:' in w.getvalue())
开发者ID:jh6779,项目名称:cs373-netflix,代码行数:6,代码来源:TestNetflix.py


示例7: test_solve4

 def test_solve4 (self) :
   r = io.StringIO("3676:\n1982226\n1495499\n1669842\n2639376\n1982597\n1426939\n")
   w = io.StringIO()
   netflix_solve(r, w)
   self.assertEqual(w.getvalue(), "3676:\n3.7\n3.6\n4.5\n2.9\n4.2\n4.2\nRMSE: 0.6597351087461958\n")
开发者ID:lapluviosilla,项目名称:cs373-netflix,代码行数:5,代码来源:TestNetflix.py


示例8: test_solve_3

 def test_solve_3 (self) :
     r = StringIO("1:\n30878\n10:\n1952305\n1531863\n")
     w = StringIO()
     netflix_solve(r, w)
     self.assertEqual(w.getvalue(), "3.7\n3.3\n3.2\n")
开发者ID:LiJishen,项目名称:cs373-netflix,代码行数:5,代码来源:TestNetflix.py


示例9: test_solve_2

 def test_solve_2 (self) :
     input_string = StringIO()
     output_string = StringIO()
     netflix_solve(input_string, output_string)
     self.assertEqual("RMSE: 0.00\n", output_string.getvalue())
开发者ID:zjg95,项目名称:cs373-software-engineering,代码行数:5,代码来源:TestNetflix.py


示例10: test_solve_3

 def test_solve_3 (self) : #
     r = StringIO("2043:\n1417435\n2312054\n2043:\n1417435\n2312054\n2043:") #two sets and an incomplete
     w = StringIO()
     netflix_solve(r, w)
     self.assertEqual(w.getvalue(), "2043:\n3.6\n4.6\n2043:\n3.6\n4.6\n2043:\nRMSE:2.5807\n")
开发者ID:newbootz,项目名称:School-Projects,代码行数:5,代码来源:TestNetflix.py


示例11: test_solve_1

 def test_solve_1 (self) :
     r = StringIO("1:\n30878\n")
     w = StringIO()
     netflix_solve(r, w)
     self.assertEqual(w.getvalue(), "3.7\n")
开发者ID:LiJishen,项目名称:cs373-netflix,代码行数:5,代码来源:TestNetflix.py


示例12: len

# ---------------------------
# CS 373 Project 3
# Anh-Khoi Dang - add562
# ---------------------------

# -------
# imports
# -------

import sys, time

from Netflix import netflix_read, netflix_eval, netflix_solve


# ----
# main
# ----
#s = time.clock()

if len(sys.argv) != 4 : 
    exit("Usage: python RunNetflix.py <movie titles file> <training set directory> <probe file>")
else :
    movieTitlesFile = sys.argv[1]
    trainingSetDir = sys.argv[2]
    probeFile = sys.argv[3]
    
netflix_solve(sys.stdout, trainingSetDir, probeFile)

#e = time.clock()
#print (e - s), "seconds"
开发者ID:akdang,项目名称:netflix,代码行数:30,代码来源:RunNetflix.py


示例13: test_solve3

 def test_solve3 (self) :
   r = io.StringIO("10007:\n1204847\n2160216\n248206\n")
   w = io.StringIO()
   netflix_solve(r, w)
   self.assertEqual(w.getvalue(), "10007:\n2.0\n2.7\n2.2\nRMSE: 1.6254316644013882\n")
开发者ID:lapluviosilla,项目名称:cs373-netflix,代码行数:5,代码来源:TestNetflix.py


示例14: test_solve2

 def test_solve2 (self) :
   r = io.StringIO("1:\n712610\n1772839\n1059319\n2380848\n548064\n")
   w = io.StringIO()
   netflix_solve(r, w)
   self.assertEqual(w.getvalue(), "1:\n4.1\n4.2\n3.1\n5.0\n3.5\nRMSE: 0.7601868708858408\n")
开发者ID:lapluviosilla,项目名称:cs373-netflix,代码行数:5,代码来源:TestNetflix.py


示例15: test_solve1

 def test_solve1 (self) :
   r = io.StringIO("1:\n14756\n")
   w = io.StringIO()
   netflix_solve(r, w)
   self.assertEqual(w.getvalue(), "1:\n3.7\nRMSE: 0.30654350027973454\n")
开发者ID:lapluviosilla,项目名称:cs373-netflix,代码行数:5,代码来源:TestNetflix.py


示例16: test_solve_3

 def test_solve_3 (self) :
     input_string = StringIO("10:\n1952305\n1:\n30878\n")
     output_string = StringIO()
     netflix_solve(input_string, output_string)
     self.assertEqual("1:\n3.7\n10:\n3.3\nRMSE: 0.00\n", output_string.getvalue())
开发者ID:zjg95,项目名称:cs373-software-engineering,代码行数:5,代码来源:TestNetflix.py


示例17: test_solve_1

 def test_solve_1(self):
     r = StringIO("1:\n548064\n")
     w = StringIO()
     netflix_solve(r, w)
     self.assertEqual(w.getvalue(), "1:\n3.6\n")
开发者ID:hyunji-seo,项目名称:cs313e-netflix,代码行数:5,代码来源:TestNetflix.py


示例18: test_solve_1

 def test_solve_1 (self) :
     r = StringIO("1:\n30878\n317050\n")
     w = StringIO()
     netflix_solve(r,w)
     self.assertEqual (w.getvalue(), "1:\n3.8\n3.9\nRMSE: 0.79")
开发者ID:shyamprasad926,项目名称:netflix-tests,代码行数:5,代码来源:bbd335-TestNetflix.py


示例19: test_solve_2

 def test_solve_2 (self) :
     r = StringIO("6683:\n2505263\n1237027\n")
     w = StringIO()
     netflix_solve(r,w)
     self.assertEqual (w.getvalue(), "6683:\n2.8\n1.9\nRMSE: 1.49")
开发者ID:shyamprasad926,项目名称:netflix-tests,代码行数:5,代码来源:bbd335-TestNetflix.py


示例20: test_solve_2

 def test_solve_2 (self) :
     r = StringIO("2043:\n1417435\n2312054\n2043:\n1417435\n2312054") #two sets
     w = StringIO()
     netflix_solve(r, w)
     self.assertEqual(w.getvalue(), "2043:\n3.6\n4.6\n2043:\n3.6\n4.6\nRMSE:2.5807\n")
开发者ID:newbootz,项目名称:School-Projects,代码行数:5,代码来源:TestNetflix.py



注:本文中的Netflix.netflix_solve函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python Network.Network类代码示例发布时间:2022-05-24
下一篇:
Python types.XList类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap