suneku/classifier.py
def traintest(data,trainfrac=0.25):
    """ 2-tuple: Training and testing views of a DataFrame. """
    data = DataFrame(data)

    nrows = len(data)
    nkeep = int(trainfrac * nrows)
    train = Series(False,index=range(nrows))
    train[choice(train.index,size=nkeep,replace=False)] = True
    print("Train with {:,} of {:,} rows".format(nkeep,nrows))

    return data.loc[train], data.loc[~train]
 2-tuple: Training and testing views of a DataFrame. 
2-tuple: Training and testing views of a DataFrame.
2 - tuple : Training and testing views of a DataFrame .
def traintest(data,trainfrac=0.25):
    data = DataFrame(data)
    nrows = len(data)
    nkeep = int(trainfrac * nrows)
    train = Series(False,index=range(nrows))
    train[choice(train.index,size=nkeep,replace=False)] = True
    print("Train with {:,} of {:,} rows".format(nkeep,nrows))
    return data.loc[train], data.loc[~train]
def traintest ( data , trainfrac = 0.25 ) : data = DataFrame ( data ) nrows = len ( data ) nkeep = int ( trainfrac * nrows ) train = Series ( False , index = range ( nrows ) ) train [ choice ( train . index , size = nkeep , replace = False ) ] = True print ( "Train with {:,} of {:,} rows" . format ( nkeep , nrows ) ) return data . loc [ train ] , data . loc [ ~ train ]
2-tuple: Training and testing views of a DataFrame.
2 - tuple : Training and testing views of a DataFrame .
""" 2-tuple: Training and testing views of a DataFrame. """
data
trainfrac