Skip to content

Commit

Permalink
add to ScientificTypes name change
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Jun 30, 2021
1 parent c75b7a7 commit 8ad0a55
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 38 deletions.
8 changes: 4 additions & 4 deletions ORGANIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ its conventional use, are marked with a ⟂ symbol:
evaluating and tuning machine learning models. It pulls in most code
from other repositories described below. MLJ also hosts the [MLJ
manual](src/docs) which documents functionality across the
repositories, with the exception of ScientificTypes, and
repositories, with the exception of ScientificTypesBase, and
MLJScientific types which host their own documentation. (The MLJ
manual and MLJTutorials do provide overviews of scientific types.)

* [MLJModelInterface.jl](https://github.com/alan-turing-institute/MLJModelInterface.jl)
is a lightweight package imported by packages implementing
MLJ's interface for their machine learning models. It's *sole*
dependency is ScientificTypes, which is a tiny package with *no*
dependency is ScientificTypesBase, which is a tiny package with *no*
dependencies.

* (⟂)
Expand Down Expand Up @@ -77,15 +77,15 @@ its conventional use, are marked with a ⟂ symbol:
[Flux.jl](https://github.com/FluxML/Flux.jl), in MLJ.

* (⟂)
[ScientificTypes.jl](https://github.com/alan-turing-institute/ScientificTypes.jl)
[ScientificTypesBase.jl](https://github.com/alan-turing-institute/ScientificTypesBase.jl)
is an ultra lightweight package providing "scientific" types,
such as `Continuous`, `OrderedFactor`, `Image` and `Table`. It's
purpose is to formalize conventions around the scientific
interpretation of ordinary machine types, such as `Float32` and
`DataFrame`.

* (⟂)
[MLJScientificTypes.jl](https://github.com/alan-turing-institute/MLJScientificTypes.jl)
[ScientificTypes.jl](https://github.com/alan-turing-institute/ScientificTypes.jl)
articulates MLJ's own convention for the scientific interpretation of
data.

Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ MLJEnsembles = "50ed68f4-41fd-4504-931a-ed422449fee0"
MLJIteration = "614be32b-d00c-4edb-bd02-1eb411ab5e55"
MLJModels = "d491faf4-2d78-11e9-2867-c94bc002c0b7"
MLJOpenML = "cbea4545-8c96-4583-ad3a-44078d60d369"
MLJScientificTypes = "2e2323e0-db8b-457b-ae0d-bdfb3bc63afd"
MLJSerialization = "17bed46d-0ab5-4cd4-b792-a5c4b8547c6d"
MLJTuning = "03970b2e-30c4-11ea-3135-d1576263f10f"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Expand All @@ -33,10 +33,10 @@ MLJEnsembles = "0.1"
MLJIteration = "0.3"
MLJModels = "0.14"
MLJOpenML = "1"
MLJScientificTypes = "0.4.1"
MLJSerialization = "1.1"
MLJTuning = "0.6"
ProgressMeter = "1.1"
ScientificTypes = "2"
StatsBase = "0.32,0.33"
Tables = "0.2,1.0"
julia = "1.3"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ illustrated in the dependency chart below.
<a href="https://github.com/JuliaAI/MLJSerialization.jl">MLJSerialization</a>
</br>
<br>
<a href="https://github.com/JuliaAI/MLJScientificTypes.jl">MLJScientificTypes</a> &nbsp;&nbsp;
<a href="https://github.com/JuliaAI/ScientificTypes.jl">ScientificTypes</a>
<a href="https://github.com/JuliaAI/ScientificTypes.jl">ScientificTypes</a> &nbsp;&nbsp;
<a href="https://github.com/JuliaAI/ScientificTypesBase.jl">ScientificTypesBase</a>
</p>
<p></p>
<br>
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ list](https://github.com/alan-turing-institute/MLJ.jl/issues/673).

- [x] POC for implementation of time series models classification
[#303](https://github.com/alan-turing-institute/MLJ.jl/issues/303),
[ScientificTypes #14](https://github.com/alan-turing-institute/ScientificTypes.jl/issues/14) POC is [here](https://github.com/alan-turing-institute/TimeSeriesClassification.jl)
[ScientificTypesBase #14](https://github.com/alan-turing-institute/ScientificTypesBase.jl/issues/14) POC is [here](https://github.com/alan-turing-institute/TimeSeriesClassification.jl)

- [ ] POC for time series forecasting, along lines of sktime; probably needs [MLJBase
#502](https://github.com/alan-turing-institute/MLJBase.jl/issues/502)
Expand All @@ -178,7 +178,7 @@ list](https://github.com/alan-turing-institute/MLJ.jl/issues/673).
- [x] missing value imputation using Gaussina Mixture Model. Done,
via addition of BetaML model, `MissingImputator`.

- [ ] improve `autotype` method (from MLJScientificTypes), perhaps by
- [ ] improve `autotype` method (from ScientificTypes), perhaps by
training on large collection of datasets with manually labelled
scitype schema.

Expand Down
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import MLJTuning
import MLJModels
import MLJEnsembles
import MLJOpenML
import MLJScientificTypes
import MLJModelInterface
import ScientificTypes
import MLJModelInterface
import ScientificTypesBase
import Distributions
using CategoricalArrays # avoid types like CategoricalArrays.Categorica
using LossFunctions
Expand Down Expand Up @@ -74,9 +74,9 @@ makedocs(
MLJTuning,
MLJModels,
MLJEnsembles,
MLJScientificTypes,
MLJModelInterface,
ScientificTypes,
MLJModelInterface,
ScientificTypesBase,
MLJIteration,
MLJSerialization,
MLJOpenML,
Expand Down
4 changes: 2 additions & 2 deletions docs/src/adding_models_for_general_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It is assumed the reader has read [Getting Started](index.md).
To implement the API described here, some familiarity with the
following packages is also helpful:

- [MLJScientificTypes.jl](https://github.com/alan-turing-institute/MLJScientificTypes.jl)
- [ScientificTypes.jl](https://github.com/alan-turing-institute/ScientificTypes.jl)
(for specifying model requirements of data)

- [Distributions.jl](https://github.com/JuliaStats/Distributions.jl)
Expand Down Expand Up @@ -672,7 +672,7 @@ attempt to use your model with inappropriately typed data.

The trait functions `input_scitype` and `target_scitype` take
scientific data types as values. We assume here familiarity with
[MLJScientificTypes.jl](https://github.com/alan-turing-institute/MLJScientificTypes.jl)
[ScientificTypes.jl](https://github.com/alan-turing-institute/ScientificTypes.jl)
(see [Getting Started](index.md) for the basics).

For example, to ensure that the `X` presented to the
Expand Down
12 changes: 6 additions & 6 deletions docs/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ as `Array{Float32, 2}`). Similar remarks apply to the input `X` of an
unsupervised model.

Scientific types are julia types defined in the package
[ScientificTypes.jl](https://github.com/alan-turing-institute/ScientificTypes.jl);
[ScientificTypesBase.jl](https://github.com/alan-turing-institute/ScientificTypesBase.jl);
the package
[MLJScientificTypes.jl](https://alan-turing-institute.github.io/MLJScientificTypes.jl/dev/)
[ScientificTypes.jl](https://alan-turing-institute.github.io/ScientificTypes.jl/dev/)
implements the particular convention used in the MLJ universe for
assigning a specific scientific type (interpretation) to each julia
object (see the `scitype` examples below).
Expand All @@ -286,7 +286,7 @@ The basic "scalar" scientific types are `Continuous`, `Multiclass{N}`,
scientific types](@ref) below to guarantee your scalar data is interpreted
correctly. Tools exist to coerce the data to have the appropriate
scientfic type; see
[MLJScientificTypes.jl](https://alan-turing-institute.github.io/MLJScientificTypes.jl/dev/)
[ScientificTypes.jl](https://alan-turing-institute.github.io/ScientificTypes.jl/dev/)
or run `?coerce` for details.

Additionally, most data containers - such as tuples, vectors, matrices
Expand All @@ -296,7 +296,7 @@ and tables - have a scientific type.
![](img/scitypes.png)

*Figure 1. Part of the scientific type hierarchy in*
[ScientificTypes.jl](https://alan-turing-institute.github.io/MLJScientificTypes.jl/dev/).
[ScientificTypesBase.jl](https://alan-turing-institute.github.io/ScientificTypes.jl/dev/).

```@repl doda
scitype(4.6)
Expand Down Expand Up @@ -389,7 +389,7 @@ But see also [Model Search](@ref).
### Scalar scientific types

Models in MLJ will always apply the `MLJ` convention described in
[MLJScientificTypes.jl](https://alan-turing-institute.github.io/MLJScientificTypes.jl/dev/)
[ScientificTypes.jl](https://alan-turing-institute.github.io/ScientificTypes.jl/dev/)
to decide how to interpret the elements of your container types. Here
are the key features of that convention:

Expand Down Expand Up @@ -417,7 +417,7 @@ appropriate `Finite` (categorical) scitype. See [Working with Categorical Data]

For more on scitype coercion of arrays and tables, see [`coerce`](@ref),
[`autotype`](@ref) and [`unpack`](@ref) below and the examples at
[MLJScientificTypes.jl](https://alan-turing-institute.github.io/MLJScientificTypes.jl/dev/).
[ScientificTypes.jl](https://alan-turing-institute.github.io/ScientificTypes.jl/dev/).



Expand Down
4 changes: 2 additions & 2 deletions docs/src/preparing_data.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Preparing Data

As outlined in [Getting Started](@ref), it is important that the
[scientific type](https://github.com/JuliaAI/ScientificTypes.jl) of
[scientific type](https://github.com/JuliaAI/ScientificTypesBase.jl) of
data matches the requirements of the model of interest. For example,
while the majority of supervised learning models require input
features to be `Continuous`, newcomers to MLJ are sometimes
Expand Down Expand Up @@ -93,7 +93,7 @@ Pipelines](@ref).
## Scientific type coercion

Scientific type coercion is documented in detail at
[ScientificTypes.jl](https://github.com/JuliaAI/ScientificTypes.jl). See
[ScientificTypesBase.jl](https://github.com/JuliaAI/ScientificTypesBase.jl). See
also the tutorial at the [this MLJ
Workshop](https://github.com/ablaom/MachineLearningInJulia2020)
(specifically,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/quick_start_guide_to_adding_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ learning models; (ii) that you would like to interface and register
these models with MLJ; and (iii) that you have a rough understanding
of how things work with MLJ. In particular you are familiar with:

- what [scientific types](https://github.com/alan-turing-institute/MLJScientificTypes.jl) are
- what [scientific types](https://github.com/alan-turing-institute/ScientificTypes.jl) are

- what `Probabilistic`, `Deterministic` and `Unsupervised` models are

Expand Down
6 changes: 3 additions & 3 deletions docs/src/working_with_categorical_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Scientific types for discrete data

Recall that models articulate their data requirements using scientific
types (see [Getting Started](@ref) or the [MLJScientificTypes.jl
documentation](https://alan-turing-institute.github.io/MLJScientificTypes.jl/dev/)). There
types (see [Getting Started](@ref) or the [ScientificTypes.jl
documentation](https://alan-turing-institute.github.io/ScientificTypes.jl/dev/)). There
are three scientific types discrete data can have: `Count`,
`OrderedFactor` and `Multiclass`.

Expand Down Expand Up @@ -62,7 +62,7 @@ above. To inspect all column scientific types in a table
simultaneously, use `schema`. (The `scitype(X)` of a table `X`
contains a condensed form of this information used in type dispatch;
see
[here](https://github.com/alan-turing-institute/ScientificTypes.jl#more-on-the-table-type).)
[here](https://github.com/alan-turing-institute/ScientificTypesBase.jl#more-on-the-table-type).)

```@example hut
import DataFrames.DataFrame
Expand Down
2 changes: 1 addition & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ representation of probabilities, are avoided.
**Scientific types** To help users focus less on data representation
(e.g., `Float32`, `DataFrame`) and more on the intended *purpose* or
*interpretation* of data, MLJ articulates model data requirements
using *scientific types* [@ScientificTypes], such as "continuous",
using *scientific types* [@ScientificTypesBase], such as "continuous",
"ordered factor" or "table".

**Connecting models directly to arbitrary data containers**. A
Expand Down
6 changes: 3 additions & 3 deletions src/MLJ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using ComputationalResources: CPUProcesses
import MLJBase: fit, update, clean!, fit!, predict, fitted_params,
show_as_constructed, ==
import MLJModels: models
import MLJScientificTypes
import ScientificTypes


## METHOD EXPORT
Expand All @@ -47,7 +47,7 @@ export MLJ_VERSION
export pdf, logpdf, mode, median, mean, shuffle!, categorical, shuffle,
levels, levels!, std, support, sampler

# re-exports from (MLJ)ScientificTypes via MLJBase
# re-exports from (MLJ)ScientificTypesBase via MLJBase
export Scientific, Found, Unknown, Known, Finite, Infinite,
OrderedFactor, Multiclass, Count, Continuous, Textual,
Binary, ColorImage, GrayImage, Image, Table
Expand Down Expand Up @@ -222,6 +222,6 @@ const srcdir = dirname(@__FILE__)
## INCLUDE FILES

include("version.jl") # defines MLJ_VERSION constant
include("scitypes.jl") # extensions to ScientificTypes.scitype
include("scitypes.jl") # extensions to ScientificTypesBase.scitype

end # module
12 changes: 6 additions & 6 deletions src/scitypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

# This implementation of scitype for models and measures is highly experimental

const MST = MLJScientificTypes # only used in this file
const ST = ScientificTypes # only used in this file

struct SupervisedScitype{input_scitype, target_scitype, prediction_type} end

MST.scitype(model::Deterministic, ::MST.MLJ) =
ST.scitype(model::Deterministic, ::ST.DefaultConvention) =
SupervisedScitype{input_scitype(model),
target_scitype(model),
:deterministic}

MST.scitype(model::Probabilistic, ::MST.MLJ) =
ST.scitype(model::Probabilistic, ::ST.DefaultConvention) =
SupervisedScitype{input_scitype(model),
target_scitype(model),
:probabilistic}

MST.scitype(model::Interval, ::MST.MLJ) =
ST.scitype(model::Interval, ::ST.DefaultConvention) =
SupervisedScitype{input_scitype(model),
target_scitype(model),
:interval}
Expand Down Expand Up @@ -52,7 +52,7 @@ end

struct UnsupervisedScitype{input_scitype, output_scitype} end

MST.scitype(model::Unsupervised, ::MST.MLJ) =
ST.scitype(model::Unsupervised, ::ST.DefaultConvention) =
UnsupervisedScitype{input_scitype(model),
MLJBase.output_scitype(model)}

Expand Down Expand Up @@ -91,7 +91,7 @@ struct MeasureScitype{target_scitype,
is_feature_dependent,
supports_weights} end

MST.scitype(measure, ::MST.MLJ, ::Val{:measure}) =
ST.scitype(measure, ::ST.DefaultConvention, ::Val{:measure}) =
MeasureScitype{target_scitype(measure),
prediction_type(measure),
orientation(measure),
Expand Down

0 comments on commit 8ad0a55

Please sign in to comment.