Preprocessor

[source]

FeatureEngineering class

autokeras.FeatureEngineering(max_columns=1000, **kwargs)

A preprocessor block does feature engineering for the data.

Arguments

  • max_columns: Int. The maximum number of columns after feature engineering. Defaults to 1000.

[source]

ImageAugmentation class

autokeras.ImageAugmentation(
    percentage=0.25,
    rotation_range=180,
    random_crop=True,
    brightness_range=0.5,
    saturation_range=0.5,
    contrast_range=0.5,
    translation=True,
    horizontal_flip=True,
    vertical_flip=True,
    gaussian_noise=True,
    **kwargs
)

Collection of various image augmentation methods.

Arguments

  • percentage: Float. The percentage of data to augment.
  • rotation_range: Int. The value can only be 0, 90, or 180. Degree range for random rotations. Default to 180.
  • random_crop: Boolean. Whether to crop the image randomly. Default to True.
  • brightness_range: Positive float. Serve as 'max_delta' in tf.image.random_brightness. Default to 0.5. Equivalent to adjust brightness using a 'delta' randomly picked in the interval [-max_delta, max_delta).
  • saturation_range: Positive float or Tuple. If given a positive float, _get_min_and_max() will automated generate a tuple for saturation range. If given a tuple directly, it will serve as a range for picking a saturation shift value from. Default to 0.5.
  • contrast_range: Positive float or Tuple. If given a positive float, _get_min_and_max() will automated generate a tuple for contrast range. If given a tuple directly, it will serve as a range for picking a contrast shift value from. Default to 0.5.
  • translation: Boolean. Whether to translate the image.
  • horizontal_flip: Boolean. Whether to flip the image horizontally.
  • vertical_flip: Boolean. Whether to flip the image vertically.
  • gaussian_noise: Boolean. Whether to add gaussian noise to the image.

[source]

LightGBM class

autokeras.LightGBM(seed=None, **kwargs)

LightGBM Block for classification or regression task.

Arguments

  • seed: Int. Random seed.

[source]

Normalization class

autokeras.Normalization(**kwargs)

Perform basic image transformation and augmentation.

Arguments

  • mean: Tensor. The mean value. Shape: (data last dimension length,)
  • std: Tensor. The standard deviation. Shape is the same as mean.

[source]

TextToIntSequence class

autokeras.TextToIntSequence(max_len=None, num_words=20000, **kwargs)

Convert raw texts to sequences of word indices.

Arguments

  • max_len: Int. The maximum length of a sentence. If unspecified, the length of the longest sentence will be used.
  • num_words: Int. The size of the maximum number of words to keep, based on word frequency. Only the most common num_words-1 words will be kept. Defaults to 20000.

[source]

TextToNgramVector class

autokeras.TextToNgramVector(ngram_range=None, stop_words=None, max_features=20000, norm="l2", **kwargs)

Convert raw texts to n-gram vectors.

Arguments

  • ngram_range: Int Tuple. Range of sizes of ngram tokens to be extracted. If not specified, it will be tuned automatically. Defaults to None.
  • stop_words: Set or Iterable of strings. List of stop words to be removed during tokenization. Defaults to use regular expression "(?u)\b\w\w+\b".
  • max_features: Positive Int. Maximum number of words to be considered during tokenization. Defaults to 20000.
  • norm: String. Can be ('l1', 'l2' or None) Attribute to replicate normalization in sklearn TfidfVectorizer. Defaults to 'l2'.