Machine Learning - Copy - Copy
Machine Learning - Copy - Copy
Unit – 1
Supervised
Unsupervised
Reinforcement Training
Biological neurons are interconnected nerve cells in the brain that are involved in the processing and
transmitting of chemical and electrical signals. McCulloch and Pitts described such a nerve cell as a simple logic
gate with binary outputs; multiple signals arrive at the dendrites, they are then integrated into the cell body,
and, if the accumulated signal exceeds a certain threshold, an output signal is generated that will be passed on
by the axon.
Artificial neuron
decision function, 𝜎(z), that takes a linear combination of certain input values, x, and a corresponding weight
vector, w, where z is the so-called net input z = w1x1 + w2x2 + ... + wnxn
y(i) is the true class label, 𝑦^(𝑖) is the predicted class label
Adaline neuron vs Perceptron neuron
model.fit(x_train,y_train)
y_pred=model.predict(x_test) plt.scatter(x_test[:,0], x_test[:,1], c=y_test ,label=’Train’)
acc=accuracy_score(y_test,y_pred) plt.show()
plt.scatter(x_train[:,0], x_train[:,1],c=y_train,label=’Train’)
Slow Updates: Since it processes the entire dataset, it is computationally expensive, especially for large
datasets.
Global Convergence: Provides a smooth path to the minimum but can get stuck in local minima.
• Faster Updates: Updates are made after processing each sample, making it faster for large datasets.
• Noisy Updates: Updates fluctuate due to randomness, which can help escape local minima.
• Non-Deterministic: Each run may produce slightly different results because of random sampling.
• Less Memory Intensive: Only a single sample is required in memory at any time
Feature Scaling
Feature scaling is a technique used to normalize the range of independent variables (features) in a dataset. It
ensures that no single feature dominates others due to its scale(no skewness). This is especially important in
algorithms like gradient descent, k-NN, and SVM(Scale Varient models). Common Methods: Min-Max Scaling,
Standardization (Z-score).
•Slow Convergence: Larger ranges in feature values can cause the gradient descent to take more time to
converge, as the algorithm makes smaller steps in some dimensions and larger ones in others.
•Risk of Getting Stuck: With unscaled features, gradient descent may “oscillate” across the cost surface,
increasing the risk of missing the optimal solution.
•Difficulties with Optimal Learning Rates: Without scaling, finding a learning rate that works for all features
becomes challenging. A learning rate that works well for one feature might not be suitable for another with a
larger range.
In machine learning, underfitting and overfitting are two common problems related to model performance and
generalization
Variance VS Bias
Using k-fold cross-validation to assess model performance– advs, code
- holdout cross-validation
- k-fold cross-validation
Types of Bias
one class or multiple classes are over-represented in a dataset
A False Negative occurs when the model incorrectly predicts the negative class
**Problems
False Positive on confusion
Rate/ Recall matrix