End-to-end ML toolkit with 24 CLI commands...
scomp-link automates the complete ML workflow: data profiling β preprocessing β feature engineering β model selection β training β validation β explainability β monitoring β deployment. Also includes an LLM toolkit for fine-tuning, RAG, quantization, and model merging.
Use scomp-link instead of raw sklearn when you need:
.scomp format: model + preprocessor + config + metrics)Use raw sklearn when you need:
pip install scomp-link
I have data and want to...
ββ Understand it quickly β scomp-link describe --data file.csv
ββ Full quality report (HTML) β scomp-link quality --data file.csv --output report.html
ββ Engineer features β scomp-link engineer --data file.csv --target y --interactions --log-transform
ββ Train a model
β ββ Regression β scomp-link run --data file.csv --target y --task regression
β ββ Classification β scomp-link run --data file.csv --target y --task classification
β ββ Text classification β scomp-link text --data file.csv --text-col msg --target label
β ββ Clustering β scomp-link cluster --data file.csv --n-clusters 5
β ββ Full pipeline from YAML β scomp-link pipeline --config pipeline.yaml
ββ Tune hyperparameters β scomp-link tune --data file.csv --target y --task regression --method optuna
ββ Predict with saved model β scomp-link predict --artifact model.scomp --data new.csv
ββ Validate on test data β scomp-link validate --artifact model.scomp --data test.csv --target y
ββ Explain model decisions β scomp-link explain --artifact model.scomp --data test.csv
ββ Monitor production
β ββ Drift only β scomp-link drift --reference train.csv --current prod.csv
β ββ Full monitoring β scomp-link monitor --reference train.csv --current prod.csv --artifact model.scomp
β ββ Anomaly detection β scomp-link anomaly --data prod.csv --methods iforest,lof,tabnet,transformer
ββ Check fairness/bias β scomp-link fairness --data preds.csv --target y_true --predicted y_pred --sensitive gender
ββ Forecast time series β scomp-link forecast --data series.csv --column value --horizon 30
ββ Compare models β scomp-link compare --artifacts v1.scomp v2.scomp
ββ Generate HTML report β scomp-link report --data file.csv --output report.html
ββ Serve as REST API β scomp-link serve --artifact model.scomp --port 8080
ββ Export to ONNX/pickle β scomp-link export --artifact model.scomp --format onnx
ββ Scaffold a new project β scomp-link init my_project
ββ Configure branding defaults β scomp-link init-config
ββ Use declarative >> DSL β see Pipeline DSL section below
ββ LLM workflows
ββ Fine-tune a model β scomp-link llm finetune --model <hf_id> --method lora --data train.json
ββ Convert to GGUF β scomp-link llm convert --model ./merged --quantization Q4_K_M
ββ Build from scratch β scomp-link llm scratch --config model.yaml --data corpus.txt
ββ Evaluate text quality β scomp-link llm evaluate --generated output.txt --references ref.txt
ββ Deduplicate corpus β scomp-link llm dedup --data corpus.txt --method ngram --threshold 0.8
ββ Merge models β scomp-link llm merge --base base --models m1,m2 --method ties
ββ Serve model β scomp-link llm serve --model ./merged --port 8080
ββ Convert dataset format β scomp-link llm format --input data.json --output out.jsonl --source alpaca --target chatml
# 1. Profile the data
scomp-link describe --data train.csv --format table
# 2. Check data quality
scomp-link quality --data train.csv --output quality_report.html
# 3. Engineer features
scomp-link engineer --data train.csv --target price --interactions --log-transform --output engineered.csv
# 4. Tune hyperparameters
scomp-link tune --data engineered.csv --target price --task regression --method optuna --n-trials 100 --save-artifact best_model.scomp
# 5. Validate on held-out test data
scomp-link validate --artifact best_model.scomp --data test.csv --target price --report validation.html
# 6. Explain
scomp-link explain --artifact best_model.scomp --data test.csv
# 7. Deploy
scomp-link serve --artifact best_model.scomp --port 8080
# pipeline.yaml
data: train.csv
target: price
task: regression
engineer:
interactions: true
log_transform: true
tune:
method: optuna
n_trials: 50
validate:
test_data: test.csv
report: validation_report.html
save: models/price_model.scomp
scomp-link pipeline --config pipeline.yaml
>> operator)For declarative, readable pipeline composition (Python API only):
from scomp_link import CleanStep, SelectStep, ModelStep, TrainStep, LogStep
# ML pipeline β lazy, executes on .run()
results = (
CleanStep(df)
>> SelectStep("target")
>> LogStep("before model") # optional: logs state without side effects
>> ModelStep("numerical_prediction")
>> TrainStep("regression", test_size=0.2)
).run()
# Report pipeline
from scomp_link import SectionStep, TableStep, GraphStep, SaveStep
from scomp_link.utils.report_html import ScompLinkHTMLReport
(
SectionStep("Results")
>> TableStep(metrics_df, "Metrics")
>> GraphStep(fig, "Performance Chart")
>> SaveStep("report.html")
).run(ScompLinkHTMLReport("My Report"))
When to use DSL vs imperative API:
>> when the pipeline is linear and the steps are known upfrontpipe.import_and_clean_data() / pipe.run_pipeline() when you need branching, loops, or conditional logicscomp-link has three visualization engines. See visualization-guide.md for full details.
| Engine | Best For | Output | Interactivity |
|---|---|---|---|
| Plotly | Standard ML charts (histograms, scatter, bar) | HTML (interactive) | Yes |
| RAWGraphs | Publication-quality diagrams (sankey, treemap, chord) | SVG (static) | No |
| Highcharts | Time series (streamgraph, heatmap, gantt) | HTML (interactive) | Yes |
from scomp_link.utils.report_html import ScompLinkHTMLReport
from scomp_link.utils.plotly_utils import histogram, barchart, linechart, area_chart
from scomp_link.utils.highcharts import streamgraphs, calendar_heatmap, calendar_gantt
from scomp_link.utils.rawgraphs import treemap, sankey_diagram, sunburst
# 1. Initialize
report = ScompLinkHTMLReport(title='My Analysis Report')
# 2. Add sections with content
report.open_section("Data Overview")
report.add_title("Dataset Statistics")
report.add_text("Analysis of 10,000 customer records.")
report.add_dataframe(summary_df, "Summary Statistics")
report.close_section()
# 3. Add charts
report.open_section("Distributions")
fig = histogram(df['age'].values, "Age Distribution")
report.add_graph_to_report(fig, "Age Histogram")
report.close_section()
# 4. Add RAWGraphs SVG
report.open_section("Hierarchical View")
svg = treemap(labels, parents, values, "Revenue by Category")
report.add_rawgraphs_to_report(svg, "Revenue Treemap")
report.close_section()
# 5. Add Highcharts
report.open_section("Time Trends")
html_stream = streamgraphs("Sales Trend", dates, series_dict, area=True)
report.html_report += html_stream # Direct HTML append for Highcharts
report.close_section()
# 6. Save
report.save_html('analysis_report.html')
report.save_pdf('analysis_report.pdf') # requires Playwright
Comparisons: barchart, barchartmultiset, barchartstacked, piechart, radarchart, voronoidiagram Distributions: beeswarm, boxplot, violinplot Time Series: bumpchart, gantt_chart, horizongraph, linechart, slopechart, streamgraph Correlations: bubblechart, contour_plot, convex_hull, hexagonal_binning, matrixplot, parallelcoordinates Hierarchies: circlepacking, circular_dendrogram, dendrogram, sunburst, treemap, voronoi_treemap Networks: alluvial_diagram, arc_diagram, chord_diagram, sankey_diagram Plotly: histogram, multiple_histograms, barchart, linechart, area_chart Highcharts: streamgraphs, calendar_heatmap, calendar_gantt
Commands are designed to chain β the output of one is the input of the next:
describe β (understand columns) β engineer β (engineered.csv) β tune β (model.scomp) β validate β (metrics)
β
predict (new data)
β
serve (REST API)
Key patterns:
--save-artifact model.scomp β use with --artifact model.scomp in predict/validate/explain/export/serve--output file.csv β use as --data file.csv in next command--report file.html β standalone HTML output (viewable in browser)--plot file.html β chart output for forecast/drift/anomaly/cluster/compare| Error | Cause | Fix |
|---|---|---|
ValueError: could not convert string to float |
Categorical columns in numeric model | Use --engineer flag or pre-process categoricals |
FileNotFoundError: artifact not found |
Wrong path to .scomp file | Check path exists, use absolute paths |
ImportError: torch required |
NLP/deep learning deps missing | pip install scomp-link includes all deps |
ArrowInvalid: 1-dimensional array |
Image/array data in preprocessing | Fixed in v1.2.0 β update scomp-link |
No module named 'click' |
spaCy dependency missing | pip install click (transitive dep) |
WeasyPrint: cannot load gobject |
System libs missing for PDF | Use save_pdf() (Playwright) instead of WeasyPrint |
scomp-link includes an MCP server (33 tools) for agent integration:
# Start the MCP server (stdio mode for Claude Desktop / Kiro / Cursor)
scomp-link mcp
# Or run directly
python -m scomp_link.mcp_server
For building custom branded HTML reports step-by-step:
1. report_create(title, ...) β returns report_id (uses ~/.scomp-link/config.yaml defaults)
2. report_add_section(report_id, title) β opens collapsible section
3. report_add_text(report_id, content, style) β paragraph/title/subtitle/html
4. report_add_table(report_id, json_data, title) β interactive table
5. report_add_chart(report_id, engine, chart_type, data, title) β 41 chart types (6 plotly + 31 rawgraphs + 3 highcharts + 1 custom)
6. report_add_kpi_cards(report_id, metrics_json, cols) β KPI cards with trend/status
7. report_add_tabs(report_id, tabs_json, title) β tabbed navigation (html/chart/table)
8. report_add_comparison_table(report_id, data, baseline_col, compare_cols, ...) β delta comparison
9. report_add_summary_stats(report_id, data_json, title) β auto data profiling table
10. report_add_dark_mode_toggle(report_id) β floating dark/light toggle
11. report_add_code(report_id, code, language, title, output, line_numbers, collapsed) β syntax-highlighted code block with copy button
12. report_add_diff(report_id, old_code, new_code, language, title, old_label, new_label, collapsed) β side-by-side diff view
13. report_add_mermaid(report_id, diagram, title, collapsed) β Mermaid.js diagram (flowchart, sequence, gantt, etc.)
14. report_add_terminal(report_id, cast_data, title, cols, rows, theme, collapsed) β embedded terminal replay (asciinema)
15. report_add_math(report_id, formula, title) β LaTeX formulas (KaTeX)
16. report_save(report_id, output) β saves HTML, frees memory
Engines: plotly (interactive), rawgraphs (SVG static), highcharts (time series)
New plotly charts: index_chart, stacked_area_comparison (in addition to histogram, barchart, linechart, area_chart)
Config: scomp-link init-config creates ~/.scomp-link/config.yaml with branding defaults
See workflow-patterns.md for complete workflow examples.