Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Machine Learning Advanced Certification | Lakshmi Devi | Aug 23 -Sept 10

In class 3's last project:
Print the data frame in a Boolean form as True or False. True for Null/ NaN values and false for non-null values?
We got Null for all columns, but not for the column "last_name" as it is a string. How to make a null value for that column also?


Answer:
project_new.reset_index(inplace=True)
project_new.isna()
 

Attachments

  • Screenshot 2021-08-26 at 8.07.39 PM.png
    Screenshot 2021-08-26 at 8.07.39 PM.png
    175.3 KB · Views: 9
Last edited:
Hi,

I we have any data visualization between two Variable's X and Y what type of Algorithm is being used to make something fruitful output from the same.

I am attaching a pic please assist me for the same.
 

Attachments

  • DataVisualization.png
    DataVisualization.png
    8.6 KB · Views: 4
Hi,

If we get r2_score = 100% what does it exactly mean??

If there is any situation came during creation of Model what exactly we have do??
 
In class on Titanic project, in LogReg.predict_proba(X_test) and LogReg.predict(X_test) comparison. What are class 0 and class 1? There was a comparison based on this

Answer:
Class 0 = Did not survive
Class 1= Did Survive
 

Attachments

  • Screenshot 2021-09-02 at 10.20.16 PM.png
    Screenshot 2021-09-02 at 10.20.16 PM.png
    203.1 KB · Views: 2
Last edited:
How did you get column name as Emabark C , Embark S etc in Titanic project? I could not get the same. PFA


Answer:
dummy = pd.get_dummies(df_train['Embarked'], drop_first = True)
dummy
 

Attachments

  • Screenshot 2021-09-02 at 10.21.37 PM.png
    Screenshot 2021-09-02 at 10.21.37 PM.png
    212.9 KB · Views: 1
Last edited:

Sunanda Behera

New Member
Discuss your queries here!!
I have an error while trying t plot the elbow plot,
below is the code:
wcss=[]

for i in range(1,11):
kmeans = KMeans(n_clusters=i, init ='k-means++' , max_iter=300, n_init=10 , random_state=0)
kmeans.fit(df.drop('id',axis=1))
wcss.append(kmeans.inertia_)
plt.plot(range(1,11),wcss)
plt.title('The Elbow method Graph')


I am getting the following error:
ValueError: x and y must have same first dimension, but have shapes (10,) and (1,)
 

Attachments

  • Capture.PNG
    Capture.PNG
    23.1 KB · Views: 1
Top