1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zhuklara [117]
2 years ago
10

Let's model this housing price data! Before we can do this, however, we need to split the data into training and test sets. Reme

mber that the response vector (housing prices) lives in the target attribute. A random seed is set here so that we can deterministically generate the same splitting in the future if we want to test our result again and find potential bugs. Use the train_test_split function to split out 10% of the data for the test set. Call the resulting splits X_train, X_test, Y_train, Y_test.
Engineering
1 answer:
Lilit [14]2 years ago
3 0

The program reads in a dataset into a pandas dataframe, and uses the train_test_split function in the sklearn library to split the data into <em>training and test sets</em>. The code goes thus :

import pandas as pd

<em>#import</em><em> </em><em>the</em><em> </em><em>pandas</em><em> </em><em>dataframe</em><em> </em><em>and</em><em> </em><em>alias</em><em> </em><em>it</em><em> </em><em>as</em><em> </em><em>pd</em>

from sklearn.model_selection import train_test_split

<em>#import</em><em> </em><em>the</em><em> </em><em>train_test_split</em><em> </em><em>function</em><em> </em>

housing_df = pd.read_csv('housing price.csv')

<em>#read</em><em> </em><em>in</em><em> </em><em>the</em><em> </em><em>housing</em><em> </em><em>data</em><em> </em>

features_df = df.iloc[:,1:]

<em>#seperate</em><em> </em><em>the</em><em> </em><em>features</em><em> </em><em>from</em><em> </em><em>the</em><em> </em><em>label</em><em> </em><em>;</em>

target_df = df.iloc[:,0]

<em>#put</em><em> </em><em>the</em><em> </em><em>label</em><em> </em><em>into</em><em> </em><em>a</em><em> </em><em>seperate</em><em> </em><em>dataframe</em><em> </em><em>as</em><em> </em><em>well</em><em>.</em><em> </em>

X_train, X_test, Y_train, Y_test = train_test_split(features_df, target_df, test_size = 0.1, random_state = 1)

<em>#uses</em><em> </em><em>tuple</em><em> </em><em>unpacking</em><em> </em><em>to</em><em> </em><em>randomly</em><em> </em><em>assign</em><em> </em><em>the</em><em> </em><em>data</em><em> </em><em>each</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>4</em><em> </em><em>variables</em><em>.</em><em> </em>

<em>#</em><em>Test</em><em> </em><em>size</em><em> </em><em>is</em><em> </em><em>test</em><em> </em><em>percent</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>entire</em><em> </em><em>dataset</em><em> </em>

Learn more :brainly.com/question/4257657?referrer=searchResults

You might be interested in
A garden hose fills a 2-gallon bucket in 5 seconds. The number of gallons, g (y), is proportional to the number of seconds, t (x
stepladder [879]

Answer:

0.4 gallons per second

Explanation:

A function shows the relationship between an independent variable and a dependent variable.

The independent variable (x values) are input variables i.e. they don't depend on other variables while the dependent variable (y values) are output variables i.e. they depend on other variables.

The rate of change or slope or constant of proportionality is the ratio of the dependent variable (y value) to the independent variable (x value).

Given that the garden hose fills a 2-gallon bucket in 5 seconds. The dependent variable = g = number of gallons, the independent variable = t = number of seconds.

Constant of proportionality = g / t = 2 / 5 = 0.4 gallons per second

5 0
3 years ago
What is the primary responsibility of ABET?
nalin [4]

Answer:

C

Explanation:

The ABET (Accreditation Board for Engineering and Technology) is a non-governmental organization that accredits programs in applied science, computing, engineering, and engineering technology, both in the United States and elsewhere.

Give Brainliest pls

5 0
3 years ago
A model of living systems as whole entities which maintain themselves through continuous input and output from the environment,
3241004551 [841]

A model of living systems as whole entities which maintain themselves through continuous input and output from the environment, developed by ludwig von bertalanffy is known as Systems theory.

<h3>what are the application of systems theory?</h3>

It is a theoretical framework to understand the working mechanism of an organization.

It is an entity where all the elements necessary to carry out its functions.

A computer is the best  example of showing the mechanism of system theory.

computer is a system which has many smaller sub-systems that have to work in coordinated manner.

These sub-systems are the processor, RAM, motherboard, hard drive and power supply.

Learn more about systems theory , here:

brainly.com/question/28278157

#SPJ4

7 0
2 years ago
PLEASE QUICK!!!!!!!!!!! Overtime people have given names to groups of stars called_____
kirza4 [7]

Answer:

Constellations

Explanation:

Constellations describes a group of stars that appear to form a pattern or a picture. Example of common patterns are : Leo the Lion or Orion the Great Hunter. It is easy to recognize constellations and most people will tend to orient with these patterns. There are 88 patterns currently known.

6 0
3 years ago
Which of the following statements is not necessarily true for a well-arranged floor plan?
lorasvet [3.4K]

A well arranged floor plan is one that optimises the given floor area. Floor plans are useful to help design furniture layout, wiring systems, and much more. Option B is the answer, since it does not meet the standard of a plan

<h3>What is a Floor Plan?</h3>

A floor plan is a scaled diagram of a room or building viewed from above. The floor plan may depict an entire building, one floor of a building, or a single room. It may also include measurements, furniture, appliances, or anything else necessary to the purpose of the plan.

<h3>Other properties of a floor plan are:</h3>
  1. Maximize the property
  2. Utilize space effectively
  3. Accessibility
  4. Flexibility
  5. Functionality
  6. Maximize the use of light
  7. Attention to size
  8. Fitting to your lifestyle

Learn more:

brainly.com/question/25057316

4 0
2 years ago
Other questions:
  • 5. Assume that you and your best friend ench have $1000 to invest. You invest your money
    8·1 answer
  • The following electrical characteristics have been determined for both intrinsic and p-type extrinsic gallium antimonide (GaSb)
    12·1 answer
  • Argon is compressed in a polytropic process with n=1.2 from 120 kPa and 10 °C to 800 kPa in a piston cylinder device. Determine:
    11·1 answer
  • Why do we write proton ions first before electron ions? <br>​
    10·1 answer
  • A thick oak wall initially at 25°C is suddenly exposed to gases for which T =800°C and h =20 W/m2.K. Answer the following questi
    5·1 answer
  • Which of the following is an example of a reliable source?
    10·1 answer
  • What is a magnitute?
    5·2 answers
  • IN JAVA,
    6·1 answer
  • Which of these people is an engineer?
    13·1 answer
  • Zander worked at a pet shop in high school and during college began taking classes in veterinary medicine. To pay the bills duri
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!