Description
Hello. I am build a static line chart contains five data points. However, my tooltips (d3.js version of chart legend) is off the line. I am wondering why and would like to get some help ASAP.
What I am trying to achieve is : https://bl.ocks.org/Qizly/8f6ba236b79d9bb03a80
What I got : see pic attached below.
I also attached my code in below. Thanks :)
Unformatted Attachment Preview
Error vs. Measurements
0.95
100
Error: 0.84
0.90-1
0.85
Error
0.80
0.75 -1
0.70
0.65
0.60+
50
100
150
200
250
300
350
400
450
500
Measurements
Purchase answer to see full attachment
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Review
Review
Anonymous
Great! Studypool always delivers quality work.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
Snake Game for Java Code
Problem 1: SnakeGamePanel.javaCreate a public class SnakeGamePanel which is a sub-class of JPanelpublic class SnakeGamePan ...
Snake Game for Java Code
Problem 1: SnakeGamePanel.javaCreate a public class SnakeGamePanel which is a sub-class of JPanelpublic class SnakeGamePanel extends JPanelThis class will implement the Snake game on a JPanel. Here is the basic setup:The screen of the game is 320x320 pixels large. The apple’s size is 20x20 pixels. At the beginning of the game, the snake is also has the size of an apple.The positions of the snake and apple are randomly selected and cannot be the same. Their x and y coordinates have to be multiples of 20 and in the range of [0, 300].Paint your snake red and apple green.The snake does not move at the beginning. As an arrow key is pressed, the snake starts tomove in the direction of the arrow.As the game starts, the snake moves with a constant speed of 20pixels/0.25second. The jump is precisely 20 pixels. Use a Timer with the delay time set to be 250 milliseconds to fire an action event periodically and then update the animation graphics in the action listener.In detail:During the (delay) time between two consecutive animation graphics updates, the player can hit multiple and different arrow keys. Still, the last key will override all previous keys, and you need to use the last key for graphics updates. Write a class DirectionListener that implements the interface KeyListener to keep track of the (final) pressed key during any delay time.private class DirectionListener implements KeyListenerYou only need to implement the method keyPressed() of this interface and leave the implemen- tations of other methods empty. Remember the role of this class is to obtain the direction of the snake. Do not update the snake’s position or call the repaint() method.Write a class MovingListener to implement the interface ActionListener. 1 Figure 1: The snake is moving to the left, before and after eating an apple. After the snake eats an apple, another apple is generated. A sequence is added to the tail of the snake.private class MovingListener implements ActionListenerIn implementing the actionPerformed() method, use the arrow key obtained from the keyPressed() method to update the snake’s position. You need to make sure that the snake cannot reverse its direction. For example, if the snake is moving right and the player presses the left arrow key, the snake does not change its direction. Instead, the left arrow key is ignored, and the snake keeps moving right. One important thing: if no arrow key is pressed, the snake keeps going in the same direction.In the implementation of actionPerformed(), you will need to call repaint() and override the paintComponent(..) method:protected void paintComponent (Graphics g)This method will repaint the panel, as well as the snake and apple.After eating an apple, the snake increases its length by one sequence (a square with the same size as the apple). Add that sequence to the tail of the snake. Then generate a new apple by implementing the method nextApple()private void nextApple ()The apple position should also be random, and cannot be located on the body of the snake.After eating every four apples, the game speed increases: reducing the delay time of the Timer by 20 milliseconds. Let the minimum delay time be 50 milliseconds (highest speed). So there will be 11 levels in this game, corresponding to delay times 250, 230, . . . 70, 50. After reaching level 11, the speed does not change no matter how many more apples the snake eats.Write the method isGameOver() to check whether the game is over: private boolean isGameOver()The game is over when the snake hits itself or hits the panel border. The function will return true if the game is over, and false otherwise. Naturally, you will check whether the game is over before calling the repaint() method. The other way around might be ok but not encouraged since we2can assume the snake is in-compressible.While playing the game, if the space key is hit, the game pauses and a dialog box appears saying “Pause, continue?” with a “OK” button. The game will resume as the space key is pressed again or you click the OK button. The snake will continue to move in the same direction as before the pause.When the game is over, show a dialog box with message “Game Over, New Game?” and an “OK” button. You can use either ConfirmDiaglog or OptionDiaglog. Once the play hits the button, a new game is generated. You might need to implement a method newGame() to set this up.private void newGame ()In this method, you will reset the timer’s delay time, restart the timer, and generate a new snakeas well as a new apple.Create an private inner-class Sequence to store the 2D coordinates of apples and snake’s body. Class Sequence provides a parametric constructorpublic Sequence(int x, int y)The class has two instance variables x and y which are the coordinates of a sequence. You can setthese fields public so you can access them directly. Use ArrayList to store the snake (its sequences):ArrayList <Sequence > snake = new ArrayList <>()You will learn ArrayList in detail soon. ArrayList is similar to vector in C++ where its ele- ments are stored contiguously in memory and you do not need to worry about the change of the array size. The class provides some useful methods such as get(int index), add(Object obj), remove(int index), and size(). You can use these methods for this project.A little bit in detail: a snake is like a FIFO (first in first out) data structure.• When the snake grows by one bit, we push a sequence on top of the stack. When it moves by one square, we push a sequence on top and pop an element off the bottomYou will see that Queue or LinkedList is probably a better data structure for this program. However, ArrayList can access data with a constant time. So there is always a tradeoff among these data structures. You will soon learn how to implement & use LinkedList efficiently, but you do not know it now. ArrayList is good enough for now.3Problem 2: SnakeGame.javaIn this java file, create a static method main()public static void main(String args[])In this method, you will create a JFrame with name “Snake Game.” Add a SnakeGamePanel tothis JFrame, set its size un-resizable.We may take off up to 20% of the total marks for poor style; make sure to name your variablesreasonably, indent properly, and comment sufficiently.
Oakland University DATA SCIENCE FOUNDATION
In your organization, discuss the role of predictive analytics. How does it help? What are some of the issues ...
Oakland University DATA SCIENCE FOUNDATION
In your organization, discuss the role of predictive analytics. How does it help? What are some of the issues and challenges faced in your organization? Would people in your organization be hesitant to make decisions based on predictive analytics? If so, why? (Banking and finance is the organization
part II
Predicting Behavior with Logistic Regression
Customer churn occurs when customers stop doing business with a company. Retaining existing customers is less expensive than it is to acquire new customers and hence, building a good predictive model for customer churn is of importance to many companies. Download the dataset Telco.customer.csv. Through this dataset, we attempt to predict behavior to retain customers using logistic regression.
Follow the steps below and create a PowerPoint presentation.
Using R, partition the dataset into training and testing sets by using the code:
(YOURDATA is the name of your dataset in R.)
intrain- createDataPartition(YOURDATA$Churn,p=0.7,list=FALSE)
set.seed(2017)
training- YOURDATA[intrain,]
testing- YOURDATA[-intrain,]
Fit a logistic regression model by using the code:
glm(Churn ~ .,family=binomial(link="logit"),data=training)
Examine the resulting fitted model. What are the significant factors that affect customer churn? Explain how and why they are significant.
Now, let's examine how the model fits using the following code.
testing$Churn - as.character(testing$Churn)
testing$Churn[testing$Churn=="No"] - "0"
testing$Churn[testing$Churn=="Yes"] - "1"
fitted.results - predict(LogModel,newdata=testing,type='response')
fitted.results - ifelse(fitted.results 0.5,1,0)
misClasificError - mean(fitted.results != testing$Churn)
print(paste('Logistic Regression Accuracy',1-misClasificError))
This provides the accuracy of the model.
How can you make a customer churn prediction from the model you fitted? Explain. include the actual calculation.
BME 301 Penn State College MATLAB Coding Questions Response
i will upload the question and and the differential equation. also i will give a memo of it
BME 301 Penn State College MATLAB Coding Questions Response
i will upload the question and and the differential equation. also i will give a memo of it
ITS3105 SUS Programming Automation through Technology Discussion
Fifty or sixty years ago, most people's paychecks were produced by hand; now it is most likely that yours is produced by a ...
ITS3105 SUS Programming Automation through Technology Discussion
Fifty or sixty years ago, most people's paychecks were produced by hand; now it is most likely that yours is produced by a computer or not printed at all but deposited into an account electronically. Forty years ago, most grocery store checkers keyed item prices into the cash register; now it is most likely your items are scanned. Police officers used to direct traffic at many major urban intersections; now the traffic flow is often computer controlled. Are there any tasks now that are mostly done by people that you think would be better handled by a computer? Are there any tasks you hope never become computerized?
On a separate document answer these Learning Journal questions (a minimum of 250 words):
Use the following questions as guides to self-reflection during this week:
Briefly describe what programming you did this week.
Describe any problems you have had and how you solved your problems.
What skills and knowledge do you recognize that you are gaining, and how will these skills and knowledge be useful in school and as a professional after school?
Applied system analysis II Question 2
Course Project Part 2—Architecture Detail
Continuing with the course project you started in Week 1, this week, you will ...
Applied system analysis II Question 2
Course Project Part 2—Architecture Detail
Continuing with the course project you started in Week 1, this week, you will continue working on the solution you have envisioned so far. The work that will be added this week will increment the information you have produced so far, complementing it in a coherent manner.
Tasks
This week, you will design the architecture for the project.
Using the Microsoft Word document created in W1 Assignment 3, add to it by completing the following tasks:
Discuss in detail, using diagrams to support your words, how the architecture is to be used in the system.
Address operational, performance, security, cultural, and political requirements for the project.
Present three possible interface and navigation design concepts.
Similar Content
UCI C Language Programming Worksheet
*In C Language*A loop "runs efficiently in parallel" if execution time with P cores should be expected to be about 1/P tim...
Northeastern University College of Professional S Typography Initials Exercise
Working with one of your initials (T or L), document at least 25 examples of a single
letterform in the environment.Combi...
MATLAB Programming Project, Numerical Methods
Project Instructions is given in the files attached. It is mostly MATLAB with a couple of handwritten questions. The data ...
C++ Financial Calculators
Hello :) I included everything you will need in the attached PDF. you are asked to make a financial calculators, u must in...
Grossmont College Running and Fixing Syntax Errors on Java Codes Paper
I have four codes that need to be fix or write code. they are really easy. All you need to do is fix the code, then run it...
University of The Incarnate Word Student Registration Form Web Page Project
Form. Create a simple student registration form web page that includes:TextboxRadiobuttonPulldown-menuTextareaSubmit butto...
Output With Command Line Arguement As 10 And 20
...
Project Planning.edited
Regardless of any project's size or scope, proper planning is critical and essential for its success. Hence, software deve...
Answers
System.out.println("The value of the variable x is: " + x); System.out.println("The value of the variable x is: " + y);...
Related Tags
Book Guides
Freakonomics
by Stephen J. Dubner and Steven D. Levitt
The Road
by Cormac McCarthy
Sense And Sensibility
by Jane Austen
Underground A Human History of the Worlds Beneath our Feet
by Will Hunt
Death on the Nile
by Agatha Christie
The Da Vinci Code
by Dan Brown
The Picture of Dorian Gray
by Oscar Wilde
The Subtle Art of Not Giving a F*ck
by Mark Manson
The Second Sex
by Simone de Beauvoir
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
Snake Game for Java Code
Problem 1: SnakeGamePanel.javaCreate a public class SnakeGamePanel which is a sub-class of JPanelpublic class SnakeGamePan ...
Snake Game for Java Code
Problem 1: SnakeGamePanel.javaCreate a public class SnakeGamePanel which is a sub-class of JPanelpublic class SnakeGamePanel extends JPanelThis class will implement the Snake game on a JPanel. Here is the basic setup:The screen of the game is 320x320 pixels large. The apple’s size is 20x20 pixels. At the beginning of the game, the snake is also has the size of an apple.The positions of the snake and apple are randomly selected and cannot be the same. Their x and y coordinates have to be multiples of 20 and in the range of [0, 300].Paint your snake red and apple green.The snake does not move at the beginning. As an arrow key is pressed, the snake starts tomove in the direction of the arrow.As the game starts, the snake moves with a constant speed of 20pixels/0.25second. The jump is precisely 20 pixels. Use a Timer with the delay time set to be 250 milliseconds to fire an action event periodically and then update the animation graphics in the action listener.In detail:During the (delay) time between two consecutive animation graphics updates, the player can hit multiple and different arrow keys. Still, the last key will override all previous keys, and you need to use the last key for graphics updates. Write a class DirectionListener that implements the interface KeyListener to keep track of the (final) pressed key during any delay time.private class DirectionListener implements KeyListenerYou only need to implement the method keyPressed() of this interface and leave the implemen- tations of other methods empty. Remember the role of this class is to obtain the direction of the snake. Do not update the snake’s position or call the repaint() method.Write a class MovingListener to implement the interface ActionListener. 1 Figure 1: The snake is moving to the left, before and after eating an apple. After the snake eats an apple, another apple is generated. A sequence is added to the tail of the snake.private class MovingListener implements ActionListenerIn implementing the actionPerformed() method, use the arrow key obtained from the keyPressed() method to update the snake’s position. You need to make sure that the snake cannot reverse its direction. For example, if the snake is moving right and the player presses the left arrow key, the snake does not change its direction. Instead, the left arrow key is ignored, and the snake keeps moving right. One important thing: if no arrow key is pressed, the snake keeps going in the same direction.In the implementation of actionPerformed(), you will need to call repaint() and override the paintComponent(..) method:protected void paintComponent (Graphics g)This method will repaint the panel, as well as the snake and apple.After eating an apple, the snake increases its length by one sequence (a square with the same size as the apple). Add that sequence to the tail of the snake. Then generate a new apple by implementing the method nextApple()private void nextApple ()The apple position should also be random, and cannot be located on the body of the snake.After eating every four apples, the game speed increases: reducing the delay time of the Timer by 20 milliseconds. Let the minimum delay time be 50 milliseconds (highest speed). So there will be 11 levels in this game, corresponding to delay times 250, 230, . . . 70, 50. After reaching level 11, the speed does not change no matter how many more apples the snake eats.Write the method isGameOver() to check whether the game is over: private boolean isGameOver()The game is over when the snake hits itself or hits the panel border. The function will return true if the game is over, and false otherwise. Naturally, you will check whether the game is over before calling the repaint() method. The other way around might be ok but not encouraged since we2can assume the snake is in-compressible.While playing the game, if the space key is hit, the game pauses and a dialog box appears saying “Pause, continue?” with a “OK” button. The game will resume as the space key is pressed again or you click the OK button. The snake will continue to move in the same direction as before the pause.When the game is over, show a dialog box with message “Game Over, New Game?” and an “OK” button. You can use either ConfirmDiaglog or OptionDiaglog. Once the play hits the button, a new game is generated. You might need to implement a method newGame() to set this up.private void newGame ()In this method, you will reset the timer’s delay time, restart the timer, and generate a new snakeas well as a new apple.Create an private inner-class Sequence to store the 2D coordinates of apples and snake’s body. Class Sequence provides a parametric constructorpublic Sequence(int x, int y)The class has two instance variables x and y which are the coordinates of a sequence. You can setthese fields public so you can access them directly. Use ArrayList to store the snake (its sequences):ArrayList <Sequence > snake = new ArrayList <>()You will learn ArrayList in detail soon. ArrayList is similar to vector in C++ where its ele- ments are stored contiguously in memory and you do not need to worry about the change of the array size. The class provides some useful methods such as get(int index), add(Object obj), remove(int index), and size(). You can use these methods for this project.A little bit in detail: a snake is like a FIFO (first in first out) data structure.• When the snake grows by one bit, we push a sequence on top of the stack. When it moves by one square, we push a sequence on top and pop an element off the bottomYou will see that Queue or LinkedList is probably a better data structure for this program. However, ArrayList can access data with a constant time. So there is always a tradeoff among these data structures. You will soon learn how to implement & use LinkedList efficiently, but you do not know it now. ArrayList is good enough for now.3Problem 2: SnakeGame.javaIn this java file, create a static method main()public static void main(String args[])In this method, you will create a JFrame with name “Snake Game.” Add a SnakeGamePanel tothis JFrame, set its size un-resizable.We may take off up to 20% of the total marks for poor style; make sure to name your variablesreasonably, indent properly, and comment sufficiently.
Oakland University DATA SCIENCE FOUNDATION
In your organization, discuss the role of predictive analytics. How does it help? What are some of the issues ...
Oakland University DATA SCIENCE FOUNDATION
In your organization, discuss the role of predictive analytics. How does it help? What are some of the issues and challenges faced in your organization? Would people in your organization be hesitant to make decisions based on predictive analytics? If so, why? (Banking and finance is the organization
part II
Predicting Behavior with Logistic Regression
Customer churn occurs when customers stop doing business with a company. Retaining existing customers is less expensive than it is to acquire new customers and hence, building a good predictive model for customer churn is of importance to many companies. Download the dataset Telco.customer.csv. Through this dataset, we attempt to predict behavior to retain customers using logistic regression.
Follow the steps below and create a PowerPoint presentation.
Using R, partition the dataset into training and testing sets by using the code:
(YOURDATA is the name of your dataset in R.)
intrain- createDataPartition(YOURDATA$Churn,p=0.7,list=FALSE)
set.seed(2017)
training- YOURDATA[intrain,]
testing- YOURDATA[-intrain,]
Fit a logistic regression model by using the code:
glm(Churn ~ .,family=binomial(link="logit"),data=training)
Examine the resulting fitted model. What are the significant factors that affect customer churn? Explain how and why they are significant.
Now, let's examine how the model fits using the following code.
testing$Churn - as.character(testing$Churn)
testing$Churn[testing$Churn=="No"] - "0"
testing$Churn[testing$Churn=="Yes"] - "1"
fitted.results - predict(LogModel,newdata=testing,type='response')
fitted.results - ifelse(fitted.results 0.5,1,0)
misClasificError - mean(fitted.results != testing$Churn)
print(paste('Logistic Regression Accuracy',1-misClasificError))
This provides the accuracy of the model.
How can you make a customer churn prediction from the model you fitted? Explain. include the actual calculation.
BME 301 Penn State College MATLAB Coding Questions Response
i will upload the question and and the differential equation. also i will give a memo of it
BME 301 Penn State College MATLAB Coding Questions Response
i will upload the question and and the differential equation. also i will give a memo of it
ITS3105 SUS Programming Automation through Technology Discussion
Fifty or sixty years ago, most people's paychecks were produced by hand; now it is most likely that yours is produced by a ...
ITS3105 SUS Programming Automation through Technology Discussion
Fifty or sixty years ago, most people's paychecks were produced by hand; now it is most likely that yours is produced by a computer or not printed at all but deposited into an account electronically. Forty years ago, most grocery store checkers keyed item prices into the cash register; now it is most likely your items are scanned. Police officers used to direct traffic at many major urban intersections; now the traffic flow is often computer controlled. Are there any tasks now that are mostly done by people that you think would be better handled by a computer? Are there any tasks you hope never become computerized?
On a separate document answer these Learning Journal questions (a minimum of 250 words):
Use the following questions as guides to self-reflection during this week:
Briefly describe what programming you did this week.
Describe any problems you have had and how you solved your problems.
What skills and knowledge do you recognize that you are gaining, and how will these skills and knowledge be useful in school and as a professional after school?
Applied system analysis II Question 2
Course Project Part 2—Architecture Detail
Continuing with the course project you started in Week 1, this week, you will ...
Applied system analysis II Question 2
Course Project Part 2—Architecture Detail
Continuing with the course project you started in Week 1, this week, you will continue working on the solution you have envisioned so far. The work that will be added this week will increment the information you have produced so far, complementing it in a coherent manner.
Tasks
This week, you will design the architecture for the project.
Using the Microsoft Word document created in W1 Assignment 3, add to it by completing the following tasks:
Discuss in detail, using diagrams to support your words, how the architecture is to be used in the system.
Address operational, performance, security, cultural, and political requirements for the project.
Present three possible interface and navigation design concepts.
Earn money selling
your Study Documents