Skip to content

fayzi-dev/scikit_learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I am currently learning machine learning algorithms. Here, you will find a collection of examples that I have implemented during this learning journey. I hope these examples are interesting and helpful for you, dear visitor, and assist in better understanding the concepts.

  1. Random State
  2. Startify
  3. Missing Values
  4. PipeLine
  5. Column Transformer
  6. Confusion Matrix
  7. Roc Curve
  8. Encode Categorical Features
  9. Save & Load Model
  10. Grid Search
  11. Decision Tree
  12. Decision Tree Plots & Pruning Nodes
  13. Drop Binary
  14. Custom Transformer Function For Outlier Remove
  15. Create Balance & Inbalanced Syntethic_Data by make_classification

Here's a brief overview of some common scikit-learn models categorized by their purpose:

Classification Models

  1. Logistic Regression: Used for binary classification problems.

    • from sklearn.linear_model import LogisticRegression
  2. Decision Tree Classifier: A tree-based model for classification tasks.

    • from sklearn.tree import DecisionTreeClassifier
  3. Random Forest Classifier: An ensemble of decision trees for better accuracy.

    • from sklearn.ensemble import RandomForestClassifier
  4. Support Vector Machine (SVM): Effective for high-dimensional spaces.

    • from sklearn.svm import SVC
  5. K-Nearest Neighbors (KNN): Classifies based on the closest training examples.

    • from sklearn.neighbors import KNeighborsClassifier
  6. Gradient Boosting Classifier: An ensemble technique that builds models sequentially.

    • from sklearn.ensemble import GradientBoostingClassifier

Regression Models

  1. Linear Regression: Models the relationship between a dependent variable and one or more independent variables.

    • from sklearn.linear_model import LinearRegression
  2. Ridge Regression: A type of linear regression that includes L2 regularization.

    • from sklearn.linear_model import Ridge
  3. Lasso Regression: Includes L1 regularization, which can lead to sparse solutions.

    • from sklearn.linear_model import Lasso
  4. Decision Tree Regressor: For regression tasks using a decision tree.

    • from sklearn.tree import DecisionTreeRegressor
  5. Random Forest Regressor: An ensemble method for regression based on decision trees.

    • from sklearn.ensemble import RandomForestRegressor
  6. Gradient Boosting Regressor: Sequentially builds models to minimize error.

    • from sklearn.ensemble import GradientBoostingRegressor

Clustering Models

  1. K-Means Clustering: Partitions data into K distinct clusters.

    • from sklearn.cluster import KMeans
  2. DBSCAN: Density-based clustering that identifies clusters of varying shapes.

    • from sklearn.cluster import DBSCAN
  3. Agglomerative Clustering: A hierarchical clustering method.

    • from sklearn.cluster import AgglomerativeClustering

Model Evaluation

Don't forget about model evaluation techniques:

  • Train/Test Split: from sklearn.model_selection import train_test_split
  • Cross-Validation: from sklearn.model_selection import cross_val_score
  • Metrics: from sklearn.metrics import accuracy_score, mean_squared_error, classification_report, confusion_matrix, etc.