0% found this document useful (0 votes)
24 views2 pages

Sichikit Learn

Scikit-learn is a widely used Python library for machine learning that offers tools for data preprocessing, model training, evaluation, and selection. It includes features for classification, regression, clustering, model selection, and feature engineering. The document provides a code example demonstrating how to split data, train a Random Forest classifier, and evaluate its accuracy.

Uploaded by

sexyydiro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Sichikit Learn

Scikit-learn is a widely used Python library for machine learning that offers tools for data preprocessing, model training, evaluation, and selection. It includes features for classification, regression, clustering, model selection, and feature engineering. The document provides a code example demonstrating how to split data, train a Random Forest classifier, and evaluate its accuracy.

Uploaded by

sexyydiro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Scikit-learn (Machine Learning Library)


Scikit-learn is a popular Python library for machine learning, providing tools for data
preprocessing, model training, evaluation, and selection.

Key Features:

 Classification (e.g., SVM, Random Forest, k-NN)


 Regression (e.g., Linear Regression, Ridge, Lasso)
 Clustering (e.g., K-Means, DBSCAN)
 Model Selection & Validation (e.g., train_test_split, GridSearchCV)
 Feature Engineering (e.g., StandardScaler, PCA)

from sklearn.model_selection import train_test_split

from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import accuracy_score

# Example data

X, y = [[1, 2], [3, 4], [5, 6], [7, 8]], [0, 1, 0, 1]

# Splitting data

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Model training

model = RandomForestClassifier(n_estimators=100, random_state=42)

model.fit(X_train, y_train)

# Predictions and evaluation

y_pred = model.predict(X_test)

print("Accuracy:", accuracy_score(y_test, y_pred))

You might also like