'Tensorflow Tutorial in RStudio Classify Structured Data with feature columns

I am working to learn TensorFlow for Machine learning.

I am using R 4.1.2, RStudio 2022.02.0-443, Python 3.9.7 on Ubuntu 21.

I have installed all the libraries on the Rstudio side following all the installation instructions from https://tensorflow.rstudio.com/installation

On the virtual environment side I cannot find the equivalent of libraries "rsample" and "Matrics". I have installed matrix by pip install matrix.

I have updated all the packages.

Next I went to https://tensorflow.rstudio.com/tutorials/ and started going through tutorials.

This is to ensure that my installation is working and I understand what libraries are needed to do what before getting into what I want to use this for.

So far:

  1. The Overview tutorial with MNIST dataset worked fine.
  2. The Basic Regression with Boston Housing Prices dataset worked fine.
  3. Next I tried to learn the tutorial as it is very close to what I will be using this software for my 1st model and application. https://tensorflow.rstudio.com/tutorials/advanced/structured/classify/

The data is not available from the source as it says in the tutorial. So I got the same data from Heart Data csv file

Up to the following line my output looks the same as in the tutorial.

str(spec_prep$dense_features())

I get the following error when I execute the above line:

Error in py_call_impl(callable, dots$args, dots$keywords) : 
ValueError: column_name: thal vocabulary dtype must be string or integer. dtype: <dtype: 'float64'>.

Something is happening in the variable manipulation in the lines above. I have no clue how to fix this, as I have not written any code and upto this point output agrees with the tutorial.

Any suggestion?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source