ﺎﻬﻓﺮﻌﺗ ﻦﻜﺗ ﻢﻟ ﺎﻤﺑﺭ Scikit-Learn ﺭﺍﺮﺳﺃ 7


.ﺎﻨﻳﺪﻟ ﺕﺎﻧﺎﻴﺒﻟﺍ ﻞﻤﻋ ﺮﻴﺳ ﻦﻴﺴﺤﺘﻟ ﺭﺍﺮﺳﻷﺍ ﻦﻣ ﺪﻳﺪﻌﻟﺍ ﻰﻠﻋ Scikit-Learn ﻱﻮﺘﺤﻳﻭ ،ﻲﺳﺎﺳﻷ

.ﻚﻟﺫ ﻲﻓ ﻞﺧﺪﻧ ﺎﻧﻮﻋﺩ ،ﻂﻐﻠﻟﺍ ﻦﻣ ﺪﻳﺰﻣ ﻥﻭﺩ .ﺎﻬﻓﺮﻌﺗ ﻦﻜﺗ ﻢﻟ ﺎﻤﺑﺭ Scikit-Learn ﻦﻣ ﺭﺍﺮﺳ

ﺔﻴﻟﺎﻤﺘﺣﻻﺍ ﺓﺮﻳﺎﻌﻣ .1

.ﺕﺎﺟﺮﺨﻤﻠﻟ ﺔﻴﻠﻌﻔﻟﺍ ﺔﻴﻟﺎﻤﺘﺣﻻﺍ ﺲﻜﻌﺗ ﻻ ﺎﻬﻧﺃ ﻲﻨﻌﻳ ﺎﻤﻣ ،ﺓﺭﻭﺮﻀﻟﺎﺑ ﺍﺪًﻴﺟ ﺎﻬﺗﺮﻳﺎﻌﻣ ﻢﺘﺗ ﻻ

.ﻲﻠﻌﻔﻟﺍ ﻝﺎﻤﺘﺣﻻﺍ ﺲﻜﻌﺘﻟ ﺕﻻﺎﻤﺘﺣﻻﺍ ﻂﺒﺿ ﻰﻟﺇ ﺔﻴﻟﺎﻤﺘﺣﻻﺍ ﺓﺮﻳﺎﻌﻣ ﻑﺪﻬﺗ .ﺢﻴﺤﺻ ﺆﺒﻨﺘﻟﺍ ﺍﺬﻫ

.ﻒﻨﺼﻤﻟﺍ ﻲﻓ ﺔﻴﻨﻘﺘﻟﺍ ﺓﺮﻳﺎﻌﻤﻟ Scikit-Learn ﺔﻴﻟﺎﺘﻟﺍ ﺔﻴﺠﻣﺮﺒﻟﺍ ﺔﻤﻴﻠﻌﺘﻟﺍ ﻡﺪﺨﺘﺴﻳ .ﺮﺗﻮﺘ

from sklearn.calibration import CalibratedClassifierCV
from sklearn.svm import SVC

svc = SVC(probability=False)
calibrated_svc = CalibratedClassifierCV(base_estimator=svc, method='sigmoid', cv=5)
calibrated_svc.fit(X_train, y_train)
probabilities = calibrated_svc.predict_proba(X_test)

."ﺮﺗﻮﺘﻟﺍ ﻱﻭﺎﺴﺘﻣ" ﻭﺃ "ﻲﻨﻴﺴﻟﺍ" ﻦﻴﺑ ﻞﻳﺪﺒﺘﻟﺍ ﺔﻘﻳﺮﻄﻟﺍ ﻩﺬﻫ ﻚﻟ ﺢﻴﺘﺗ .ﺔﻴﻟﺎﻤﺘﺣﺍ ﺕﺎﺟﺮﺨﻣ

.ﺮﺗﻮﺘﻟﺍ ﺔﻳﻭﺎﺴﺘﻣ ﺓﺮﻳﺎﻌﻣ ﻊﻣ Random Forest ﻒﻨﺼﻣ ﺎﻨﻫ ﺪﺟﻮﻳ ،ﻝﺎﺜﻤﻟﺍ ﻞﻴﺒﺳ ﻰﻠﻋ

