Categories
Mastering Development

GGplot2 – line thickness as a legend

I would really appreciate it if anyone can help me use the thickness of the lines as a legend. Thin line = low correlation Think line = High correlation I tried using the size of the dots to show the thickness but it confuses the audience even further. I am open to other creative methods […]

Categories
Development

Deserialize JSON Object to C# Object Mapping

I have a JSON object returned from API with the below format: { “responseStatus”: “SUCCESS”, “responseDetails”: { “limit”: 1000, “offset”: 0, “size”: 2, “total”: 2 }, “data”: [ { “tbl.col”: “data” }, { “tbl.col”: “data” } ] } I need to map the above JSON object “data” to a class or to generic type list

Categories
Development

how can I write this nesting code probably?

Social_class <- ifelse(test = so_cla==(“Lw”), yes = sample(x = c(“LwL”,”LwR”), size = 2, prob = c(0.64,0.36)), ifelse(test = so_cla==(“Uw”), yes = sample(x = c(“UwL”,”UwR”), size = 2, prob = c(0.64,0.36)), ifelse(test = so_cla==(“Lm”), yes = sample(x = c(“LmL”,”LmR”), size = 2, prob = c(0.49,0.51)), ifelse(test = so_cla==(“Um”) , yes = sample(x = c(“UmL”,”UmR”), size = […]

Categories
Development

R – stat_compare_means return differnt value from Kruskal-Wallis test

I want to plot the p value of Kruskal-Wallis test to my ggplot using the R function stat_compare_means from the package ggpubr. However, the plotted value is different from the value if I simply run the function: kruskal.test(value ~ type, data = Profile_melt) my code to plot the p value is: ggplot(Profile_melt, aes(type, value)) + […]

Categories
Development

Elasticsearch not returning result with same token?

Data inserted in ElasticSearch is in korean so I cannot present exact case but let’s say i have a word ABBCC that has been tokenized as [“A”,”BBCC”] and another word AZZXXXtokenized as [“A”,”ZZXXX”]. if i search ABBCC, then shouldn’t AZZXXX come up since they have same token? or is this not how elasticsearch work? this […]

Categories
Development

visualization clusterization results

After using k-means i have 3 clusters. I’ve used 10 features (marks) in k-means for this data set. I’m understand that we can’t draw 10D chart, but how can i visualize this clusters? Should i separate data by 2 or 3 features instead 10? What axises should i use in my case? For drawing i’m […]

Categories
Development

Different output of two “same” padding CNN models in pytorch

When I realized PRnet(script1), The effect is very poor. So I compared the architecture of my model with that of a correct model(script3). I found the tensor xm(in script1.forward function) is the same as the xm(in script3.forward function). But the xn in script1 is different from script3. note: 1:The self.decoder in script1 is copied form […]

Categories
Development

How to use GGanimate to animate between a list of data frames?

I’m trying to graph spend and profitability data for a set of ads on a daily basis over time. For a given date range, I loop through the range and create a date frame. Each of these tables are appended to a list as separate data frames. Here is some sample code: l <- list() […]

Categories
Development

How to filter by field a top_hits aggregation

I am facing some problems to create my query on a very big index of 600M documents. I’m close to resolve it however I got stuck. The type of documents I have is the following: { “first_name” : “John”, “last_name” : “Doe”, “company_domain” : “google”, “provider_a_id” : “1234”, “provider_b_id” : “14” } I need to […]

Categories
Development

Use of datetime timedelta with numpy 3d array

I have a 3D array with the count of number of days past a benchmark date (e.g., 01.01.2000). I am interested in the actual day-of-year (DOY: 1-365/366)rather than the total number of days past a given date. For a single value, the below syntax works. For e.g., import numpy as np import datetime data = […]