How do i change the active keying set by Python?
The anim.keying_set_active_set operator invokes a menu that lists the available keying sets. It does have a type property to bypass the menu, which allows you to specify the type value when calling it directly, but it doesn't seem to work when placing the operator in a panel or when setting keyboard shortcuts to use it - it looks like it is most likely due to the acceptable values being a dynamic list.

Changing the keying set is a simple task so it's easy to make a substitute yourself.

class SetKeyingSetOperator(bpy.types.Operator):
    """Set the active keying set"""
    bl_idname = 'anim.set_keyingset'
    bl_label = 'Set the active keying set'

    type = bpy.props.StringProperty(default='LocRotScale')

    def execute(self, context):
        ks = context.scene.keying_sets_all
        ks.active = ks[self.type]
        return {'FINISHED'}


Then you can use this operator to add a button in your panel.

row.operator('anim.set_keyingset', text='LocRot').type = 'LocRot'


This can all be put into an addon which can also setup some keyboard shortcuts to go with it. You can get the addon here, and adjust it to your liking.

As most keys are in use now, I used the key modifier setting. This isn't very popular yet, but it makes a normal key behave like &#9096; Ctrl or &#8679; Shift - in this configuration you hold down K and press Y and it will set the keying set to Location. KU for Rotation and KI for LocRotScale