from sklearn.calibration import CalibratedClassifierCV
from sklearn.ensemble import RandomForestClassifier

rf = RandomForestClassifier(random_state=42)
calibrated_rf = CalibratedClassifierCV(base_estimator=rf, method='isotonic', cv=5)
calibrated_rf.fit(X_train, y_train)
probabilities = calibrated_rf.predict_proba(X_test)

.ﻚﺑ ﺹﺎﺨﻟﺍ ﻒﻨﺼﻤﻟﺍ ﺓﺮﻳﺎﻌﻣ ﻲﻓ ﺮﻜﻔﻓ ،ﺏﻮﻠﻄﻤﻟﺍ ﺆﺒﻨﺘﻟﺍ ﺮﻓﻮﻳ ﻻ ﻚﺑ ﺹﺎﺨﻟﺍ ﺝﺫﻮﻤﻨﻟﺍ ﻥﺎﻛ ﺍﺫ

ﺩﺎﺤﺗﻻﺍ ﺓﺰﻴﻣ .2

.ﺪﺣﺍﻭ ﻝﻮﺤﻣ ﻲﻓ ﺓﺩﺪﻌﺘﻣ ﺕﻻﻮﺤﻣ ﺕﺎﻨﺋﺎﻛ ﺞﻣﺪﻟ ﺔﻘﻳﺮﻃ ﺮﻓﻮﺗ ﻲﺘﻟﺍ Scikit ﺔﺌﻓ ﻮﻫ ﺕﺍﺰﻴﻤﻟﺍ ﺩ

.ﺎﻨﻳﺪﻟ ﻲﻟﻵﺍ ﻢﻠﻌﺘﻟﺍ ﺔﺟﺬﻤﻧ ﻲﻓ ﻱﺯﺍﻮﺘﻟﺎﺑ ﺎﻬﻣﺍﺪﺨﺘﺳﺍﻭ ﺕﺎﻧﺎﻴﺒﻟﺍ ﺔﻋﻮﻤﺠﻣ ﺲﻔﻧ ﻦﻣ ﺓﺩﺪﻌﺘﻣ

.ﻲﻟﺎﺘﻟﺍ ﺩﻮﻜﻟﺍ ﻲﻓ ﻥﻮﻠﻤﻌﻳ ﻒﻴﻛ ﻯﺮﻧ ﺎﻧﻮﻋﺩ

from sklearn.pipeline import FeatureUnion, Pipeline
from sklearn.decomposition import PCA
from sklearn.feature_selection import SelectKBest
from sklearn.svm import SVC

combined_features = FeatureUnion([
    ("pca", PCA(n_components=2)),
    ("select_best", SelectKBest(k=1))
])

pipeline = Pipeline([
    ("features", combined_features),
    ("svm", SVC())
])

pipeline.fit(X_train, y_train)

.ﺔﻳﺩﺮﻓ ﺔﻴﻠﻤﻋ ﻲﻓ ﺎﻨﺑ ﺹﺎﺨﻟﺍ ﺕﺍﺰﻴﻤﻟﺍ ﺩﺎﺤﺗﺍ ﻡﺍﺪﺨﺘﺳﺎﺑ ﺢﻤﺴﻳ ﻥﺃ ﻪﻧﺄﺷ ﻦﻣ ﺐﻴﺑﺎﻧﻷﺍ ﻂﺧ ﻊﻣ

.ﺔﻴﻓﺎﺿﻹﺍ ﺕﺍﺰﻴﻤﻟﺍ ﺩﺎﺤﺗﺍ ﻊﻣ ﺎﻫﺎﻨﺸﻗﺎﻧ ﻲﺘﻟﺍ ﺔﻘﺑﺎﺴﻟﺍ ﺔﻘﻳﺮﻄﻠﻟ ﻝﺎﺜﻣ ﻲﻠﻳ ﺎﻤﻴﻓ .ﺔﻘﺒﺴﻤﻟﺍ

