我正在尝试测试 Turi Create Project。
我的 jupyter notebook 浏览器屏幕和 Python 代码如下。
In [1]: import turicreate as tc
In [2]: data = tc.SFrame("data.csv")
In [3]: train, test = data.random_split(0.8)
In [4]: train = train.dropna()
In [5]: test = test.dropna()
In [6]: model = tc.recommender.ranking_factorization_recommender.create(train)
In [*]: eval = model.evaluate(test)
为什么在 Turi Create 中没有完成“Recommender 的evaluate() 方法”?
据我所知,“In[*]”表示该行正在 jupyter notebook 中运行。
第6行的结果如下。
Recsys training: model = ranking_factorization_recommender
Preparing data set.
Data has 31 observations with 1 users and 27 items.
Data prepared in: 0.034568s
Training ranking_factorization_recommender for recommendations.
+--------------------------------+--------------------------------------------------+----------+
| Parameter | Description | Value |
+--------------------------------+--------------------------------------------------+----------+
| num_factors | Factor Dimension | 32 |
| regularization | L2 Regularization on Factors | 1e-09 |
| solver | Solver used for training | adagrad |
| linear_regularization | L2 Regularization on Linear Coefficients | 1e-09 |
| binary_target | Assume Binary Targets | True |
| max_iterations | Maximum Number of Iterations | 25 |
+--------------------------------+--------------------------------------------------+----------+
Optimizing model using SGD; tuning step size.
Using 31 / 31 points for tuning the step size.
+---------+-------------------+------------------------------------------+
| Attempt | Initial Step Size | Estimated Objective Value |
+---------+-------------------+------------------------------------------+
| 0 | 1.16279 | Not Viable |
| 1 | 0.290698 | 0.0198458 |
| 2 | 0.145349 | 0.109241 |
+---------+-------------------+------------------------------------------+
| Final | 0.290698 | 0.0198458 |
+---------+-------------------+------------------------------------------+
Starting Optimization.
+---------+--------------+-------------------+-----------------------------------+-------------+
| Iter. | Elapsed Time | Approx. Objective | Approx. Training Predictive Error | Step Size |
+---------+--------------+-------------------+-----------------------------------+-------------+
| Initial | 149us | 0.69303 | 0.69303 | |
+---------+--------------+-------------------+-----------------------------------+-------------+
| 1 | 2.987ms | 4.36077 | 4.36077 | 0.290698 |
| 2 | 6.12ms | 0.397951 | 0.397949 | 0.290698 |
| 3 | 7.599ms | 0.0258218 | 0.0258208 | 0.290698 |
| 4 | 9.803ms | 0.0188815 | 0.0188808 | 0.290698 |
| 5 | 11.194ms | 0.0227515 | 0.0227511 | 0.290698 |
| 10 | 26.505ms | 1.16849 | 1.16849 | 0.290698 |
| 12 | 30.94ms | DIVERGED | DIVERGED | 0.290698 |
| RESET | 34.911ms | 0.693064 | 0.693064 | |
| 18 | 75.108ms | 0.0136463 | 0.013646 | 0.145349 |
+---------+--------------+-------------------+-----------------------------------+-------------+
Optimization Complete: Maximum number of passes through the data reached (hard limit).
Computing final objective value and training Predictive Error.
Final objective value: 0.0118796
Final training Predictive Error: 0.0118793
感谢您的阅读。