Skip to main content

Posts

Voting Classifier

Voting Classifier In voting classifier we select some models.Suppose you select Logistic Regression,SVM,KNN Always remember no.of models you select will always odd because we use majority count Suppose a new data point cames and Outputs are 1.Logististic Regression->1 2.SVM->0 3.KNN->1 Here you can see no.of model said 1(2)>no.of model said 0(1)-.So ours model says 1 Here you can also use this logic in multiclass classification

Ensemble Learning

Ensemble learning Ensemble learning is a technique where we merges model power Experiment A man came with animal and collect public and said that if anyone tell exact weight of this animal I will give price. Every one says wrong weight but man take mean of public guesses And man get surprised because it is exactly animal's weight Its explain power 💪 of crowd Technique 1. Voting 2. Bagging 3. Boosting 4. Stacking

Log loss

Log loss log loss is a loss for classification it is for logistic regression Loss for logistic regression  

Regularization code

Ridge Regression from sklearn.linear_model import Ridge # Importing Ridge ridge= Ridge() ridge. fit(X_train,y_train) ridge. score(X_test,y_test) ridge. predict(new_df) Lasso regression from sklearn.linear_model import Lasso lasso= Lasso () lasso. fit(X_train,y_train) lasso. score(X_test,y_test) lasso. predict(new_df) ElasticNet regression from   sklearn.linear_model  import   ElasticNet elastic=ElasticNet() elastic. fit(X_train,y_train) elastic. score(X_test,y_test) elastic. predict(new_df) NOTE-> å…¥ is set by alpha param