# First FeatureUnion
first_union = FeatureUnion([
    ("pca", PCA(n_components=5)),
    ("select_best", SelectKBest(k=5))
])

# Second FeatureUnion
second_union = FeatureUnion([
    ("poly", PolynomialFeatures(degree=2, include_bias=False)),
    ("scaled", StandardScaler())
])

pipeline = Pipeline([
    ("first_union", first_union),
    ("second_union", second_union),
    ("svm", SVC())
])

pipeline.fit(X_train, y_train)
score = pipeline.score(X_test, y_test)

.ﻲﻟﻵﺍ ﻢﻠﻌﺘﻟﺍ ﺔﺟﺬﻤﻧ ﺔﻴﻠﻤﻋ ﺔﻳﺍﺪﺑ ﻲﻓ ﻕﺎﻄﻨﻟﺍ ﺔﻌﺳﺍﻭ ﺔﻘﺒﺴﻣ ﺔﺠﻟﺎﻌﻣ ﻰﻟﺇ ﻥﻮﺟﺎﺘﺤﻳ ﻦﻳﺬﻟﺍ

ﻞﺘﻜﺘﻟﺍ ﺓﺰﻴﻣ .3

.ﺔﻬﺑﺎﺸﺘﻤﻟﺍ ﺕﺍﺰﻴﻤﻟﺍ ﺞﻣﺪﻟ ﻲﻣﺮﻬﻟﺍ ﻊﻴﻤﺠﺘﻟﺍ ﻡﺪﺨﺘﺴﺗ ﺎﻬﻨﻜﻟﻭ Scikit-Learn ﻦﻣ ﺕﺍﺰﻴﻤﻟﺍ ﺭ

.ﻩﺎﻧﺩﺪﺣ ﻱﺬﻟﺍ ﺔﻓﺎﺴﻤﻟﺍ ﺱﺎﻴﻗﻭ ﻁﺎﺒﺗﺭﻻﺍ ﺭﺎﻴﻌﻣ ﻰﻠﻋ ءًﺎﻨﺑ ﺕﺍﺰﻴﻤﻟﺍ ﺞﻣﺩﻭ ،ﻲﻣﺮﻬﻟﺍ ﻊﻴﻤﺠﺘﻟﺍ

.ﻲﻟﺎﺘﻟﺍ ﺩﻮﻜﻟﺍ ﻲﻓ ﻞﻤﻌﻳ ﻒﻴﻛ ﻯﺮﻧ ﺎﻧﻮﻋﺩ

from sklearn.cluster import FeatureAgglomeration

agglo = FeatureAgglomeration(n_clusters=10)
X_reduced = agglo.fit_transform(X)

.ﻡﺎﻤﺘﻟﺍ ﺐﻴﺟ ﻪﺑﺎﺸﺗ ﻰﻟﺇ ﺔﻓﺎﺴﻤﻟﺍ ﺱﺎﻴﻗ ﺮﻴﻐﻧ ﻒﻴﻛ ﻯﺮﻧ ﺎﻧﻮﻋﺩ .ﺔﻋﻮﻤﺠﻤﻟﺍ ﻡﺎﻗﺭﺃ ﺪﻳﺪﺤﺗ ﻝﻼ

agglo = FeatureAgglomeration(metric='cosine')

.ﻲﻟﺎﺘﻟﺍ ﺩﻮﻜﻟﺎﺑ ﻂﺑﺮﻟﺍ ﺔﻘﻳﺮﻃ ﺮﻴﻴﻐﺗ ﺎﻀًﻳﺃ ﺎﻨﻨﻜﻤﻳ

agglo = FeatureAgglomeration(linkage='average')

.ﺓﺪﻳﺪﺠﻟﺍ ﺓﺰﻴﻤﻟﺎﺑ ﺔﺻﺎﺨﻟﺍ ﺕﺍﺰﻴﻤﻟﺍ ﻊﻴﻤﺠﺘﻟ ﺔﻔﻴﻇﻮﻟﺍ ﺮﻴﻴﻐﺗ ﺎﻀًﻳﺃ ﺎﻨﻨﻜﻤﻳ ،ﻚﻟﺫ ﺪﻌﺑﻭ

