Using 'Float Property Layers' value in Node Editor (similar to Vertex Color)
Using UV Layer


Example showing UVMap

Then use the UV Map node as input.


UV layers and vertex color layers are available to the attribute node by name. Not custom polygon float layers.  Be careful not to  name two layers of different type the same, (which you can) if you are going to use either or both as  node input.  

Script that sets a float layer to randoms, then for each face sets the uv of each loop vert; u to the face layer value, and v to another random (or ...). 

Can only have 8 UV Maps.

import bpy
from random import random
context = bpy.context

def get_mesh_layer(me, type, name="Float Layer"):
    layer = getattr(me, type)
    return layer.get(name) or layer.new(name=name)

#bpy.ops.object.mode_set() 
ob = context.object
me = ob.data

rflayer = get_mesh_layer(me, "polygon_layers_float")
for f in me.polygons:
    rflayer.data[f.index].value = random()

uv_layer = get_mesh_layer(me, "uv_layers", "Random")

for f in me.polygons:
    u, v = rflayer.data[f.index].value, random()
    for l in f.loop_indices:
        uv_layer.data[l].uv = u, v
#bpy.ops.object.mode_set(mode='EDIT') 


Note: needs to be run in object mode. Can be emulated in edit mode using bmesh. Simply wrapped it in change mode ops for screen shot above