DESCRIPTION
Question 1: Create a Dataframe having 8 columns namely, A,B,C,D,E,F,G,H with the following properties: 1) Number of rows: 2500, Number of columns: 8 2) Create a Dataframe with random integers ranges from 0 to 3 3) Values of Column A = Column B + Column C 4) Values of Column H = Column G - Column A Question 2: For the dataframe created in Q1, create a new dataframe by choosing following columns [A, B, C, D, E, F], create a bayesian model with the following edges ('A', 'B'), ('C', 'B'), ('C', 'D'),('E', 'F'). Estimate the model parameters of node 'B' using Bayesian Estimator. Carry out the following tasks: 1. Create a dataframe as instructed in question 1 2. Create a new dataframe by choosing the following columns [A, B, C, D, E, F] 3. Create a Bayesian model with the following edges ('A', 'B'), ('C', 'B'), ('C', 'D'),('E', 'F') 4. Estimate the model parameters of node 'B' using Bayesian Estimator 5. Write all the output in a .csv file
question1
#To be given to students
import pandas as pd
import numpy as np
import random
np.random.seed(2)
data = pd.DataFrame()
##Write your code here
question2
from pgmpy.models import BayesianModel
from pgmpy.estimators import BayesianEstimator
#write code here
print(node_B_cpds)
#write output to a file
np.savetxt("/code/output/output2.csv", node_B_cpds, delimiter=",")
Solution:
Here is data frame
Get Machine Learning Assignment problem solver answers with step-by-step explanations. Our online Machine Learning Assignment help tutors are available 24*7 to help you with your toughest Machine Learning problem.
We offer the Machine Learning Assignment Help, Machine Learning Assignment Solution, Machine Learning Assignment Project, Machine Learning Assignment Online Tutors
Please send us your machine learning project inquiries with deadline at codersarts@gmail.com for the Machine Learning Assignment Solution.
OR
contact us for machine learning assignment solutions.