Deep Learning (Neural Networks): Multi-layered artificial neural networks capable of parsing complex unstructured inputs like images, speech, and text.
Total Pageviews
Tuesday, August 18, 2026
Reinforcement Learning
Reinforcement Learning: Uses an agent that takes actions in an environment and optimizes behavior based on cumulative rewards or penalties rather than static training datasets.
Semi-Supervised Learning:
Semi-Supervised Learning: Trains on a small amount of labeled data combined with a large pool of unlabeled data to save labeling costs.
Unsupervised Learning Models
Unsupervised Learning Models
Unsupervised models process data without predefined labels, allowing the system to discover structural properties on its own.
- Clustering: Groups similar data points together based on shared traits (e.g., K-Means, Hierarchical clustering).
- Dimensionality Reduction: Simplifies complex datasets while retaining vital patterns (e.g., Principal Component Analysis). Specialized and Advanced Models
Supervised Learning Models
Supervised Learning Models
Supervised models use input data paired with known output labels to learn the relationship between them.
- Regression models: Predict continuous numeric values like prices or temperatures (e.g., Linear Regression, Ridge, Lasso).
- Classification models: Predict discrete categories or classes (e.g., Logistic Regression, Support Vector Machines, Naive Bayes).
- Decision Trees & Ensembles: Combine multiple decision rules or trees to boost accuracy (e.g., Random Forest).
Different type of models used in Machine Learning in Python
Different type of models used in Machine Learning in Python
Scikit-Learn (Traditional Machine Learning)
LinearRegression: Basic regression for continuous data.LogisticRegression: Standard baseline for binary classification.RandomForestClassifier/RandomForestRegressor: Powerful ensemble tree models.GradientBoostingClassifier: Sequential tree building for high accuracy.SVC: Support Vector Classifier for complex boundaries.KMeans: Unsupervised clustering algorithm.
XGBClassifier/XGBRegressor: High-performance, scalable gradient boosting.LGBMClassifier/LGBMRegressor: Fast, leaf-wise tree growth models.
torchvision.models.resnet50: Industry standard for image classification.torchvision.models.vit_b_16: Vision Transformer for advanced image tasks.torchaudio.models.wave2vec2_model: Architecture for speech processing.torch.nn.Transformer: Raw building block for sequence-to-sequence tasks.
keras.applications.ResNet50: Pre-trained deep residual network for vision.keras.applications.MobileNetV3Large: Lightweight, mobile-optimized vision model.keras.applications.EfficientNetB0: State-of-the-art scaling for image tasks.keras.layers.LSTM: Recurrent layer stringed together for text/time-series.
bert-base-uncased: Baseline for text classification and extraction.roberta-base: Improved, harder-trained version of BERT.gpt2: Standard starting point for causal text generation.meta-llama/Meta-Llama-3-8B: State-of-the-art large language model for fine-tuning.google/vit-base-patch16-224: Vision transformer adapted for Hugging Face pipelines.
OLS: Ordinary Least Squares regression with deep statistical summaries.ARIMA: Autoregressive Integrated Moving Average for time-series forecasting.Logit: Logistic regression specialized for statistical inference.
Monday, August 17, 2026
HOW TO TRAIN A MODEL STEP BY STEP IN PYTHON
HOW TO TRAIN A MODEL STEP BY STEP IN PYTHON:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score
data = {
'Hours': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'Scores': [10, 20, 30, 40, 50, 60, 70, 80, 85, 95]
}
df = pd.DataFrame(data)
print(df.head())
Hours Scores 0 1 10 1 2 20 2 3 30 3 4 40 4 5 50
plt.scatter(df['Hours'], df['Scores']) plt.xlabel('Hours Studied') plt.ylabel('Scores') plt.title('Hours vs Scores') plt.show()
X = df[['Hours']] # Independent variable y = df['Scores'] # Dependent variable #Now split into training and testing sets: X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
model = LinearRegression() model.fit(X_train, y_train)y_pred = model.predict(X_test) print(y_pred)Parameters
fit_intercept True copy_X True tol 1e-06 n_jobs None positive False Fitted attributes
Name Type Value coef_ ndarray[float64](1,) [9.61] feature_names_in_ ndarray[object](1,) ['Hours'] intercept_ float64 1.509 n_features_in_ int 1 rank_ int 1 singular_ ndarray[float64](1,) [7.62] y_pred = model.predict(X_test)print(y_pred)[88.01724138 20.73275862]print("Mean Squared Error:", mean_squared_error(y_test, y_pred))print("R2 Score:", r2_score(y_test, y_pred))Mean Squared Error: 4.820340368608807 R2 Score: 0.9954363641480627[88.01724138 20.73275862]
print("Mean Squared Error:", mean_squared_error(y_test, y_pred)) print("R2 Score:", r2_score(y_test, y_pred))Mean Squared Error: 4.820340368608807 R2 Score: 0.9954363641480627hours = np.array([[7.5]]) predicted_score = model.predict(hours) print(f"Predicted Score for 7.5 hours: {predicted_score[0]}")
plt.scatter(X, y, color='blue') plt.plot(X, model.predict(X), color='red') plt.xlabel('Hours Studied') plt.ylabel('Scores') plt.title('Linear Regression - Hours vs Scores') plt.show()Predicted Score for 7.5 hours: 73.59913793103448