Install any skill in seconds. Free to start, no credit card required.
Get Started Free →SAP HANA Machine Learning Python Client (hana-ml) development skill. Use when: Building ML solutions with SAP HANA's in-database machine learning using Python hana-ml library for PAL/APL algorithms, DataFrame operations, AutoML, model persistence, and visualization. Keywords: hana-ml, SAP HANA, machine learning, PAL, APL, predictive analytics, HANA DataFrame, ConnectionContext, classification, regression, clustering, time series, ARIMA, gradient boosting, AutoML, SHAP, model storage
.claude/skills/secondsky-sap-hana-ml/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 63% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 48% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 16% | 0% |
Use this skill when building machine learning workflows with the hana-ml Python client, using PAL/APL algorithms, querying HANA DataFrames, training or scoring models in-database, using AutoML, visualizing model output, or troubleshooting Python-to-HANA ML connections.
| Issue | First check | |-------|-------------| | Connection fails | Verify HANA host, port, TLS/encryption, user privileges, and network allowlists. | | PAL/APL algorithm missing | Confirm the HANA system has the required AFL/PAL/APL libraries installed and licensed. | | DataFrame collection is slow | Push filtering/projection into HANA and avoid collecting large frames into Python. |
Package Version: 2.22.241011 Last Verified: 2025-11-27
bashpip install hana-ml
Requirements: Python 3.8+, SAP HANA 2.0 SPS03+ or SAP HANA Cloud
pythonfrom hana_ml import ConnectionContext # Connect conn = ConnectionContext( address='<hostname>', port=443, user='<username>', password='<password>', encrypt=True ) # Create DataFrame df = conn.table('MY_TABLE', schema='MY_SCHEMA') print(f"Shape: {df.shape}") df.head(10).collect()
pythonfrom hana_ml.algorithms.pal.unified_classification import UnifiedClassification # Train model clf = UnifiedClassification(func='RandomDecisionTree') clf.fit(train_df, features=['F1', 'F2', 'F3'], label='TARGET') # Predict & evaluate predictions = clf.predict(test_df, features=['F1', 'F2', 'F3']) score = clf.score(test_df, features=['F1', 'F2', 'F3'], label='TARGET')
pythonfrom hana_ml.algorithms.apl.classification import AutoClassifier # Automated classification auto_clf = AutoClassifier() auto_clf.fit(train_df, label='TARGET') predictions = auto_clf.predict(test_df)
pythonfrom hana_ml.model_storage import ModelStorage ms = ModelStorage(conn) clf.name = 'MY_CLASSIFIER' ms.save_model(model=clf, if_exists='replace')
UnifiedClassification, UnifiedRegression, KMeans, ARIMAreferences/PAL_ALGORITHMS.md for complete listAutoClassifier, AutoRegressor, GradientBoostingClassifierreferences/APL_ALGORITHMS.md for detailscollect() calledreferences/DATAFRAME_REFERENCE.md for complete APIreferences/VISUALIZERS.md for 14 visualization modulespythonfrom hana_ml.algorithms.pal.partition import train_test_val_split train, test, val = train_test_val_split( data=df, training_percentage=0.7, testing_percentage=0.2, validation_percentage=0.1 )
python# APL models importance = auto_clf.get_feature_importances() # PAL models from hana_ml.algorithms.pal.preprocessing import FeatureSelection fs = FeatureSelection() fs.fit(train_df, features=features, label='TARGET')
pythonfrom hana_ml.algorithms.pal.pipeline import Pipeline from hana_ml.algorithms.pal.preprocessing import Imputer, FeatureNormalizer pipeline = Pipeline([ ('imputer', Imputer(strategy='mean')), ('normalizer', FeatureNormalizer()), ('classifier', UnifiedClassification(func='RandomDecisionTree')) ])
collect()ModelStorage for persistencePipelineProgressStatusMonitor for long-running jobsreferences/DATAFRAME_REFERENCE.md (479 lines)references/PAL_ALGORITHMS.md (869 lines)references/APL_ALGORITHMS.md (534 lines)references/VISUALIZERS.md (704 lines)references/SUPPORTING_MODULES.md (626 lines)pythonfrom hana_ml.ml_exceptions import Error try: clf.fit(train_df, features=features, label='TARGET') except Error as e: print(f"HANA ML Error: {e}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | pass→pass | 12,060 | 8,658 | -28% | 1 | 1 | 0% | 1,952 | 3,177 | +63% | 0 | 0 | — |
case-01 | pass→pass | 12,130 | 7,125 | -41% | 1 | 1 | 0% | 2,101 | 3,107 | +48% | 0 | 0 | — |
case-02 | pass→pass | 9,796 | 3,277 | -67% | 1 | 1 | 0% | 2,027 | 2,360 | +16% | 0 | 0 | — |
case-03 | pass→pass | 11,210 | 5,901 | -47% | 1 | 1 | 0% | 2,026 | 2,758 | +36% | 0 | 0 | — |
case-04 | pass→pass | 5,740 | 4,174 | -27% | 1 | 1 | 0% | 939 | 2,524 | +169% | 0 | 0 | — |
case-05 | pass→pass | 11,030 | 6,217 | -44% | 1 | 1 | 0% | 1,936 | 2,932 | +51% | 0 | 0 | — |
case-06 | pass→pass | 11,607 | 5,540 | -52% | 1 | 1 | 0% | 1,933 | 2,730 | +41% | 0 | 0 | — |
case-07 | pass→pass | 7,688 | 3,668 | -52% | 1 | 1 | 0% | 1,355 | 2,347 | +73% | 0 | 0 | — |
case-08 | fail→pass | 9,871 | 5,880 | -40% | 1 | 1 | 0% | 1,866 | 2,829 | +52% | 0 | 0 | — |
case-09 | fail→pass | 15,191 | 3,330 | -78% | 1 | 1 | 0% | 2,812 | 2,270 | -19% | 0 | 0 | — |
case-11 | pass→pass | 5,230 | 3,336 | -36% | 1 | 1 | 0% | 971 | 2,303 | +137% | 0 | 0 | — |
case-12 | pass→pass | 4,409 | 4,206 | -5% | 1 | 1 | 0% | 685 | 2,453 | +258% | 0 | 0 | — |
case-13 | pass→pass | 7,768 | 5,504 | -29% | 1 | 1 | 0% | 1,373 | 2,636 | +92% | 0 | 0 | — |
case-14 | pass→pass | 3,244 | 2,060 | -36% | 1 | 1 | 0% | 446 | 2,053 | +360% | 0 | 0 | — |
case-15 | pass→pass | 5,994 | 2,617 | -56% | 1 | 1 | 0% | 1,027 | 2,130 | +107% | 0 | 0 | — |
case-16 | pass→pass | 7,194 | 4,909 | -32% | 1 | 1 | 0% | 1,286 | 2,563 | +99% | 0 | 0 | — |
case-17 | pass→pass | 5,024 | 4,076 | -19% | 1 | 1 | 0% | 805 | 2,425 | +201% | 0 | 0 | — |
case-18 | pass→pass | 2,808 | 4,080 | +45% | 1 | 1 | 0% | 421 | 2,390 | +468% | 0 | 0 | — |
case-19 | pass→pass | 4,295 | 3,587 | -16% | 1 | 1 | 0% | 759 | 2,316 | +205% | 0 | 0 | — |
case-20 | pass→pass | 15,313 | 8,741 | -43% | 1 | 1 | 0% | 2,706 | 3,268 | +21% | 0 | 0 | — |
case-21 | pass→pass | 10,952 | 10,484 | -4% | 1 | 1 | 0% | 2,008 | 3,637 | +81% | 0 | 0 | — |
case-22 | pass→pass | 5,988 | 4,476 | -25% | 1 | 1 | 0% | 1,200 | 2,549 | +112% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.