Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want to do the encoding and splitging withou the helper becuse it is not working please I need help im building a feed forward

I want to do the encoding and splitging withou the helper becuse it is not working please I need help im building a feed forward Nueral network
image text in transcribed
* Read the data. \[ \begin{array}{l} f \text { ilename = os.path.join(path, "iris.csv") } \\ d f=\text { pd.read_csv(filename, na_values=['NA', '?']) } \end{array} \] \# Encode text values to indexes (i.e., [1],[2], [3] for (red, green, blue) values). species = helper.encode_text_index(df, "species") \#Convert a Pandas Dataframe to the (x,y) inputs that Tensorflow needs. \[ \begin{array}{l} x, y=\text { helper.to } x y(d f \text {, "species") }(x, y) \text { inputs that Tensorflow needs. } \\ \text { \#Split the data into training and testing sets. } \\ \text { x_train, x_test, y_train, } y_{\text {_t_test }} \text {, train_test_split( } x, y \text {, test_size=0.2, random_state=42) } \end{array} \] AttributeError 11x,y= helper.to_xy (df, "species") 12 13 \#Split the data into training and testing sets. \# Classification dummies = pd.get_dummies (df[target] ) return df.as_matrix(result).astype(np.float32), dummies.as_matrix().astype(r else: \# Regression 54855486):returnself[name] 5487 return object._getattribute__(self, name) 5488 def _setattr__(self, name: str, value) None: AttributeError: 'DataFrame' object has no attribute 'as_matrix

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

Students also viewed these Databases questions

Question

Identify several ways to make better decisions about retirement.

Answered: 1 week ago