Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

sklearn cross_val_score scoring metric

from sklearn.linear_model import RidgeClassifier
from sklearn.model_selection import cross_val_score

clf = RidgeClassifier() # estimator
score = cross_val_score(clf, X, y, cv=5)

# By default, the score computed at each CV iteration is the score
# method of the estimator. It is possible to change this by using 
# the scoring parameter:

scores = cross_val_score(clf, X, y, cv=5, scoring='f1_macro')
Comment

sklearn cross_val_score scoring metric

from sklearn.linear_model import RidgeClassifier
from sklearn.model_selection import cross_val_score

clf = RidgeClassifier() # estimator
score = cross_val_score(clf, X, y, cv=5)

# By default, the score computed at each CV iteration is the score
# method of the estimator. It is possible to change this by using 
# the scoring parameter:

scores = cross_val_score(clf, X, y, cv=5, scoring='f1_macro')
Comment

PREVIOUS NEXT
Code Example
Python :: get only first 10 columns pandas 
Python :: get first row sqlalchemy 
Python :: read_table python 
Python :: django login_required decorator 
Python :: python list to string 
Python :: using df.astype to select categorical data and numerical data 
Python :: integer colomn to datetime pandas 
Python :: how to read excel file in python 
Python :: django orm count 
Python :: copy from folder to folder python 
Python :: passing user instance django form submission 
Python :: python create list of specific length 
Python :: pyautogui moveTo overtime 
Python :: how to reduce width of image in pygame 
Python :: how to get input python 
Python :: how to create frequency table in python 
Python :: multinomial regression scikit learn 
Python :: python remove spaces 
Python :: how to get a number from a string in python 
Python :: count unique values pandas 
Python :: curl python 
Python :: value count in python 
Python :: duplicate data in python 
Python :: converting int to binary python 
Python :: Create list with numbers between 2 values 
Python :: override python print for class 
Python :: discord.py fetch channel 
Python :: plot size 
Python :: sort dict by value python 3 
Python :: python env 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =