How to visualize US States

lisa811
lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner

Hi,

I am using the churn use case/ project which has one column "state" with type string and meaning US State. Unfortunately, it is not possible to visualize the states in a map as Dataiku does not recognize them as a geo column.

asd.PNG

Is there anything I could do to get them on a map?

Answers

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    Hi @lisa811
    ,

    You can use our Geocoder plugin for this purpose.

    After installing it, simply create a Geocoder -> Forward geocoding recipe, select the input and output datasets.

    In the address field of the recipe settings select a column containing the state code, for the geocoding provider you can use Arcgis. After running the recipe you'll have latitude + longitude columns. You may then create a prepare recipe with "Create GeoPoint from lat/lon" step to generate a single geopoint column.

    Regards,

  • lisa811
    lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner

    Hello Andrey,

    thanks for the response. I already tried it this way. The output looks like this:

    asd.PNG

    One can observe that something goes wrong when the lat and lon are created. For example, the state LA gets some coordinates in Laos.

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    Sorry for a misleading solution, I did a brief testing with a few cases where it worked...

    Since it's a limitation of the geocoding service you can give it more context to improve the result.

    For example you can create an intermediate prepare recipe that would prepend a state code with a country name:

    Screenshot 2020-08-21 at 13.15.06.png

     Then if you use the newly generated column for geocoding you'd get the result like:

    Screenshot 2020-08-21 at 13.17.33.png

  • lisa811
    lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner

    Thanks, looks like a great idea. I created that column, but now unfortunately when running the forward recipe I get the following error:

    asd.PNG

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    Hi @lisa811
    ,

    Could you copy the whole stack trace of an error?

    Could you also try with Arcgis provider?

    Regards

  • lisa811
    lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner

    Here are the logs. For Arcgis another error occurs.

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭

    May I ask you to also try to import a project attached to this message and see if you can "Forced recursive rebuild" the last dataset called "geocoded_geop" ?

  • lisa811
    lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner

    Hello Andrey,

    sorry for the late response, I was absent.

    If I import and run the project you provided, I get the same error as I had before in my own project ("need more than 0 values..."). I don't know whats wrong here

Setup Info
    Tags
      Help me…