Day 100 Of 100DaysOfCode: Regression with categorical features

Despite of being women from non-technical background, I was able to complete my 100s days as learning new things and most of the time not knowing what am I doing. But its looking back at the first day when I was feeling confused about naming the variab…


This content originally appeared on DEV Community and was authored by Durga Pokharel

Despite of being women from non-technical background, I was able to complete my 100s days as learning new things and most of the time not knowing what am I doing. But its looking back at the first day when I was feeling confused about naming the variable, I am feeling like I know something now. Also, I have just applied for an intern position.

This is my 100th day of #100daysofcode and #python learning journey. Like usual day todays also I keep learning from DataCamp. I completed some assignments there.

Code for Regression with categorical features

# Import necessary modules
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import Ridge

# Instantiate a ridge regressor: ridge
ridge = Ridge(alpha=0.5, normalize=True)

# Perform 5-fold cross-validation: ridge_cv
ridge_cv = cross_val_score(ridge, X, y, cv=5)

# Print the cross-validated scores
print(ridge_cv)

Output of the above code will be


[0.86808336 0.80623545 0.84004203 0.7754344  0.87503712]

Day 100 Of #100DaysOfCode and #Python
Regression with categorical features from DataCamp#WomenWhoCode #100DaysOfCode #CodeNewbie #DEVCommunity pic.twitter.com/mrYnm1EfSc

— Durga Pokharel (@durgacodes) April 8, 2021


This content originally appeared on DEV Community and was authored by Durga Pokharel


Print Share Comment Cite Upload Translate Updates
APA

Durga Pokharel | Sciencx (2021-04-08T17:24:06+00:00) Day 100 Of 100DaysOfCode: Regression with categorical features. Retrieved from https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/

MLA
" » Day 100 Of 100DaysOfCode: Regression with categorical features." Durga Pokharel | Sciencx - Thursday April 8, 2021, https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/
HARVARD
Durga Pokharel | Sciencx Thursday April 8, 2021 » Day 100 Of 100DaysOfCode: Regression with categorical features., viewed ,<https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/>
VANCOUVER
Durga Pokharel | Sciencx - » Day 100 Of 100DaysOfCode: Regression with categorical features. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/
CHICAGO
" » Day 100 Of 100DaysOfCode: Regression with categorical features." Durga Pokharel | Sciencx - Accessed . https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/
IEEE
" » Day 100 Of 100DaysOfCode: Regression with categorical features." Durga Pokharel | Sciencx [Online]. Available: https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/. [Accessed: ]
rf:citation
» Day 100 Of 100DaysOfCode: Regression with categorical features | Durga Pokharel | Sciencx | https://www.scien.cx/2021/04/08/day-100-of-100daysofcode-regression-with-categorical-features/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.