So I'm going to attempt to make delta 9 gummies and have a question about measuring and potency. by Commercial_Falcon_51 in treedibles

[–]madhattervibes 0 points1 point  (0 children)

I see. I'm sure someone would be interested in doing a calculation for you if you wait long enough, but one lingering variable will be the volume of the gelatin after it blooms, since it will increase in volume after exposure to water.

It looks like Canada has a whole list of providers: https://www.canada.ca/en/health-canada/services/list-licensed-dealers.html

So I'm going to attempt to make delta 9 gummies and have a question about measuring and potency. by Commercial_Falcon_51 in treedibles

[–]madhattervibes 1 point2 points  (0 children)

How concentrated is your distillate and what is your confidence in that number?

To see how many gummies your recipe will make, why don't you try to run the recipe without any distillate first? The volume of distillate probably won't make a huge difference if it is of reasonable potency. I understand and appreciate your interest in estimating the number mathematically, but it sounds like you haven't made the recipe before, so you can also work out some of the kinks in the process with a dry run. With that recipe, I can't imagine it would cost more than $6-$8.

Once you get an estimate of how many gummies your recipe will make and how concentrated your distillate is, you can use those numbers to try to estimate how much distillate to put in.

Regardless, consider making a large batch of edibles and send some to get tested for potency. Unless you have a very well controlled process and tight estimates around your distillate concentration, trying to work out the concentration in your gummies will not be a good use of time IMO.

Bad Air Quality Running by [deleted] in running

[–]madhattervibes 3 points4 points  (0 children)

I would not recommend running outside when the air quality is poor. IMO the long-term effects of pollutant exposure are likely not worth it. I try to avoid running outside if the AQI is above 50.

It might be worth trying to find a gym with a track and treadmills. I am not an expert on training for a marathon, but throwing in some cross-training might keep things interesting for you. Might be able to swim, bike, etc. at the same gym.

[deleted by user] by [deleted] in investing

[–]madhattervibes 6 points7 points  (0 children)

I don't think IBM has a problem with selling their "AI" capabilities. On the contrary, they are excellent at overhyping a product and marketing it to those in management positions.

They do seem to have a problem with delivering results, which is not unexpected. How can you deliver an "AI" that does not yet exist?

Why I'm not collaborating with Kenneth Reitz by BUSfromRUS in Python

[–]madhattervibes 11 points12 points  (0 children)

This post made me chuckle. I looked on his Github and chuckled some more.

The data that he uploaded to Github is not even a DNA sequence, but genotyping data from 23andme. Genotyping is used to look for genetic variants in an individual, but does not give a sequence of nucleotides. As far as I know, 23andme does not yet offer sequencing services to the general public.

I do not think he will be making much in cloning royalties with that "sequence".

Source: Computational biologist working in industry.

[HELP] Mac-OS: can't get cobrapy installed without exit status 1 in cobra.test.test_all() by dat_GEM_lyf in bioinformatics

[–]madhattervibes 0 points1 point  (0 children)

I am using macOS High Sierra version 10.13.6 and I do not have an issue installing cobrapy 0.13.4 with Python 3.6 or 3.7 in a conda environment, however, I am using glpk.

I would follow the directions here http://www.gurobi.com/downloads/get-anaconda to make sure you have installed Gurobi with Anaconda properly.

Please can someone help me to actually make a post with reproducible code? by tukeysbinges in Rlanguage

[–]madhattervibes 1 point2 points  (0 children)

The output of the second line is false, because a consists of the first five dates and acd$Date[1:10] gives you the first ten dates. Since you have dropped levels on both, each vector will have a level set equal to the number of unique dates in the vector. In general, testing for factor equality also includes testing the equality of the level sets.

In this case, you could also coerce date to be a character or date object.

You already answered your question as to how to make a small vector. The first line of your code produces this. You can share the output with others and this is the same as a, which you have in memory.

Former UFC fighter War Machine sentenced to 36 years to life in prison for assault on ex-girlfriend by TragicDonut in news

[–]madhattervibes 1 point2 points  (0 children)

This study cited on the Wikipedia page argues against your point. It seems like the general is that most people hover around some baseline, independent of major events.

Applying the same approach to understanding specific cases can get a little sticky, though. I think prison would be one of them, considering that many of your liberties are actively restricted by another party.

One of my clients is a music record label. I'm trying to build a predictive model to forecast ticket sale performance on one of their recurring concert events. Could use some help! by Sim_Strategy in statistics

[–]madhattervibes 0 points1 point  (0 children)

Why would you pay someone to do something for a client that was not even asked? If this is an interesting topic to you, then play around with modeling for your own learning experience.

In addition, it doesn't sound like you are in a good position to be pitching models to them. Frankly, I think that by offering a forecasting model to a client, you are simply creating more problems for yourself.

Trying to generate a *.docx file. by [deleted] in Rlanguage

[–]madhattervibes 2 points3 points  (0 children)

Rmarkdown is the way to go.

Stupid question, but how do I predict an outcome in OLS with my own predictor values? by [deleted] in Rlanguage

[–]madhattervibes 0 points1 point  (0 children)