import numpy as np 
agglo = FeatureAgglomeration(pooling_func=np.median)

.ﻚﺑ ﺔﺻﺎﺨﻟﺍ ﺔﺟﺬﻤﻨﻠﻟ ﺕﺎﻧﺎﻴﺑ ﺔﻋﻮﻤﺠﻣ ﻞﻀﻓﺃ ﻰﻠﻋ ﻝﻮﺼﺤﻠﻟ ﺕﺍﺰﻴﻤﻟﺍ ﻊﻴﻤﺠﺗ ﺔﺑﺮﺠﺗ ﻝﻭﺎﺣ

ﺎﻘًﺒﺴﻣ ﺩﺪﺤﻣ ﻢﻴﺴﻘﺗ .4

.ﻑٍﺎﻛ ﺮﻴﻏ ﻲﻘﺒﻄﻟﺍ K-fold ﻭﺃ ﻲﺳﺎﻴﻘﻟﺍ K-fold ﻥﻮﻜﻳﻭ ،ﺔﻨﻴﻌﻣ ﺔﻘﻳﺮﻄﺑ ﺎﻨﺗﺎﻧﺎﻴﺑ ﻢﻴﺴﻘﺗ ﺪﻳ

.ﻩﺎﻧﺩﺃ ﺩﻮﻜﻟﺍ ﻡﺍﺪﺨﺘﺳﺎﺑ ﺎﻘًﺒﺴﻣ ﺩﺪﺤﻤﻟﺍ ﻢﻴﺴﻘﺘﻟﺍ ﺏﺮﺠﻧ ﺎﻧﻮﻋﺩ

from sklearn.model_selection import PredefinedSplit, GridSearchCV

# -1 for training, 0 for test
test_fold = [-1 if i < 100 else 0 for i in range(len(X))]
ps = PredefinedSplit(test_fold)

param_grid = {'parameter': [1, 10, 100]}
grid_search = GridSearchCV(model, param_grid, cv=ps)
grid_search.fit(X, y)

.ﺭﺎﺒﺘﺧﺎﻛ ﻲﻗﺎﺒﻟﺍﻭ ﺐﻳﺭﺪﺘﻛ ﺕﺎﻧﺎﻴﺑ ﺔﺋﺎﻣ ﻝﻭﺃ ﺪﻳﺪﺤﺗ ﻖﻳﺮﻃ ﻦﻋ ﺕﺎﻧﺎﻴﺒﻟﺍ ﻢﻴﺴﻘﺗ ﻂﻄﺨﻣ ﻦﻴﻴﻌ

.ﺢﻴﺟﺮﺘﻟﺍ ﺔﻴﻠﻤﻋ ﻝﻼﺧ ﻦﻣ ﻚﻟﺫ ﺮﻴﻴﻐﺗ ﺎﻨﻨﻜﻤﻳ .ﻚﺗﺎﺒﻠﻄﺘﻣ ﻰﻠﻋ ﻢﻴﺴﻘﺘﻟﺍ ﺔﻴﺠﻴﺗﺍﺮﺘﺳﺍ ﺪﻤﺘﻌﺗ

sample_weights = np.random.rand(100)
test_fold = [-1 if i < 80 else 0 for i in range(len(X))]
ps = PredefinedSplit(test_fold)

.ﻚﻟ ﺪﺋﺍﻮﻓ ﻡﺪﻘﺗ ﺖﻧﺎﻛ ﺍﺫﺇ ﺎﻣ ﻯﺮﺘﻟ ﺎﻬﺑﺮﺟ ﺍﺬﻟ ،ﺕﺎﻧﺎﻴﺒﻟﺍ ﻢﻴﺴﻘﺗ ﺔﻴﻠﻤﻋ ﻲﻓ ﺓﺪﻳﺪﺟ ﺔﻘﻳﺮﻃ

ﺔﺌﻓﺍﺩ ﺔﻳﺍﺪﺑ .5

