/images/avatar.jpeg

I help your business extract value from data.

How to Manage x Axis in D3.js?

You want to know how to display x axis in D3.js? In this article, I will show you how to do it properly using the axisBottom function. D3 allows us to simply link axis with scales. First we need to define an svg canvas as usual, let’s do it. 1 2 3 4 const svg = d3.select(#canvas).append("svg").attr("width", 400).attr("height", 500) const g = svg.append("g") .attr("transform", `translate(100, 10)`) As you can see, we added a g object to allow us to display several values on the x axis.

How to Predict Breast Cancer Tumor with K-Nearest Neighbors? [Part 1]

For Breast Cancer Awareness month, I decided to document a Python script that I have produced in August. This can predict breast tumors from a cell’s characteristics. You can do it by yourself following this article. Do not hesitate to ask me your questions in the DM. This article is about data cleaning and exploration. Data are available on Kaggle here: https://www.kaggle.com/c/breast-cancer/data. Imports First, we need to import some libraries:

How to Predict Breast Cancer Tumor with K-Nearest Neighbors? [Part 2]

Welcome to the part 2 of this article. We will talk about some technical stuff on KNeighborClassifier from the library Scikit-Learn. Remember, last time we cleaned the data and did some exploration. We discovered that the attribute “mitosis” have a strong correlation on the “class” attribute. First of all, we define X as the data without the class column and y as the attribute to predict (i.e. the class column).

How to Use Selections and Data Joins in D3.js?

Suppose that you want to display several shapes aligned regarding to a list of data that defines the position of these shapes. In this post we will see how to use selections and data joins in D3 to display aligned circles using specific data. You should know how circles work in D3 before reading this article (see: https://www.datackling.com/post/how-to-draw-a-circle-in-d3-js ). Introduction For the example we use this list of data: const data = [40, 30, 20, 10, 20, 30, 40]

How to Use Transitions in D3.js?

Hello! In a previous post we have seen how to make your bar chart dynamic. Today, I will show you how to use transitions in your visualizations to smooth out your updates. Basically, to add transitions to our code, we just need to use d3.transition() just before setting the attributes of our shapes. For instance, if we take the bar chart that we used in previous posts, it should looks like this: