lhz1029 / faker Goto Github PK
View Code? Open in Web Editor NEWAn R package to generate fake data given an existing dataset
An R package to generate fake data given an existing dataset
I saw that fakeR isn't on CRAN any longer, but I feel like it deserves to be.
Would you be interested in getting it past the CRAN checks? If not, I'd be happy to help.
Thanks
Steve
The following command returns 150 rows (like the original iris dataset) and not 10 as indicated.
nrow(fakeR::simulate_dataset(iris, n = 10))
However, when the Species, the categorical variable, is removed, it works fine.
nrow(fakeR::simulate_dataset(iris[,-5], n = 10))
I believe, the problem occurs in this bit of the simulate_dataset
function:
if (unorder > 0) {
print("Some unordered factors...")
fake_categorical <- .simulate_categorical(dataset, location, row)
}
My original dataset has columns which are not normally distributed but, when I simulate them, the fake data is normally distributed. Is there a way to simulate the data but keep the original distribution? Cheers!
When you try to simulate a dataset with an ordered factor and stealth.level=1 it throws an error that there is a non-numeric argument to binary operator
> df<-mtcars
> df$carb<-as.factor(df$carb)
> df$gear<-factor(df$gear,ordered=TRUE)
> sim_df<-simulate_dataset(dataset = df,stealth.level = 1)
[1] "Some unordered factors..."
[1] "Some numeric variables and ordered factors..."
Error in n * ncol(sigma) : non-numeric argument to binary operator
Instead of simulating the dataset and "taking into account the covariances between the numeric and ordered factors"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.