程序代写 To solve problems in this homework, you should use Rust. Your solution to t

To solve problems in this homework, you should use Rust. Your solution to the homework
should consist of a zip file containing
a compilable Rust source file (.rs) solving Question 1,
a report (the pdf format is recommended) that answers sub-questions denoted by

Copyright By PowCoder代写 加微信 powcoder

“Report” below.
(40 points) Input: Your program should read a set of points in R with labels from data.txt
(you will create file data.txt). Each line of data.txt describes one point. More specifically,
the i-th line consists of two numbers x, and z, where x, is an integer s.t. |x/ s100,000,000
and z, E /0, 1). x, is the coordinate of the point and z, is its label. Make sure your file
contains at least 100 points randomly distributed in the allowed space with labels
assigned to each point in a random fashion as well.
Your task: Write a program that reads the data and determines a decision tree with at
most two leaves that performs best at predicting z, based on x, on this set of points. The
program should output the decision tree and its accuracy on the input data set (no need
to split on a training and testing set though you are welcome to do so if you want).
Report: Explain why your solution works and what complexity it has as a function of the
number of points (denote this quantity by n).
Sample input and output: For the following data. txt:
the following output is a correct solution:
if x >= 10
accuracy: 0.75
Hint: You do not need to implement the whole gini logic here. Your input is
1-dimensional so you need to find a split point that minimizes error.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com