.ﺔﻳﺍﺪﺒﻟﺍ ﻦﻣ ﺝﺫﻮﻤﻨﻟﺍ ﺐﻳﺭﺪﺗ ﺓﺩﺎﻋﺇ ﻲﻓ ﺐﻏﺮﺗ ﻻ ﺖﻧﺄﻓ ،ﺕﻻﺎﺤﻟﺍ ﻩﺬﻫ ﻲﻓ ﻚﺴﻔﻧ ﺕﺪﺟﻭ ﺍﺫﺇ ؟ﺔ

.ﺔﺌﻓﺍﺪﻟﺍ ﺔﻳﺍﺪﺒﻟﺍ ﻪﻴﻓ ﻙﺪﻋﺎﺴﺗ ﻥﺃ ﻦﻜﻤﻳ ﻱﺬﻟﺍ ﻥﺎﻜﻤﻟﺍ ﻮﻫ ﺍﺬﻫ

.ﺮﻔﺼﻟﺍ ﻦﻣ ﺎﻨﺟﺫﻮﻤﻧ ﺐﻳﺭﺪﺗ ﺓﺩﺎﻋﺇ ﻲﻓ ﺐﻏﺮﻧ ﻻ ﺎﻣﺪﻨﻋ ﺔﻤﻴﻗ ﺕﺍﺫ ﺔﻘﻳﺮﻄﻟﺍ ﻩﺬﻫ ﺮﺒﺘﻌﺗ .ﻯﺮﺧﺃ

.ﺔﻳﺍﺪﺒﻟﺍ ﻦﻣ ءﺪﺒﻟﺍ ﻥﻭﺩ ﻪﺒﻳﺭﺪﺗ ﺪﻴﻌﻧﻭ ﺝﺫﻮﻤﻨﻟﺍ ﻰﻟﺇ ﺭﺎﺠﺷﻷﺍ ﻦﻣ ﺪﻳﺰﻤﻟﺍ ﻒﻴﻀﻧ ﺎﻣﺪﻨﻋ ﺔﺌﻓ

from sklearn.ensemble import GradientBoostingClassifier

#100 trees
model = GradientBoostingClassifier(n_estimators=100, warm_start=True)
model.fit(X_train, y_train)

# Add 50 trees
model.n_estimators += 50
model.fit(X_train, y_train)

.ﺔﺌﻓﺍﺪﻟﺍ ﺔﻳﺍﺪﺒﻟﺍ ﺓﺰﻴﻣ ﻡﺍﺪﺨﺘﺳﺎﺑ ﻲﻋﺎﻤﺟ ﺐﻳﺭﺪﺗ ءﺍﺮﺟﺇ ﺎﻀًﻳﺃ ﻦﻜﻤﻤﻟﺍ ﻦﻣ

from sklearn.linear_model import SGDClassifier

model = SGDClassifier(max_iter=1000, warm_start=True)

# Train on first batch
model.fit(X_batch_1, y_batch_1)

# Continue training on second batch
model.fit(X_batch_2, y_batch_2)

.ﺐﻳﺭﺪﺘﻟﺍ ﺖﻗﻮﺑ ﺔﻴﺤﻀﺘﻟﺍ ﻥﻭﺩ ﺝﺫﻮﻤﻧ ﻞﻀﻓﺃ ﻰﻠﻋ ﺎﻤًﺋﺍﺩ ﻞﺼﺤﺘﻟ ﺔﺌﻓﺍﺩ ﺔﻳﺍﺪﺑ ﺔﺑﺮﺠﺘﺑ ﻢﻗ

ﺪﻳﺍﺰﺘﻤﻟﺍ ﻢﻠﻌﺘﻟﺍ .6

.ﻲﻠﺴﻠﺴﺗ ﻞﻜﺸﺑ ﺓﺪﻳﺪﺟ ﺕﺎﻧﺎﻴﺑ ﻢﻳﺪﻘﺘﺑ ﺎﻬﻴﻓ ﻡﻮﻘﻧ ﻲﻟﻵﺍ ﻢﻠﻌﺘﻟﺍ ﻰﻠﻋ ﺐﻳﺭﺪﺗ ﺔﻴﻠﻤﻋ ﻮﻫ - ﺖﻧ

