Skip to content

Commit e7aa938

Browse files
authored
Merge pull request #142 from awslabs/arpin_fm_sparse_input_fix
Updated: FM removed need for _sparse_input hyperparameter
2 parents 988f6b4 + 1a810af commit e7aa938

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

introduction_to_amazon_algorithms/factorization_machines_mnist/factorization_machines_mnist.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@
232232
"- `feature_dim` is set to 784, which is the number of pixels in each 28 x 28 image.\n",
233233
"- `predictor_type` is set to 'binary_classifier' since we are trying to predict whether the image is or is not a 0.\n",
234234
"- `mini_batch_size` is set to 200. This value can be tuned for relatively minor improvements in fit and speed, but selecting a reasonable value relative to the dataset is appropriate in most cases.\n",
235-
"- `num_factors` is set to 10. As mentioned initially, factorization machines find a lower dimensional representation of the interactions for all features. Making this value smaller provides a more parsimonious model, closer to a linear model, but may sacrifice information about interactions. Making it larger provides a higher-dimensional representation of feature interactions, but adds computational complexity and can lead to overfitting. In a practical application, time should be invested to tune this parameter to the appropriate value.\n",
236-
"- `_sparse_input` is set to 'false'. As mentioned previously, factorization machines are frequently used with sparse data, which is therefore what the algorithm expects. Setting this to false forces the algorithm to handle the dense recordIO-wrapped protobuf that we created above."
235+
"- `num_factors` is set to 10. As mentioned initially, factorization machines find a lower dimensional representation of the interactions for all features. Making this value smaller provides a more parsimonious model, closer to a linear model, but may sacrifice information about interactions. Making it larger provides a higher-dimensional representation of feature interactions, but adds computational complexity and can lead to overfitting. In a practical application, time should be invested to tune this parameter to the appropriate value."
237236
]
238237
},
239238
{
@@ -256,8 +255,7 @@
256255
"fm.set_hyperparameters(feature_dim=784,\n",
257256
" predictor_type='binary_classifier',\n",
258257
" mini_batch_size=200,\n",
259-
" num_factors=10,\n",
260-
" _sparse_input='false')\n",
258+
" num_factors=10)\n",
261259
"\n",
262260
"fm.fit({'train': s3_train_data})"
263261
]

0 commit comments

Comments
 (0)