# Some beginners questions

**URL:** <https://discourse.julialang.org/t/some-beginners-questions/32982>\
**Category:** New to Julia\
**Created:** [January 4, 2020, 10:43pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982 "2020-01-04T22:43:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![flip101](https://avatars.discourse-cdn.com/v4/letter/f/9dc877/32.png) [@flip101](https://discourse.julialang.org/u/flip101)\
**Post date:** [January 4, 2020, 10:43pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/1 "2020-01-04T22:43:42Z")

</div>

Hello i’m new to Julia. I have a couple of questions.

1. Is there a command to start a new project like `cargo init` (rust). So that it generates some files (Project.toml maybe?). If there is no such command maybe there is a template/skeleton i can use

2. I would like to do logistic regression. In python there are a few packages that are often discussed and the go-to packages for most situations like pandas and scikit. Are there also such packages in julia? I’m not sure what i should be using.

Thanks for the help 🙂

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 4, 2020, 10:46pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/2 "2020-01-04T22:46:54Z")

</div>

Welcome!

1. [Latest Version of “How to create packages”](https://julialang.github.io/Pkg.jl/dev/creating-packages/)
2. Maybe you find something here:  
[Anyone developing multinomial logistic regression?](https://discourse.julialang.org/t/anyone-developing-multinomial-logistic-regression/23222)

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 4, 2020, 10:59pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/3 "2020-01-04T22:59:22Z")

</div>

Its recommended (even by the latest version of the Pkg docs) to use [PkgTemplates](https://github.com/invenia/PkgTemplates.jl/tree/v0.6.3) to create your new project, rather than the minimal built in `pkg> generate ` command.  
Because that will setup all the good things like the files required for CI and docs for you.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 5, 2020, 10:57am UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/4 "2020-01-05T10:57:57Z")

</div>

Edited 1.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 5, 2020, 11:01am UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/5 "2020-01-05T11:01:31Z")

</div>

From [GitHub - JuliaCI/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/invenia/PkgTemplates.jl)

