From 1a810aff716986ab4ab1404febf231d1bc955217 Mon Sep 17 00:00:00 2001 From: djarpin Date: Mon, 11 Dec 2017 14:05:33 -0800 Subject: [PATCH] Updated: FM removed need for _sparse_input hyperparameter --- .../factorization_machines_mnist.ipynb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/introduction_to_amazon_algorithms/factorization_machines_mnist/factorization_machines_mnist.ipynb b/introduction_to_amazon_algorithms/factorization_machines_mnist/factorization_machines_mnist.ipynb index 46116e27c0..1c98b3032a 100644 --- a/introduction_to_amazon_algorithms/factorization_machines_mnist/factorization_machines_mnist.ipynb +++ b/introduction_to_amazon_algorithms/factorization_machines_mnist/factorization_machines_mnist.ipynb @@ -232,8 +232,7 @@ "- `feature_dim` is set to 784, which is the number of pixels in each 28 x 28 image.\n", "- `predictor_type` is set to 'binary_classifier' since we are trying to predict whether the image is or is not a 0.\n", "- `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", - "- `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", - "- `_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." + "- `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." ] }, { @@ -256,8 +255,7 @@ "fm.set_hyperparameters(feature_dim=784,\n", " predictor_type='binary_classifier',\n", " mini_batch_size=200,\n", - " num_factors=10,\n", - " _sparse_input='false')\n", + " num_factors=10)\n", "\n", "fm.fit({'train': s3_train_data})" ]