MCPcopy
hub / github.com/MaartenGr/BERTopic / BaseDimensionalityReduction

Class BaseDimensionalityReduction

bertopic/dimensionality/_base.py:4–26  ·  view source on GitHub ↗

The Base Dimensionality Reduction class. You can use this to skip over the dimensionality reduction step in BERTopic. Examples: This will skip over the reduction step in BERTopic: ```python from bertopic import BERTopic from bertopic.dimensionality import BaseDimensionalit

Source from the content-addressed store, hash-verified

2
3
4class BaseDimensionalityReduction:
5 """The Base Dimensionality Reduction class.
6
7 You can use this to skip over the dimensionality reduction step in BERTopic.
8
9 Examples:
10 This will skip over the reduction step in BERTopic:
11
12 ```python
13 from bertopic import BERTopic
14 from bertopic.dimensionality import BaseDimensionalityReduction
15
16 empty_reduction_model = BaseDimensionalityReduction()
17
18 topic_model = BERTopic(umap_model=empty_reduction_model)
19 ```
20 """
21
22 def fit(self, X: np.ndarray = None, y: np.ndarray = None):
23 return self
24
25 def transform(self, X: np.ndarray) -> np.ndarray:
26 return X

Callers 3

test_no_plotlyFunction · 0.90
supervised_topic_modelFunction · 0.90
_create_model_from_filesFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_no_plotlyFunction · 0.72
supervised_topic_modelFunction · 0.72