Skip to content

Add Python calculator example demonstrating code featurizer usage#2

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/add-new-featurizer-example
Draft

Add Python calculator example demonstrating code featurizer usage#2
Copilot wants to merge 3 commits intomasterfrom
copilot/add-new-featurizer-example

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 23, 2025

Issue requested more examples showing how to use the featurizer.

Changes

  • example_calculator.py: Python calculator with arithmetic operations (add, subtract, multiply, divide) demonstrating featurization on Python code vs existing C example
  • example_usage.py: Standalone script showing complete workflow—load code from CSV, find optimal features, generate vectors, save output
  • example_calculator.csv: CSV input with calculator code lines following existing format
  • README.md: Documents both examples, usage instructions, and explains featurization purpose (code similarity, ML on source code, pattern recognition)
  • .gitignore: Excludes generated outputs and Python artifacts

Usage

python3 example_usage.py

Output:

Step 1: Loading code from CSV file...
Total lines loaded: 28
Unique lines: 28

Step 2: Finding optimal feature set...
Non-unique lines remaining: 27, features found: 1 in 0.00 sec.
...
Total features found: 17

Step 3: Generating feature vectors for all lines...
Step 4: Saving results to ./output_example_calculator.csv...

The example demonstrates the complete featurization pipeline with clear output showing progress through each stage.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add new example</issue_title>
<issue_description>We should have more examples of how to use the featurizer</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 23, 2025 19:17
Co-authored-by: miroslawstaron <5413313+miroslawstaron@users.noreply.github.com>
Co-authored-by: miroslawstaron <5413313+miroslawstaron@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new example for using the featurizer Add Python calculator example demonstrating code featurizer usage Nov 23, 2025
Copilot AI requested a review from miroslawstaron November 23, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new example

2 participants