인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
데이터 및 연구 · SKILL.md

sap-hana-ml

sap-hana-ml

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 applicat…

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: sap-hana-ml description: 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. trigger: keywords: [PAL, APL, HANA ML, machine learning, regression, classification, clustering, time series, predictive, model training] intent: >- Use when implementing HANA ML models, calling PAL/APL procedures, or integrating ML into ABAP applications.

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
저장한 Skills