deepaugment/build_features.py
def split_train_val_sets(X, y, train_set_size, val_set_size):
        """Splits given images randomly into `train` and `val_seed` groups

        val_seed -> is validation seed dataset, from where validation sets are sampled

        Args:
            X (numpy.array):
            y (numpy.array):
            train_set_size (int):
            val_set_size (int):
        return:
            dict: dict with keys `X_train`, `y_train`, `X_val_seed`, `y_val_seed`
        """
        if train_set_size == None:
            print(f"Using all training images")
            train_set_size = len(X) - val_set_size
        else:
            print(f"Using {train_set_size} training images")

        # reduce training dataset
        ix = np.random.choice(len(X), train_set_size, False)
        X_train = X[ix]
        y_train = y[ix]

        other_ix = set(np.arange(len(X))).difference(set(ix))
        other_ix = list(other_ix)
        X_val_seed = X[other_ix]
        y_val_seed = y[other_ix]

        data = {
            "X_train": X_train,
            "y_train": y_train,
            "X_val_seed": X_val_seed,
            "y_val_seed": y_val_seed,
        }
        return data
Splits given images randomly into `train` and `val_seed` groups

        val_seed -> is validation seed dataset, from where validation sets are sampled

        Args:
            X (numpy.array):
            y (numpy.array):
            train_set_size (int):
            val_set_size (int):
        return:
            dict: dict with keys `X_train`, `y_train`, `X_val_seed`, `y_val_seed`
        
Splits given images randomly into `train` and `val_seed` groups
val_seed -> is validation seed dataset, from where validation sets are sampled
Splits given images randomly into ` train ` and ` val_seed ` groups val_seed - > is validation seed dataset from where validation sets are sampled
def split_train_val_sets(X, y, train_set_size, val_set_size):
        if train_set_size == None:
            print(f"Using all training images")
            train_set_size = len(X) - val_set_size
        else:
            print(f"Using {train_set_size} training images")
        ix = np.random.choice(len(X), train_set_size, False)
        X_train = X[ix]
        y_train = y[ix]
        other_ix = set(np.arange(len(X))).difference(set(ix))
        other_ix = list(other_ix)
        X_val_seed = X[other_ix]
        y_val_seed = y[other_ix]
        data = {
            "X_train": X_train,
            "y_train": y_train,
            "X_val_seed": X_val_seed,
            "y_val_seed": y_val_seed,
        }
        return data
def split_train_val_sets ( X , y , train_set_size , val_set_size ) : if train_set_size == None : print ( f"Using all training images" ) train_set_size = len ( X ) - val_set_size else : print ( f"Using {train_set_size} training images" ) ix = np . random . choice ( len ( X ) , train_set_size , False ) X_train = X [ ix ] y_train = y [ ix ] other_ix = set ( np . arange ( len ( X ) ) ) . difference ( set ( ix ) ) other_ix = list ( other_ix ) X_val_seed = X [ other_ix ] y_val_seed = y [ other_ix ] data = { "X_train" : X_train , "y_train" : y_train , "X_val_seed" : X_val_seed , "y_val_seed" : y_val_seed , } return data
Splits given images randomly into `train` and `val_seed` groups
val_seed -> is validation seed dataset, from where validation sets are sampled
Splits given images randomly into ` train ` and ` val_seed ` groups val_seed - > is validation seed dataset from where validation sets are sampled
"""Splits given images randomly into `train` and `val_seed` groups

        val_seed -> is validation seed dataset, from where validation sets are sampled

        Args:
            X (numpy.array):
            y (numpy.array):
            train_set_size (int):
            val_set_size (int):
        return:
            dict: dict with keys `X_train`, `y_train`, `X_val_seed`, `y_val_seed`
        """ # reduce training dataset
X
None
y
None
train_set_size
None
val_set_size
None