Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help I am building a feedforward neural net work I imported the helper but I'm getting this error please help df=df. to numpy()

I need help I am building a feedforward neural net work I imported the helper but I'm getting this error please help
image text in transcribed
df=df. to numpy() \# Read the data. filename = os.path.join(path, "iris. csv" " ) df= pd.read_csv(filename, na_values=['NA', '?' ]) \# Encode text values to indexes (i.e., [1], [2],[3] for (red, green, blue) val species = helper.encode_text_index (df, "species") \#Convert a Pandas Dataframe to the (x,y) inputs that Tensorflow needs. x,y= helper.to_xy(df, "species") \#Split the data into training and testing sets. x_train, \( x_{\text {_test, }} \), \( y_{\text {_train, }} y_{\text {_test }}= \) train_test_split (x,y, test_size=0.2, ran AttributeError Traceback (most recent call last) 10 - 10 in \&module: 11 \#Convert a Pandas DataFrame to the (x,y) inputs that Tensorflow need 12x,y= helper, to_ xy(df, "species") 13 14 \#Split the data into training and testing sets. DesktoplDeeplearning__Assignimenetlutil/helper.py in to xy (df, target) \# Classification dummies = pd.get_dummies (df [target] ) return df.as_matrix(result). -astype(np.float32), dummies.as_mat else: \# Regression 5485 ): return self[name] 5487 return object._getattribute__self, name) 5489 def setattr _ (5elf, name: str, value) None: AttributeError: 'Dataframe' object has no attribute 'as matrix' M A Define, and build your model. model = Sequential() mode1.add (Dense (FIXME, input dim=x. Shape[1], kernel initializer='norma1\%, activation='FiDaME')) A Hint: try different activation functions model.add(Dense(1, kernel init ializer=' normal')) mode 1 add (Dense (y, shape [1], activation='FIXME'))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions