Search⌘ K

Logistic Regression Steps: 8 and 9

Explore how to use logistic regression models to predict binary outcomes and evaluate their performance. Understand the application of confusion matrices and classification reports to assess model accuracy, precision, recall, and f1-score in practical scenarios.

We'll cover the following...

8) Predict

Let’s use our model now to predict the likely outcome of an individual Kickstarter campaign based on the input of its independent variables.

C++
#8. Predict
model_predict = model.predict(X_test)
new_project = [
0, #Comments
9, #Rewards
2500, #Goal
157, #Backers
31, #Duration in Days
319, #Facebook Friends
110, #Facebook Shares
1, #Creator - # Projects Created
0, #Creator - # Projects Backed
0, ## Videos
12, ## Images
872, ## Words (Description)
65, ## Words (Risks and Challenges)
0, ## FAQs
0, #Currency_AUD
1, #Currency_CAD
0, #Currency_EUR
0, #Currency_GBP
0, #Currency_NZD
0, #Currency_USD
0, #Top Category_Art
0, #Top Category_Comics
0, #Top Category_Crafts
0, #Top Category_Dance
0, #Top Category_Design
0, #Top Category_Fashion
1, #Top Category_Film & Video
0, #Top Category_Food
0, #Top Category_Games
0, #Top Category_Journalism
0, #Top Category_Music
0, #Top Category_Photography
0, #Top Category_Publishing
0, #Top Category_Technology
0, #Top Category_Theater
#0, #Facebook Connected_No
#0, #Facebook Connected_Yes
#0, #Has Video_No
#1, #Has Video_Yes
]
new_pred = model.predict([new_project])
print(new_pred)

According to the positive binary outcome of our model [1], the new campaign is ...