.ﺮﻔﺼﻟﺍ ﻦﻣ ﺲﻴﻟ ﻦﻜﻟﻭ ،ﺮﻤﺘﺴﻤﻟﺍ ﺐﻳﺭﺪﺘﻟﺍ ﺓﺩﺎﻋﺇ ﻡﺰﻠﻳ ﻚﻟﺬﻟ ،ﺖﻗﻮﻟﺍ ﺭﻭﺮﻤﺑ ﺕﺎﻧﺎﻴﺒﻟﺍ ﻊﻳﺯﻮ

.ﺕﺎﻌﻓﺩ ﻰﻠﻋ ﻲﺟﺫﻮﻤﻨﻟﺍ ﺐﻳﺭﺪﺘﻟﺍ ءﺍﺮﺟﺈﺑ ﺢﻤﺴﻴﺳ .ﺔﻴﺋﺰﺠﻟﺍ ﺔﻣءﻼﻤﻟﺍ ﺔﻘﻳﺮﻃ ﻡﺍﺪﺨﺘﺳﺎﺑ ﺎﻴًﻓﺎﺿ

.ﺔﻴﺠﻣﺮﺒﻟﺍ ﺕﺎﻤﻴﻠﻌﺘﻟﺍ ﻝﺎﺜﻣ ﻰﻠﻋ ﺓﺮﻈﻧ ﻲﻘﻠﻧ ﺎﻧﻮﻋﺩ

from sklearn.linear_model import SGDClassifier
import numpy as np

classes = np.unique(y_train)
model = SGDClassifier()
for batch_X, batch_y in data_stream:
    model.partial_fit(batch_X, batch_y, classes=classes)

.ﺔﻘﻠﺤﻟﺍ ﺕﺮﻤﺘﺳﺍ ﺎﻤﻟﺎﻃ ﺪﻳﺍﺰﺘﻤﻟﺍ ﻢﻠﻌﺘﻟﺍ ﺮﻤﺘﺴﻴﺳ

.ﺔﻘﺒﺴﻤﻟﺍ ﺔﺠﻟﺎﻌﻤﻠﻟ ﺎﻀًﻳﺃ ﻦﻜﻟﻭ ﻲﺟﺫﻮﻤﻨﻟﺍ ﺐﻳﺭﺪﺘﻠﻟ ﻂﻘﻓ ﺲﻴﻟ ﺪﻳﺍﺰﺘﻤﻟﺍ ﻢﻠﻌﺘﻟﺍ ءﺍﺮﺟﺇ ﺎﻀًﻳ

from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
for batch_X, batch_y in data_stream:
    batch_X = scaler.partial_fit_transform(batch_X)
    model.partial_fit(batch_X, batch_y, classes=classes)

.Scikit-Learn ﻦﻣ ﻲﺋﺰﺠﻟﺍ ﺐﺳﺎﻨﺘﻟﺍ ﺔﻘﻳﺮﻃ ﻡﺍﺪﺨﺘﺳﺍ ﻝﻭﺎﺤﻓ ،ﺍﺪًﻳﺍﺰﺘﻣ ﺎﻤًﻠﻌﺗ ﺐﻠﻄﺘﺗ ﻚﺑ ﺔﺻ

ﺔﻴﺒﻳﺮﺠﺘﻟﺍ ﺕﺍﺰﻴﻤﻟﺍ ﻰﻟﺇ ﻝﻮﺻﻮﻟﺍ .7

.ﺎﻬﻣﺍﺪﺨﺘﺳﺍ ﻞﺒﻗ ﺎﻬﻠﻴﻌﻔﺗ ﺎﻨﻴﻠﻋ ﺐﺠﻳﻭ ،ﺎﻴًﺒﻳﺮﺠﺗ ﺎﻬﻀﻌﺑ ﻝﺍﺰﻳ ﻻﻭ .ﺖﺑﺎﺜﻟﺍ ﺭﺍﺪﺻﻹﺍ ﻲﻓ Sci

