Member-only story
I have been using sklearn’s machine learning models for the past two and a half years, and they are for the most part, pretty straight forward.
In order to make predictions on data that is put into a model, the data must be separated into independent variables, X_ train, and dependent variables, y_train. Once the data is fit and trained into the model, the test set, X_test, is then predicted on. The predictions are compared against the actual values, y_test, and an accuracy is deduced against these comparisons.
An example of how to predict on sklearn’s LogisticRegression model can be seen below:-
Tensorflow is a more complex library than sklearn, so there are a number of ways that data can be predicted on. The documentation for tensorflow’s predict function lists five ways that data can be predicted on, and the link to the page that I found is here:- https://www.tensorflow.org/decision_forests/tutorials/predict_colab
What I would like to do in this post is to highlight two ways that I have found to use tensorflows’s predict function, being:-
- Input the independent variable into the predict function.