src/sagemaker_xgboost_container/data_utils.py
def _is_valid_libsvm_label(libsvm_label):
    """Check if LIBSVM label is formatted like so:

    <label> if just label
    <label>:<instance_weight> if label and instance weight both exist

    :param libsvm_label:
    """
    split_label = libsvm_label.split(':')

    if len(split_label) <= 2:
        for label_part in split_label:
            try:
                float(label_part)
            except ValueError:
                return False
    else:
        return False

    return True
Check if LIBSVM label is formatted like so:

    <label> if just label
    <label>:<instance_weight> if label and instance weight both exist

    :param libsvm_label:
    
Check if LIBSVM label is formatted like so:
 if just label
: if label and instance weight both exist
Check if LIBSVM label is formatted like so : if just label : if label and instance weight both exist
def _is_valid_libsvm_label(libsvm_label):
    split_label = libsvm_label.split(':')
    if len(split_label) <= 2:
        for label_part in split_label:
            try:
                float(label_part)
            except ValueError:
                return False
    else:
        return False
    return True
def _is_valid_libsvm_label ( libsvm_label ) : split_label = libsvm_label . split ( ':' ) if len ( split_label ) <= 2 : for label_part in split_label : try : float ( label_part ) except ValueError : return False else : return False return True
Check if LIBSVM label is formatted like so:
<label> if just label
<label>:<instance_weight> if label and instance weight both exist
Check if LIBSVM label is formatted like so : <label > if just label <label > : <instance_weight > if label and instance weight both exist
"""Check if LIBSVM label is formatted like so:

    <label> if just label
    <label>:<instance_weight> if label and instance weight both exist

    :param libsvm_label:
    """
libsvm_label
None