> # NOTICE: This version is not yet released
> 
> The current stable release is 0.6, you can find that version [here](https://github.com/invenia/PkgTemplates.jl/tree/v0.6.3).  
> PkgTemplates has undergone large internal changes (see [#61](https://github.com/invenia/PkgTemplates.jl/pull/61) especially), and at present the user-facing API is still catching up.  
> Do not fear, while right now it looks very different (e.g. in the `dev` docs), it will not be _incredibly_ breaking. But right now if you do use master it will be.

I am not sure if this should be a first step for a newcomer.  
Anyways he/she can now decide on his/her own.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 5, 2020, 12:32pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/6 "2020-01-05T12:32:40Z")

</div>

There is also

> **[GitHub - tpapp/PkgSkeleton.jl: Generate Julia package skeletons using a...](https://github.com/tpapp/PkgSkeleton.jl)**
>
> Generate Julia package skeletons using a simple template system - GitHub - tpapp/PkgSkeleton.jl: Generate Julia package skeletons using a simple template system

which is considerably simpler (and of course not as flexible).

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 5, 2020, 1:23pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/7 "2020-01-05T13:23:18Z")

</div>

Note that I linked to: [https://github.com/invenia/PkgTemplates.jl/tree/v0.6.3](https://github.com/invenia/PkgTemplates.jl/tree/v0.6.3)  
the tagged release **v0.6.3.**  
For exactly that reason. 🙂

---

<div class="post-metadata">

**Author:** ![Zach\_Christensen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zach_christensen/32/7220_2.png) [@Zach\_Christensen](https://discourse.julialang.org/u/Zach_Christensen)\
**Post date:** [January 5, 2020, 1:33pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/8 "2020-01-05T13:33:30Z")

</div>

Do people have default stuff in their start up for PkgTemplates/PkgSkeleton so they don’t have to put in all the fields everytime? I create a lot of packages locally when I get an idea in a really boring meeting but then I have to go back and build up the package properly. I have a lot of really boring meetings so this is a frequent problem.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 5, 2020, 1:51pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/9 "2020-01-05T13:51:25Z")

</div>

I am not sure I fully understand the question — PkgSkeleton just needs a path, and it will infer everything else from the environment. Actually, making things customizable is an [outstanding feature request](https://github.com/tpapp/PkgSkeleton.jl/pull/12) 😉

(personally, I do isometric exercises during meetings).

---

<div class="post-metadata">

**Author:** ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Post date:** [January 5, 2020, 2:31pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/10 "2020-01-05T14:31:48Z")

</div>

This is more of a question to those who responded than it is to the OP, but what about simply calling `activate .` from the package REPL? I still use this when I’m just creating a new folder for tinkering around.

For the OP, this is done by pressing the `]` key in the REPL. You should then see a prompt that looks like this `(v1.3) pkg>`. From there, you would type `activate .` and you’ll end up with both a Project.toml and Manifest.toml.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 5, 2020, 2:43pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/11 "2020-01-05T14:43:01Z")

</div>

> [@mthelm85](#):
>
> what about simply calling `activate .` from the package REPL?

This _per se_ will not create a `Project.toml` file (at least when I test in 1.3, 1.4).

Also, even though a `Project.toml` will be generated once you `add` packages, template generators take care of a lot of other things, including recommended configurations for CI, coverage, documentation setup and deployment, etc.

You can do all of this yourself, but there is little point in that, as it can be fully automated.

---

<div class="post-metadata">

**Author:** ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Post date:** [January 5, 2020, 2:47pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/12 "2020-01-05T14:47:57Z")

</div>

> This _per se_ will not create a `Project.toml` file (at least when I test in 1.3, 1.4).

You’re right @tamas_papp, I just realized you don’t get the Project.toml until _after_ you’ve added packages. Nonetheless, I think it could still be a decent option for a first-timer and for creating a new project that you may not intend to do anything with (other than experiment/learn).

Using PkgTemplates and similar options is actually something I avoided for a little while when I was first starting out because it just seemed a little bit intimidating. Once you do it, of course, you realize it’s no big deal so there’s really no reason not to go ahead and get in the habit from the start.

That being said, I think there is something worth exploring here for Julia. The OP mentions calling `cargo init` in Rust and for me, my first language being JavaScript/Node.js, calling `npm init` from the terminal was always the first thing I did when starting a new project. It doesn’t seem that there is an equivalent in Julia (maybe there shouldn’t be, I don’t know enough to decide).

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 5, 2020, 3:33pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/13 "2020-01-05T15:33:29Z")

</div>

> [@mthelm85](#):
>
> That being said, I think there is something worth exploring here for Julia.

I am not sure if you are aware of [`pkg> generate`](https://julialang.github.io/Pkg.jl/dev/creating-packages/)?

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 5, 2020, 6:01pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/14 "2020-01-05T18:01:51Z")

</div>

> [@Zach\_Christensen](#):
>
> Do people have default stuff in their start up for PkgTemplates/PkgSkeleton so they don’t have to put in all the fields everytime? I

I used to keep them in a unsaved tab in sublime text. Then one day I closed it and lost them 😂  
For Invenia’s official ones, we have a small julia package which basically just defines them as constants, for different use cases.  
I think bigger Github orgs like JuliaDiff should do the same thing.

* * *

I think it would be cool to have a `PackageTemplatesCookBook` repo,  
where people just dump their templates,  
and then can steal ideas from each other.

---

<div class="post-metadata">

**Author:** ![ElOceanografo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eloceanografo/32/624_2.png) [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Post date:** [January 6, 2020, 5:05pm UTC](https://discourse.julialang.org/t/some-beginners-questions/32982/15 "2020-01-06T17:05:23Z")

</div>

For logistic regression, the easiest approach is probably to use the GLM (Generalized Linear Models) package:

```julia
using DataFrames, GLM
data = DataFrame(X=[1,2,2], Y=[1,0,1])
logit = glm(@formula(Y ~ X), data, Binomial()) # uses logit link function by default

```

Docs for GLM: [https://juliastats.org/GLM.jl/stable/manual/](https://juliastats.org/GLM.jl/stable/manual/)
