agentleFS
williamcorrea23williamcorrea23/sap-router-skill/.agents/skills/sap-hana-ml/SKILL.md

sap-hana-ml

Skill1 starsChanged 4 months agoMITView on GitHub

SAP HANA Machine Learning — PAL (Predictive Analysis Library), APL (Automated Predictive Library), HANA ML Python client, built-in ML algorithms (regression, classification, clustering, time series), model training in HANA, model consumption from ABAP/CAP. Use when implementing HANA ML models, calling PAL/APL procedures, or integrating ML into ABAP applications.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

SAP HANA Machine Learning

In-database machine learning with PAL and APL libraries.

PAL (Predictive Analysis Library)

-- Train a linear regression model
CREATE PROCEDURE TRAIN_REGRESSION()
LANGUAGE SQLSCRIPT AS
BEGIN
  CALL _SYS_AFL.PAL_LINEAR_REGRESSION(
    TRAIN_DATA => (SELECT * FROM TRAINING_DATA),
    PARAMETERS => '{"THREAD_NUMBER":4}',
    MODEL => RESULT_MODEL,
    STATISTICS => RESULT_STATS
  );
  INSERT INTO MODEL_TABLE SELECT * FROM :RESULT_MODEL;
END;

APL (Automated Predictive Library)

-- Automated model selection
CALL _SYS_AFL.APL_FORECAST(
  INPUT => (SELECT * FROM SALES_DATA),
  PARAMETERS => '{
    "HORIZON": 12,
    "TARGET": "sales_amount",
    "DATE_COLUMN": "posting_date",
    "GRANULARITY": "MONTH",
    "LAST_TRAINING_DATE": "2026-01-01"
  }',
  RESULT => FORECAST_RESULT
);
SELECT * FROM :FORECAST_RESULT;

HANA ML Python Client

from hana_ml import dataframe
from hana_ml.algorithms.pal import linear_regression

# Connect
conn = dataframe.ConnectionContext(
    address='my-hana.cfapps.us10.hana.ondemand.com',
    port=443, user='SYSTEM', password='...', encrypt=True
)

# Load data
df = conn.table('TRAINING_DATA', schema='ZSALES').select(['X1','X2','Y']).collect()

# Train model
lr = linear_regression.LinearRegression()
lr.fit(data=df, key='ID', features=['X1','X2'], label='Y')

# Predict
predictions = lr.predict(data=conn.table('PRODUCTION_DATA'))
conn.create_table(predictions, 'PREDICTIONS')

Integration with ABAP

" Call HANA ML procedure from ABAP via ADBC
DATA(lo_sql) = NEW cl_sql_statement( ).
lo_sql->execute_ddl(
  |CALL ZSP_REGRESSION_PREDICT( iv_model_name = 'LREG_001', |
  & |iv_input_table = 'Z_NEW_DATA', iv_output_table = 'Z_PREDICTIONS' )|
).

Available Algorithms

CategoryPAL AlgorithmsAPL Algorithms
ClassificationSVM, Decision Tree, Random Forest, Naive BayesAutomated classifier
RegressionLinear, Polynomial, GLM, ExponentialAutomated regression
ClusteringK-Means, DBSCAN, Agglomerative—
Time SeriesARIMA, Exponential Smoothing, CrostonAutomated forecasting
AssociationApriori, FP-Growth—
RecommendationALS (Collaborative Filtering)—

Gotchas

  • PAL requires _SYS_AFL schema privilege
  • Model training is CPU-intensive — use dedicated HANA worker threads
  • Python client needs hana_ml pip package + HANA ODBC driver
  • APL auto-selects best algorithm — use PAL when you need specific algorithm control

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.