.Scikit-Learn ﻦﻣ ﻦﻴﻜﻤﺘﻟﺍ ﺔﺑﺮﺠﺗ ﺕﺎﻘﻴﺒﻄﺗ ﺔﺠﻣﺮﺑ ﺔﻬﺟﺍﻭ ﺩﺍﺮﻴﺘﺳﺍﻭ ﺔﻴﺒﻳﺮﺠﺘﻟﺍ ﺔﺨﺴﻨﻟﺍ ﻲ

.ﻩﺎﻧﺩﺃ ﻝﺎﺜﻤﻟﺍ ﺰﻣﺭ ﻯﺮﻧ ﺎﻧﻮﻋﺩ

# Enable the experimental feature
from sklearn.experimental import enable_iterative_imputer  
from sklearn.impute import IterativeImputer

imputer = IterativeImputer(random_state=0)

.ﺔﺌﻔﻟﺍ ﻡﺪﺨﺘﺴﻧ ﻥﺃ ﻞﺒﻗ ﺔﻳﺍﺪﺒﻟﺍ ﻲﻓ ﻦﻴﻜﻤﺘﻟﺍ ﺓﺍﺩﺃ ﺩﺍﺮﻴﺘﺳﺍ ﻰﻟﺇ ﺝﺎﺘﺤﻧﻭ ،ﺔﻴﺒﻳﺮﺠﺘﻟﺍ ﺔﻠﺣ

.ﻒﺼﻨﻟﺍ ﻰﻟﺇ ﺚﺤﺒﻟﺍ ﺔﻴﺠﻬﻨﻣ ﻲﻫ ﺔﻴﺒﻳﺮﺠﺘﻟﺍ ﺔﻠﺣﺮﻤﻟﺍ ﻲﻓ ﻝﺍﺰﺗ ﻻ ﻯﺮﺧﺃ ﺓﺰﻴﻣ

from sklearn.experimental import enable_halving_search_cv
from sklearn.model_selection import HalvingRandomSearchCV
from sklearn.model_selection import HalvingGridSearchCV

.ﻦﻴﻜﻤﺘﻟﺍ ﺓﺍﺩﺃ ﺩﺍﺮﻴﺘﺳﺍ ﻖﻳﺮﻃ ﻦﻋ ﺎﻬﻴﻟﺇ ﻝﻮﺻﻮﻟﺍ ﻝﻭﺎﺣ ﺍﺬﻟ ،ﺔﻴﺒﻳﺮﺠﺘﻟﺍ ﺔﻠﺣﺮﻤﻟﺍ ﻲﻓ ﻥﻮﻜﺗ

ﺔﻤﺗﺎﺧ

Scikit-Learn ﻲﻫ ﺔﻟﺎﻘﻤﻟﺍ ﻩﺬﻫ ﻲﻓ ﺎﻫﺎﻨﻟﻭﺎﻨﺗ ﻲﺘﻟﺍ ﺔﻌﺒﺴﻟﺍ ﺭﺍﺮﺳﻷﺍ ،ﺔﻌﺟﺍﺮﻤﻠﻟﻭ .ﺎﻬﻓﺮﻌﺗ

  1. ﺔﻴﻟﺎﻤﺘﺣﻻﺍ ﺓﺮﻳﺎﻌﻣ
  2. ﺩﺎﺤﺗﻻﺍ ﺓﺰﻴﻣ
  3. ﻞﺘﻜﺘﻟﺍ ﺓﺰﻴﻣ
  4. ﺎﻘًﺒﺴﻣ ﺩﺪﺤﻣ ﻢﻴﺴﻘﺗ
  5. ﺔﺌﻓﺍﺩ ﺔﻳﺍﺪﺑ
  6. ﻱﺪﻳﺍﺰﺘﻟﺍ ﻢﻠﻌﺘﻟﺍ
  7. ﺔﻴﺒﻳﺮﺠﺘﻟﺍ ﺕﺍﺰﻴﻤﻟﺍ ﻰﻟﺇ ﻝﻮﺻﻮﻟﺍ

!ﺪﻋﺎﺳ ﺪﻗ ﺍﺬﻫ ﻥﻮﻜﻳ ﻥﺃ ﻞﻣﺁ