Skip to content

Commit

Permalink
Add OrderedFactor in the README.md example. Multiclass example is alr… (
Browse files Browse the repository at this point in the history
#6)

* Add OrderedFactor in the README.md example. Multiclass example is already included.

* Update README.md example.
  • Loading branch information
mrr00b00t authored Oct 5, 2021
1 parent 43eacfc commit c1afce2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ using TableDistances
using ScientificTypes

# create an heterogeneous table
table = (a=1:5, b=rand(5), c=[:A,:B,:C])
table = (a=1:3, b=rand(3), c=["A", "B", "C"], d=[1, 2, 4])
(a = 1:3, b = [0.7596581938450753, 0.6952806574889876, 0.6669145844749085], c = ["A", "B", "C"], d = [1, 2, 4])

# adjust the scientific types
t = coerce(table, :a => Count, :b => Continuous, :c => Multiclass)
t = coerce(table, :a => Count, :b => Continuous, :c => Multiclass, :d => OrderedFactor)
(a = 1:3, b = [0.7596581938450753, 0.6952806574889876, 0.6669145844749085], c = CategoricalArrays.CategoricalValue{String, UInt32}["A", "B", "C"], d = CategoricalArrays.CategoricalValue{Int64, UInt32}[1, 2, 4])

# compute the pairwise distance between rows
D = pairwise(TableDistance(), t)
3×3 Matrix{Float64}:
0.0 1.09707 1.75
1.09707 0.0 0.902927
1.75 0.902927 0.0
```

Default distances from various packages such as
Expand Down

2 comments on commit c1afce2

@juliohm
Copy link
Member

@juliohm juliohm commented on c1afce2 Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/46167

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" c1afce2fcf4dd196d277b3ee5c98f215d9fe76ad
git push origin v0.1.0

Please sign in to comment.