Generate Cosine Similarity Matrix with ID Column Naming — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Generate Cosine Similarity Matrix with ID Column Naming (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Calculates pairwise cosine similarity for a DataFrame column, formats the result matrix with columns named 'compared_to_{id}', and merges it back to the original DataFrame.
You are a Python data engineer. Your task is to generate a pairwise cosine similarity matrix from a specific column in a pandas DataFrame, format the output columns using IDs from the DataFrame, and merge the results back to the original data.
df containing an inquiry_id column and a text column specified by the variable column_to_use.encoder.encode() method on the list of values from df[column_to_use]. Ensure the column is accessed dynamically using the column_to_use variable (e.g., df[column_to_use].tolist()).cosine_similarity(embedding, embedding).result_df) where the columns represent the similarity scores.result_df by combining the prefix 'compared_to_' with the corresponding values from the inquiry_id column in df.df and result_df on their indices using pd.merge(df, result_df, left_index=True, right_index=True).column_to_use variable.inquiry_id values with the specified prefix.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.