This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from IBM/ColumnProjection
bump version; add test
- Loading branch information
Showing
3 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Lale" | ||
uuid = "25676c37-aa2f-4f14-ad5b-b63670ababff" | ||
authors = ["Paulito Palmes <[email protected]>", "Martin Hirzel", "Avraham Shinnar", "Kiran Kate"] | ||
version = "0.1.5" | ||
version = "0.1.6" | ||
|
||
[deps] | ||
AMLPipelineBase = "e3c3008a-8869-4d53-9f34-c96f99c8a2b6" | ||
|
@@ -14,7 +14,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | |
|
||
[compat] | ||
AMLPipelineBase = "0.1" | ||
DataFrames = "0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 1.0" | ||
DataFrames = "0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 1.0, 1.1" | ||
Pandas = "1.1, 1.2, 1.3, 1.4" | ||
PyCall = "1.90, 1.91, 1.92" | ||
julia = "1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module TestProject | ||
|
||
using DataFrames | ||
using CSV | ||
using Lale | ||
using Test | ||
|
||
function proj_test() | ||
|
||
strfeat= laleoperator("Project","lale")(columns=Dict("type"=>"string")) | ||
numfeat = laleoperator("Project","lale")(columns=Dict("type"=>"number")) | ||
|
||
OneHotEncoder = laleoperator("OneHotEncoder") | ||
ConcatFeatures = laleoperator("ConcatFeatures","lale") | ||
Tree = laleoperator("DecisionTreeClassifier") | ||
KNN = laleoperator("KNeighborsClassifier") | ||
RF = laleoperator("RandomForestClassifier") | ||
PCA = laleoperator("PCA") | ||
Hyperopt = laleoperator("Hyperopt","lale") | ||
|
||
df = CSV.read("./demo/old/credit.csv",DataFrame) | ||
y = df[!,"class"] |> collect | ||
X = df[:,2:end] | ||
|
||
train_X,train_y,test_X,test_y = Lale.train_test_split(X, y,testprop=0.20) | ||
|
||
prep_to_numbers = | ||
((strfeat >> OneHotEncoder(handle_unknown = "ignore")) & numfeat )>> ConcatFeatures | ||
planned_orig = prep_to_numbers >> ( Tree | KNN) | ||
lopt = LalePipeOptimizer(planned_orig,max_evals = 3,cv = 3) | ||
laletrained = fit(lopt,train_X,train_y) | ||
lalepred = Lale.transform(laletrained,test_X) | ||
@test score(:accuracy,lalepred,test_y) > 0.50 | ||
|
||
pca_tree_planned = prep_to_numbers >> PCA >> RF | ||
lopt = LalePipeOptimizer(pca_tree_planned,max_evals = 3,cv = 3) | ||
laletrained = fit(lopt,train_X,train_y) | ||
lalepred = Lale.transform(laletrained,test_X) | ||
@test score(:accuracy,lalepred,test_y) > 0.50 | ||
end | ||
@testset "Lale Projection" begin | ||
proj_test() | ||
end | ||
|
||
end |
ce6555f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
ce6555f
There was a problem hiding this comment.
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/37132
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: