<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/neural-structured-learning/blob/v1.4.0/neural_structured_learning/configs/configs.py#L302-L335) |

Encapsulates configuration parameters for building a graph.

    nsl.configs.GraphBuilderConfig(
        id_feature_name=attr_dict['id_feature_name'].default,
        embedding_feature_name=attr_dict['embedding_feature_name'].default,
        similarity_threshold=attr_dict['similarity_threshold'].default,
        lsh_splits=attr_dict['lsh_splits'].default,
        lsh_rounds=attr_dict['lsh_rounds'].default,
        random_seed=attr_dict['random_seed'].default
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Graph regularization for sentiment classification using synthesized graphs](https://www.tensorflow.org/neural_structured_learning/tutorials/graph_keras_lstm_imdb) - [Graph-based Neural Structured Learning in TFX](https://www.tensorflow.org/tfx/tutorials/tfx/neural_structured_learning) |

For more information, see [`nsl.tools.build_graph_from_config`](https://www.tensorflow.org/neural_structured_learning/api_docs/python/nsl/tools/build_graph_from_config).

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `id_feature_name` | The name of the feature in the input [`tf.train.Example`](https://www.tensorflow.org/api_docs/python/tf/train/Example) objects representing the ID of examples. Defaults to `'id'`. |
| `embedding_feature_name` | The name of the feature in the input [`tf.train.Example`](https://www.tensorflow.org/api_docs/python/tf/train/Example) objects representing the embedding of examples. Defaults to `'embedding'`. |
| `similarity_threshold` | Threshold used to determine which edges to retain in the resulting graph. Defaults to 0.8. |
| `lsh_splits` | On each LSH bucketing round, the space containing the input instances will be randomly split/partitioned this many times for better graph builder performance. See the [`nsl.tools.build_graph_from_config`](https://www.tensorflow.org/neural_structured_learning/api_docs/python/nsl/tools/build_graph_from_config) documentation for details. Defaults to 0, in which case all pairs of inputs will be compared, probably resulting in slow running times on larger input sets. |
| `lsh_rounds` | The number of rounds of LSH bucketing to perform when `lsh_splits > 0`. This is also the number of LSH buckets each point will be hashed into. Defaults to 1. |
| `random_seed` | Value used to seed the random number generator used to perform randomized LSH bucketing of the inputs when `lsh_splits > 0`. By default, the generator will be initialized randomly, but setting this to any integer will initialize it deterministically. Defaults to `None`. |

<br />

## Methods

### `__eq__`

    __eq__(
        other
    )

Method generated by attrs for class GraphBuilderConfig.

### `__ge__`

    __ge__(
        other
    )

Method generated by attrs for class GraphBuilderConfig.

### `__gt__`

    __gt__(
        other
    )

Method generated by attrs for class GraphBuilderConfig.

### `__le__`

    __le__(
        other
    )

Method generated by attrs for class GraphBuilderConfig.

### `__lt__`

    __lt__(
        other
    )

Method generated by attrs for class GraphBuilderConfig.

### `__ne__`

    __ne__(
        other
    )

Check equality and either forward a NotImplemented or return the result negated.