Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

classification cross validation

from sklearn.model_selection import cross_val_predict
xgb=XGBClassifier(colsample_bytree=0.8, learning_rate=0.4, max_depth=4)
cvs=cross_val_score(xgb,x,y,scoring='accuracy',cv=10)
print('cross_val_scores=  ',cvs.mean())
y_pred=cross_val_predict(xgb,x,y,cv=10)
conf_mat=confusion_matrix(y_pred,y)
conf_mat
Comment

PREVIOUS NEXT
Code Example
Python :: pandas loc for list 
Python :: flask sending post request 
Python :: re.sub in python example 
Python :: how to install package offline 
Python :: python codes 
Python :: plot neural network keras 
Python :: python list to dict 
Python :: Python message popup 
Python :: resize cmd using python 
Python :: basic flask app 
Python :: django forms request 
Python :: python: convert variable as character 
Python :: python show map with coordinates 
Python :: what is kernel_initializer 
Python :: python counter nested dictionary 
Python :: python import file from different directory 
Python :: how to make a dice program in python 
Python :: deep clone 2d list python 
Python :: read pickle file 
Python :: add a new column to numpy array 
Python :: Replace all the empty rows in the column with the value that you have identified 
Python :: python stack data structure 
Python :: K-Means Clustering in Python – 3 clusters 
Python :: executing curl commands in python 
Python :: pytest temp directory 
Python :: chrome profiles user open with python 
Python :: pycharm update python version 
Python :: modern tkinter 
Python :: python trim 
Python :: generate random list and find max in list python 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =