Skip to content

Commit

Permalink
Merge pull request #142 from awslabs/arpin_fm_sparse_input_fix
Browse files Browse the repository at this point in the history
Updated: FM removed need for _sparse_input hyperparameter
  • Loading branch information
djarpin authored Dec 11, 2017
2 parents 988f6b4 + 1a810af commit e7aa938
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand All @@ -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})"
]
Expand Down

0 comments on commit e7aa938

Please sign in to comment.