Delete scikit-learn/SCIKIT-LEARN_USER_GUIDE.txt
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106================================================================================
SCIKIT-LEARN - USER GUIDE (Android Python STB) - Generated by RIMI
================================================================================
What is scikit-learn?
---------------------
scikit-learn is a Python module for machine learning built on top of SciPy
(numpy, scipy) and distributed under BSD-3-Clause. It provides simple and
efficient tools for predictive data analysis: classification, regression,
clustering, dimensionality reduction, model selection, preprocessing.
This wheel is cross-compiled for Android (cp312, android_24_x86_64 /
android_24_arm64_v8a, 16KB page, NoRELRO, single libc++_shared.so).
Installation
------------
Via PipManager in app or via Install_WHEELS_to_DEVICE.ps1 (option 1 ALL or 2 single):
pip install scikit_learn-1.7.1-cp312-cp312-android_24_x86_64.whl
Requires at runtime (all in WHEELS, pure+native):
numpy>=1.22.0 (6.4M android_24_x86_64, 16KB)
scipy>=1.8.0 (31M android_24_x86_64, 16KB, no C: RUNPATH)
joblib>=1.2.0 (0.29M pure)
threadpoolctl>=3.1.0 (0.02M pure)
No extra build deps needed at runtime (cython, meson-python only for building).
Quick Start (Android)
---------------------
import sklearn
print(sklearn.__version__) # 1.7.1
from sklearn.datasets import load_iris
X, y = load_iris(return_X_y=True) # X shape (150,4)
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
Xt = scaler.fit_transform(X)
from sklearn.decomposition import PCA
pca = PCA(n_components=2)
Xt2 = pca.fit_transform(X) # shape (150,2)
from sklearn.cluster import KMeans
km = KMeans(n_clusters=3, n_init=10, random_state=42)
labels = km.fit_predict(X)
from sklearn.linear_model import LogisticRegression
clf = LogisticRegression(max_iter=200)
clf.fit(X[:100], y[:100])
pred = clf.predict(X[:5])
from sklearn.ensemble import RandomForestClassifier
clf = RandomForestClassifier(n_estimators=10, random_state=42)
clf.fit(X[:100], y[:100])
from sklearn.metrics import accuracy_score
acc = accuracy_score(y_true, y_pred)
from sklearn.model_selection import train_test_split, cross_val_score
Xtr, Xte, ytr, yte = train_test_split(X, y, test_size=0.25, random_state=42)
scores = cross_val_score(clf, X, y, cv=3)
API Gotchas (Android)
---------------------
- All 69 Cython extensions are 16KB page aligned (LOAD 0x4000, no GNU_RELRO,
NEEDED libc++_shared.so only, no C: RUNPATH). Verified via llvm-readelf.
- sklearn imports numpy/scipy/joblib/threadpoolctl — ensure those wheels
are installed first (Install_WHEELS_to_DEVICE.ps1 does it in sorted order).
- No tkinter/matplotlib required for core; plotting via matplotlib is optional
(extra, not needed for ML).
- For XGBoost sklearn interface (XGBRegressor/XGBClassifier), sklearn must be
installed (now in WHEELS 1.7.1, 7-8M).
Tested Features (Test_ScikitLearn.py)
-------------------------------------
- import sklearn, C extension _tree
- load_iris, load_digits
- StandardScaler, MinMaxScaler
- PCA (10->2)
- KMeans (3 clusters)
- LogisticRegression, LinearRegression
- RandomForestClassifier (10 trees)
- accuracy_score, mean_squared_error
- train_test_split, cross_val_score (3-fold)
All 15 tests PASS, 0 SKIP, 0 FAIL on Android x86_64 emulator (Python 3.12.14).
Platform Notes (Android)
------------------------
- Arch: x86_64 (emulator) and arm64-v8a (phone) — both 16KB, NoRELRO
- NDK r26, clang 17.0.2, LLD, -z norelro -z max-page-size=16384
- Links only to /data/app/.../lib/x86_64/libc++_shared.so (custom 1.3M, not NDK 4K)
+ librimi.so + libpython3.12.so.1.0 — no libc++.so/libc++abi.so/libunwind.
- No Windows C:/ paths in any .so (strings check 0).
Troubleshooting
---------------
- ImportError: No module named 'sklearn' → install wheel via PipManager
- ImportError: libomp.so → already handled via threadpoolctl, no extra
- If Test_ScikitLearn shows SKIP for missing joblib/threadpoolctl, install
those pure wheels first (they are in WHEELS).
================================================================================
Generated by RIMI
================================================================================scikit-learn/SCIKIT-LEARN_USER_GUIDE.txtDeleted-106