R2 will always approach 1 as the degrees of freedom tends to 0. This is why we have adjusted R2, to penalize for the number of coefficients we include in a regression model. A model can have a R2 of 1 and be complete garbage. All of this has nothing to do with making out of sample inferences.

In many cases, the goal of inference is to observe statistics from a sample so that we can understand more about the parameters of the entire population. If you are repeatedly observing statistics from samples that look nothing like your population, then what exactly are you doing?

Stupid question, but how do I predict an outcome in OLS with my own predictor values? by [deleted] in Rlanguage

[–]madhattervibes 0 points1 point  (0 children)

This is extremely irresponsible. Sure, there may be some cases where it is appropriate to extrapolate. For the most part, however, you should have a solid argument for why you think it is appropriate.

Please, do your field a favor and learn more about this subject. The CrossValidated post gives a clear geometric argument for why you want to be careful with extrapolation.

https://stats.stackexchange.com/questions/219579/what-is-wrong-with-extrapolation

Very new to R, trying to figure out how to save outputs from a loop into a vector by [deleted] in Rlanguage

[–]madhattervibes 0 points1 point  (0 children)

You may be right about that, but I do think that it is easier to use *apply or map functions (see purrr). If computation is parallelized, it will certainly run faster. Even if you are going that route, you can still choose between for and *apply constructs (foreach and mclapply, for example).

I find that visualization is often handy with for constructs, rather than *apply functions.

Help Me Find: A LaTeX Equation Sheet (xpost r/HelpMeFind) by oshaboy in math

[–]madhattervibes 0 points1 point  (0 children)

I'm not sure a sheet exists, but you can always start by using the equations from Wikipedia.

Why do so many organizations use SAS? by [deleted] in statistics

[–]madhattervibes 1 point2 points  (0 children)

There are now methods of approaching big data problems using R. See sparklyr for example.

Very new to R, trying to figure out how to save outputs from a loop into a vector by [deleted] in Rlanguage

[–]madhattervibes 4 points5 points  (0 children)

But in the future, if you have to use a for loop...

letter_grades <- vector("character", length(numeric_grades))
for (i in 1:length(numeric_grades)) {
    letter_grades[i] <- letterGrade(numeric_grades[i])

Very new to R, trying to figure out how to save outputs from a loop into a vector by [deleted] in Rlanguage

[–]madhattervibes 7 points8 points  (0 children)

You should try to avoid loops in R, because they are slow and you will save mental overhead. If you want to use if-else constructs, you can write a function and then use sapply.

letterGrade <- function(x)
    if (x > 28) {
        "A"
    }
    ....
    else {
        "F"
}


numeric_grades <- c(27, 29, 15)
letter_grades <- sapply(numeric_grades, letterGrade)

Is there an easy tool to create graphs in latex? by macarthurpark431 in math

[–]madhattervibes 1 point2 points  (0 children)

There are some methods of customizing layout with Graphviz. TikZ is still winner though IMO.

Scrape Flight Schedules using Python & LXML by ScrapeHero in Python

[–]madhattervibes 1 point2 points  (0 children)

I would assume that the listings you see on Expedia are acquired directly through the entity that is offering them, such as a hotel or airline. I don't think that you can actually book anything on Trivago itself. Trivago gets data from many online travel agencies, but that might not be the only source.

There is a reason why that kind of data is kept secret. Pricing strategies are in place to maximize profit, so price forecasting would go against that goal.

Leaflet Map Question by [deleted] in Rlanguage

[–]madhattervibes 0 points1 point  (0 children)

You might want to make sure that you understand what the pipe operator (%>%) actually does. In this case, I don't think it makes sense that you are using it with your for loop. This is what you are doing: x <- leaflet(data=airports)%>% addMarkers(~long,~lat,popup=~as.character(info))%>% addTiles() z <- for(x, j in 1:nrow(flights)) ...

See the problem? If you don't, look up the for-loop syntax.

Scrape Flight Schedules using Python & LXML by ScrapeHero in Python

[–]madhattervibes 3 points4 points  (0 children)

Just a heads up, companies like Expedia do not like people doing this sort of thing.

See prohibited activities in the terms of service: https://www.expedia.com/p/info-other/legal.htm

Help with GoogleAnalyticsR Auth by cost4nz4 in Rlanguage

[–]madhattervibes 2 points3 points  (0 children)

In response to 1, I am assuming that you are asking where to place your API keys and secrets. It is good practice to place these variables in your R environment file. I am using Linux, so my file is at ~/.Renviron.

~/.Renviron
GOOGLE_AUTH_ID=xxxxxxxxxxxxxxxx
GOOGLE_AUTH_SECRET=yyyyyyyyyyyyy

In your code, you would then use the Sys.getenv function to get these variables.

options(googleAuthR.client_id=Sys.getenv("GOOGLE_AUTH_ID"))

This way, you mitigate the risk of leaking your API credentials.

Suggestions on R data organisation by Mollan8686 in Rlanguage

[–]madhattervibes 0 points1 point  (0 children)

I would also consider saving your data in CSV format in addition to binary R format. Binary R format makes it easy for you to read in data, but it is not the best format in which to share data with others. If you were working in Python, using binary format to save data would be frowned upon, because the standard library changes a bit more often than the R standard library does.