mirror of
https://github.com/20kaushik02/CSE515_MWDB_Project.git
synced 2025-12-06 08:04:06 +00:00
lda rounding off
This commit is contained in:
parent
2509402651
commit
6a1c11a9fa
@ -199,6 +199,8 @@
|
||||
" else:\n",
|
||||
" min_value = np.min(label_rep)\n",
|
||||
" feature_vectors_shifted = label_rep - min_value\n",
|
||||
" # round off to reduce dictionary size\n",
|
||||
" feature_vectors_shifted = np.round(feature_vectors_shifted, 3)\n",
|
||||
" comparison_vector = data_model.transform(\n",
|
||||
" feature_vectors_shifted.flatten().reshape(1, -1)\n",
|
||||
" ).flatten()\n",
|
||||
|
||||
@ -215,6 +215,8 @@
|
||||
" else:\n",
|
||||
" min_value = np.min(image_fd)\n",
|
||||
" feature_vectors_shifted = image_fd - min_value\n",
|
||||
" # round off to reduce dictionary size\n",
|
||||
" feature_vectors_shifted = np.round(feature_vectors_shifted, 3)\n",
|
||||
" comparison_vector = data_model.transform(\n",
|
||||
" feature_vectors_shifted.flatten().reshape(1, -1)\n",
|
||||
" ).flatten()\n",
|
||||
|
||||
@ -213,6 +213,8 @@
|
||||
" else:\n",
|
||||
" min_value = np.min(image_fd)\n",
|
||||
" feature_vectors_shifted = image_fd - min_value\n",
|
||||
" # round off to reduce dictionary size\n",
|
||||
" feature_vectors_shifted = np.round(feature_vectors_shifted, 3)\n",
|
||||
" comparison_vector = data_model.transform(\n",
|
||||
" feature_vectors_shifted.flatten().reshape(1, -1)\n",
|
||||
" ).flatten()\n",
|
||||
|
||||
@ -200,6 +200,8 @@
|
||||
" else:\n",
|
||||
" min_value = np.min(label_rep)\n",
|
||||
" feature_vectors_shifted = label_rep - min_value\n",
|
||||
" # round off to reduce dictionary size\n",
|
||||
" feature_vectors_shifted = np.round(feature_vectors_shifted, 3)\n",
|
||||
" comparison_vector = data_model.transform(\n",
|
||||
" feature_vectors_shifted.flatten().reshape(1, -1)\n",
|
||||
" ).flatten()\n",
|
||||
|
||||
@ -948,6 +948,8 @@ def extract_latent_semantics_from_feature_model(
|
||||
# so shift the input by subtracting the smallest value
|
||||
min_value = np.min(feature_vectors)
|
||||
feature_vectors_shifted = feature_vectors - min_value
|
||||
# round off to reduce dictionary size
|
||||
feature_vectors_shifted = np.round(feature_vectors_shifted, 3)
|
||||
|
||||
model = LatentDirichletAllocation(
|
||||
n_components=k, learning_method="online", verbose=4
|
||||
@ -1110,6 +1112,8 @@ def extract_latent_semantics_from_sim_matrix(
|
||||
# so shift the input by subtracting the smallest value
|
||||
min_value = np.min(feature_vectors)
|
||||
feature_vectors_shifted = feature_vectors - min_value
|
||||
# round off to reduce dictionary size
|
||||
feature_vectors_shifted = np.round(feature_vectors_shifted, 3)
|
||||
|
||||
model = LatentDirichletAllocation(
|
||||
n_components=k, learning_method="online", verbose=4
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user