repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
AguaClara/aguaclara | aguaclara/research/floc_model.py | num_coll_reqd | def num_coll_reqd(DIM_FRACTAL, material, DiamTarget):
"""Return the number of doubling collisions required.
Calculates the number of doubling collisions required to produce
a floc of diameter DiamTarget.
"""
return DIM_FRACTAL * np.log2(DiamTarget/material.Diameter) | python | def num_coll_reqd(DIM_FRACTAL, material, DiamTarget):
"""Return the number of doubling collisions required.
Calculates the number of doubling collisions required to produce
a floc of diameter DiamTarget.
"""
return DIM_FRACTAL * np.log2(DiamTarget/material.Diameter) | [
"def",
"num_coll_reqd",
"(",
"DIM_FRACTAL",
",",
"material",
",",
"DiamTarget",
")",
":",
"return",
"DIM_FRACTAL",
"*",
"np",
".",
"log2",
"(",
"DiamTarget",
"/",
"material",
".",
"Diameter",
")"
] | Return the number of doubling collisions required.
Calculates the number of doubling collisions required to produce
a floc of diameter DiamTarget. | [
"Return",
"the",
"number",
"of",
"doubling",
"collisions",
"required",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L255-L261 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | sep_dist_floc | def sep_dist_floc(ConcAluminum, ConcClay, coag, material,
DIM_FRACTAL, DiamTarget):
"""Return separation distance as a function of floc size."""
return (material.Diameter
* (np.pi/(6
* frac_vol_floc_initial(ConcAluminum, ConcClay,
... | python | def sep_dist_floc(ConcAluminum, ConcClay, coag, material,
DIM_FRACTAL, DiamTarget):
"""Return separation distance as a function of floc size."""
return (material.Diameter
* (np.pi/(6
* frac_vol_floc_initial(ConcAluminum, ConcClay,
... | [
"def",
"sep_dist_floc",
"(",
"ConcAluminum",
",",
"ConcClay",
",",
"coag",
",",
"material",
",",
"DIM_FRACTAL",
",",
"DiamTarget",
")",
":",
"return",
"(",
"material",
".",
"Diameter",
"*",
"(",
"np",
".",
"pi",
"/",
"(",
"6",
"*",
"frac_vol_floc_initial",... | Return separation distance as a function of floc size. | [
"Return",
"separation",
"distance",
"as",
"a",
"function",
"of",
"floc",
"size",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L266-L275 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | frac_vol_floc | def frac_vol_floc(ConcAluminum, ConcClay, coag, DIM_FRACTAL,
material, DiamTarget):
"""Return the floc volume fraction."""
return (frac_vol_floc_initial(ConcAluminum, ConcClay, coag, material)
* (DiamTarget / material.Diameter)**(3-DIM_FRACTAL)
) | python | def frac_vol_floc(ConcAluminum, ConcClay, coag, DIM_FRACTAL,
material, DiamTarget):
"""Return the floc volume fraction."""
return (frac_vol_floc_initial(ConcAluminum, ConcClay, coag, material)
* (DiamTarget / material.Diameter)**(3-DIM_FRACTAL)
) | [
"def",
"frac_vol_floc",
"(",
"ConcAluminum",
",",
"ConcClay",
",",
"coag",
",",
"DIM_FRACTAL",
",",
"material",
",",
"DiamTarget",
")",
":",
"return",
"(",
"frac_vol_floc_initial",
"(",
"ConcAluminum",
",",
"ConcClay",
",",
"coag",
",",
"material",
")",
"*",
... | Return the floc volume fraction. | [
"Return",
"the",
"floc",
"volume",
"fraction",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L280-L285 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | dens_floc_init | def dens_floc_init(ConcAluminum, ConcClay, coag, material):
"""Return the density of the initial floc.
Initial floc is made primarily of the primary colloid and nanoglobs.
"""
return (conc_floc(ConcAluminum, ConcClay, coag).magnitude
/ frac_vol_floc_initial(ConcAluminum, ConcClay, coag, mat... | python | def dens_floc_init(ConcAluminum, ConcClay, coag, material):
"""Return the density of the initial floc.
Initial floc is made primarily of the primary colloid and nanoglobs.
"""
return (conc_floc(ConcAluminum, ConcClay, coag).magnitude
/ frac_vol_floc_initial(ConcAluminum, ConcClay, coag, mat... | [
"def",
"dens_floc_init",
"(",
"ConcAluminum",
",",
"ConcClay",
",",
"coag",
",",
"material",
")",
":",
"return",
"(",
"conc_floc",
"(",
"ConcAluminum",
",",
"ConcClay",
",",
"coag",
")",
".",
"magnitude",
"/",
"frac_vol_floc_initial",
"(",
"ConcAluminum",
",",... | Return the density of the initial floc.
Initial floc is made primarily of the primary colloid and nanoglobs. | [
"Return",
"the",
"density",
"of",
"the",
"initial",
"floc",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L289-L296 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | ratio_area_clay_total | def ratio_area_clay_total(ConcClay, material, DiamTube, RatioHeightDiameter):
"""Return the surface area of clay normalized by total surface area.
Total surface area is a combination of clay and reactor wall
surface areas. This function is used to estimate how much coagulant
actually goes to the clay.
... | python | def ratio_area_clay_total(ConcClay, material, DiamTube, RatioHeightDiameter):
"""Return the surface area of clay normalized by total surface area.
Total surface area is a combination of clay and reactor wall
surface areas. This function is used to estimate how much coagulant
actually goes to the clay.
... | [
"def",
"ratio_area_clay_total",
"(",
"ConcClay",
",",
"material",
",",
"DiamTube",
",",
"RatioHeightDiameter",
")",
":",
"return",
"(",
"1",
"/",
"(",
"1",
"+",
"(",
"2",
"*",
"material",
".",
"Diameter",
"/",
"(",
"3",
"*",
"DiamTube",
"*",
"ratio_clay_... | Return the surface area of clay normalized by total surface area.
Total surface area is a combination of clay and reactor wall
surface areas. This function is used to estimate how much coagulant
actually goes to the clay.
:param ConcClay: Concentration of clay in suspension
:type ConcClay: float
... | [
"Return",
"the",
"surface",
"area",
"of",
"clay",
"normalized",
"by",
"total",
"surface",
"area",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L309-L336 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | gamma_coag | def gamma_coag(ConcClay, ConcAluminum, coag, material,
DiamTube, RatioHeightDiameter):
"""Return the coverage of clay with nanoglobs.
This function accounts for loss to the tube flocculator walls
and a poisson distribution on the clay given random hits by the
nanoglobs. The poisson distr... | python | def gamma_coag(ConcClay, ConcAluminum, coag, material,
DiamTube, RatioHeightDiameter):
"""Return the coverage of clay with nanoglobs.
This function accounts for loss to the tube flocculator walls
and a poisson distribution on the clay given random hits by the
nanoglobs. The poisson distr... | [
"def",
"gamma_coag",
"(",
"ConcClay",
",",
"ConcAluminum",
",",
"coag",
",",
"material",
",",
"DiamTube",
",",
"RatioHeightDiameter",
")",
":",
"return",
"(",
"1",
"-",
"np",
".",
"exp",
"(",
"(",
"(",
"-",
"frac_vol_floc_initial",
"(",
"ConcAluminum",
","... | Return the coverage of clay with nanoglobs.
This function accounts for loss to the tube flocculator walls
and a poisson distribution on the clay given random hits by the
nanoglobs. The poisson distribution results in the coverage only
gradually approaching full coverage as coagulant dose increases.
... | [
"Return",
"the",
"coverage",
"of",
"clay",
"with",
"nanoglobs",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L339-L373 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | gamma_humic_acid_to_coag | def gamma_humic_acid_to_coag(ConcAl, ConcNatOrgMat, NatOrgMat, coag):
"""Return the fraction of the coagulant that is coated with humic acid.
:param ConcAl: Concentration of alumninum in solution
:type ConcAl: float
:param ConcNatOrgMat: Concentration of natural organic matter in solution
:type Con... | python | def gamma_humic_acid_to_coag(ConcAl, ConcNatOrgMat, NatOrgMat, coag):
"""Return the fraction of the coagulant that is coated with humic acid.
:param ConcAl: Concentration of alumninum in solution
:type ConcAl: float
:param ConcNatOrgMat: Concentration of natural organic matter in solution
:type Con... | [
"def",
"gamma_humic_acid_to_coag",
"(",
"ConcAl",
",",
"ConcNatOrgMat",
",",
"NatOrgMat",
",",
"coag",
")",
":",
"return",
"min",
"(",
"(",
"(",
"ConcNatOrgMat",
"/",
"conc_precipitate",
"(",
"ConcAl",
",",
"coag",
")",
".",
"magnitude",
")",
"*",
"(",
"co... | Return the fraction of the coagulant that is coated with humic acid.
:param ConcAl: Concentration of alumninum in solution
:type ConcAl: float
:param ConcNatOrgMat: Concentration of natural organic matter in solution
:type ConcNatOrgMat: float
:param NatOrgMat: type of natural organic matter, e.g. ... | [
"Return",
"the",
"fraction",
"of",
"the",
"coagulant",
"that",
"is",
"coated",
"with",
"humic",
"acid",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L377-L396 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | pacl_term | def pacl_term(DiamTube, ConcClay, ConcAl, ConcNatOrgMat, NatOrgMat,
coag, material, RatioHeightDiameter):
"""Return the fraction of the surface area that is covered with coagulant
that is not covered with humic acid.
:param DiamTube: Diameter of the dosing tube
:type Diamtube: float
... | python | def pacl_term(DiamTube, ConcClay, ConcAl, ConcNatOrgMat, NatOrgMat,
coag, material, RatioHeightDiameter):
"""Return the fraction of the surface area that is covered with coagulant
that is not covered with humic acid.
:param DiamTube: Diameter of the dosing tube
:type Diamtube: float
... | [
"def",
"pacl_term",
"(",
"DiamTube",
",",
"ConcClay",
",",
"ConcAl",
",",
"ConcNatOrgMat",
",",
"NatOrgMat",
",",
"coag",
",",
"material",
",",
"RatioHeightDiameter",
")",
":",
"return",
"(",
"gamma_coag",
"(",
"ConcClay",
",",
"ConcAl",
",",
"coag",
",",
... | Return the fraction of the surface area that is covered with coagulant
that is not covered with humic acid.
:param DiamTube: Diameter of the dosing tube
:type Diamtube: float
:param ConcClay: Concentration of clay in solution
:type ConcClay: float
:param ConcAl: Concentration of alumninum in so... | [
"Return",
"the",
"fraction",
"of",
"the",
"surface",
"area",
"that",
"is",
"covered",
"with",
"coagulant",
"that",
"is",
"not",
"covered",
"with",
"humic",
"acid",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L401-L430 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | dens_floc | def dens_floc(ConcAl, ConcClay, DIM_FRACTAL, DiamTarget, coag, material, Temp):
"""Calculate floc density as a function of size."""
WaterDensity = pc.density_water(Temp).magnitude
return ((dens_floc_init(ConcAl, ConcClay, coag, material).magnitude
- WaterDensity
)
* (ma... | python | def dens_floc(ConcAl, ConcClay, DIM_FRACTAL, DiamTarget, coag, material, Temp):
"""Calculate floc density as a function of size."""
WaterDensity = pc.density_water(Temp).magnitude
return ((dens_floc_init(ConcAl, ConcClay, coag, material).magnitude
- WaterDensity
)
* (ma... | [
"def",
"dens_floc",
"(",
"ConcAl",
",",
"ConcClay",
",",
"DIM_FRACTAL",
",",
"DiamTarget",
",",
"coag",
",",
"material",
",",
"Temp",
")",
":",
"WaterDensity",
"=",
"pc",
".",
"density_water",
"(",
"Temp",
")",
".",
"magnitude",
"return",
"(",
"(",
"dens... | Calculate floc density as a function of size. | [
"Calculate",
"floc",
"density",
"as",
"a",
"function",
"of",
"size",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L505-L513 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | vel_term_floc | def vel_term_floc(ConcAl, ConcClay, coag, material, DIM_FRACTAL,
DiamTarget, Temp):
"""Calculate floc terminal velocity."""
WaterDensity = pc.density_water(Temp).magnitude
return (((pc.gravity.magnitude * material.Diameter**2)
/ (18 * PHI_FLOC * pc.viscosity_kinematic(Temp).ma... | python | def vel_term_floc(ConcAl, ConcClay, coag, material, DIM_FRACTAL,
DiamTarget, Temp):
"""Calculate floc terminal velocity."""
WaterDensity = pc.density_water(Temp).magnitude
return (((pc.gravity.magnitude * material.Diameter**2)
/ (18 * PHI_FLOC * pc.viscosity_kinematic(Temp).ma... | [
"def",
"vel_term_floc",
"(",
"ConcAl",
",",
"ConcClay",
",",
"coag",
",",
"material",
",",
"DIM_FRACTAL",
",",
"DiamTarget",
",",
"Temp",
")",
":",
"WaterDensity",
"=",
"pc",
".",
"density_water",
"(",
"Temp",
")",
".",
"magnitude",
"return",
"(",
"(",
"... | Calculate floc terminal velocity. | [
"Calculate",
"floc",
"terminal",
"velocity",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L518-L531 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | diam_floc_vel_term | def diam_floc_vel_term(ConcAl, ConcClay, coag, material,
DIM_FRACTAL, VelTerm, Temp):
"""Calculate floc diamter as a function of terminal velocity."""
WaterDensity = pc.density_water(Temp).magnitude
return (material.Diameter * (((18 * VelTerm * PHI_FLOC
* pc.... | python | def diam_floc_vel_term(ConcAl, ConcClay, coag, material,
DIM_FRACTAL, VelTerm, Temp):
"""Calculate floc diamter as a function of terminal velocity."""
WaterDensity = pc.density_water(Temp).magnitude
return (material.Diameter * (((18 * VelTerm * PHI_FLOC
* pc.... | [
"def",
"diam_floc_vel_term",
"(",
"ConcAl",
",",
"ConcClay",
",",
"coag",
",",
"material",
",",
"DIM_FRACTAL",
",",
"VelTerm",
",",
"Temp",
")",
":",
"WaterDensity",
"=",
"pc",
".",
"density_water",
"(",
"Temp",
")",
".",
"magnitude",
"return",
"(",
"mater... | Calculate floc diamter as a function of terminal velocity. | [
"Calculate",
"floc",
"diamter",
"as",
"a",
"function",
"of",
"terminal",
"velocity",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L536-L552 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | time_col_laminar | def time_col_laminar(EnergyDis, Temp, ConcAl, ConcClay, coag, material,
DiamTarget, DiamTube, DIM_FRACTAL, RatioHeightDiameter):
"""Calculate single collision time for laminar flow mediated collisions.
Calculated as a function of floc size.
"""
return (((1/6) * ((6/np.pi)**(1/3))
... | python | def time_col_laminar(EnergyDis, Temp, ConcAl, ConcClay, coag, material,
DiamTarget, DiamTube, DIM_FRACTAL, RatioHeightDiameter):
"""Calculate single collision time for laminar flow mediated collisions.
Calculated as a function of floc size.
"""
return (((1/6) * ((6/np.pi)**(1/3))
... | [
"def",
"time_col_laminar",
"(",
"EnergyDis",
",",
"Temp",
",",
"ConcAl",
",",
"ConcClay",
",",
"coag",
",",
"material",
",",
"DiamTarget",
",",
"DiamTube",
",",
"DIM_FRACTAL",
",",
"RatioHeightDiameter",
")",
":",
"return",
"(",
"(",
"(",
"1",
"/",
"6",
... | Calculate single collision time for laminar flow mediated collisions.
Calculated as a function of floc size. | [
"Calculate",
"single",
"collision",
"time",
"for",
"laminar",
"flow",
"mediated",
"collisions",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L558-L572 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | time_col_turbulent | def time_col_turbulent(EnergyDis, ConcAl, ConcClay, coag, material,
DiamTarget, DIM_FRACTAL):
"""Calculate single collision time for turbulent flow mediated collisions.
Calculated as a function of floc size.
"""
return((1/6) * (6/np.pi)**(1/9) * EnergyDis**(-1/3) * DiamTarget**(2... | python | def time_col_turbulent(EnergyDis, ConcAl, ConcClay, coag, material,
DiamTarget, DIM_FRACTAL):
"""Calculate single collision time for turbulent flow mediated collisions.
Calculated as a function of floc size.
"""
return((1/6) * (6/np.pi)**(1/9) * EnergyDis**(-1/3) * DiamTarget**(2... | [
"def",
"time_col_turbulent",
"(",
"EnergyDis",
",",
"ConcAl",
",",
"ConcClay",
",",
"coag",
",",
"material",
",",
"DiamTarget",
",",
"DIM_FRACTAL",
")",
":",
"return",
"(",
"(",
"1",
"/",
"6",
")",
"*",
"(",
"6",
"/",
"np",
".",
"pi",
")",
"**",
"(... | Calculate single collision time for turbulent flow mediated collisions.
Calculated as a function of floc size. | [
"Calculate",
"single",
"collision",
"time",
"for",
"turbulent",
"flow",
"mediated",
"collisions",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L577-L586 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | diam_kolmogorov | def diam_kolmogorov(EnergyDis, Temp, ConcAl, ConcClay, coag, material,
DIM_FRACTAL):
"""Return the size of the floc with separation distances equal to
the Kolmogorov length and the inner viscous length scale.
"""
return (material.Diameter
* ((eta_kolmogorov(EnergyDis, Tem... | python | def diam_kolmogorov(EnergyDis, Temp, ConcAl, ConcClay, coag, material,
DIM_FRACTAL):
"""Return the size of the floc with separation distances equal to
the Kolmogorov length and the inner viscous length scale.
"""
return (material.Diameter
* ((eta_kolmogorov(EnergyDis, Tem... | [
"def",
"diam_kolmogorov",
"(",
"EnergyDis",
",",
"Temp",
",",
"ConcAl",
",",
"ConcClay",
",",
"coag",
",",
"material",
",",
"DIM_FRACTAL",
")",
":",
"return",
"(",
"material",
".",
"Diameter",
"*",
"(",
"(",
"eta_kolmogorov",
"(",
"EnergyDis",
",",
"Temp",... | Return the size of the floc with separation distances equal to
the Kolmogorov length and the inner viscous length scale. | [
"Return",
"the",
"size",
"of",
"the",
"floc",
"with",
"separation",
"distances",
"equal",
"to",
"the",
"Kolmogorov",
"length",
"and",
"the",
"inner",
"viscous",
"length",
"scale",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L602-L613 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | dean_number | def dean_number(PlantFlow, IDTube, RadiusCoil, Temp):
"""Return the Dean Number.
The Dean Number is a dimensionless parameter that is the unfortunate
combination of Reynolds and tube curvature. It would have been better
to keep the Reynolds number and define a simple dimensionless geometric
paramet... | python | def dean_number(PlantFlow, IDTube, RadiusCoil, Temp):
"""Return the Dean Number.
The Dean Number is a dimensionless parameter that is the unfortunate
combination of Reynolds and tube curvature. It would have been better
to keep the Reynolds number and define a simple dimensionless geometric
paramet... | [
"def",
"dean_number",
"(",
"PlantFlow",
",",
"IDTube",
",",
"RadiusCoil",
",",
"Temp",
")",
":",
"return",
"(",
"reynolds_rapid_mix",
"(",
"PlantFlow",
",",
"IDTube",
",",
"Temp",
")",
"*",
"(",
"IDTube",
"/",
"(",
"2",
"*",
"RadiusCoil",
")",
")",
"**... | Return the Dean Number.
The Dean Number is a dimensionless parameter that is the unfortunate
combination of Reynolds and tube curvature. It would have been better
to keep the Reynolds number and define a simple dimensionless geometric
parameter. | [
"Return",
"the",
"Dean",
"Number",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L669-L679 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | g_coil | def g_coil(FlowPlant, IDTube, RadiusCoil, Temp):
"""We need a reference for this.
Karen's thesis likely has this equation and the reference.
"""
return (g_straight(FlowPlant, IDTube).magnitude
* (1 + 0.033 *
np.log10(dean_number(FlowPlant, IDTube, RadiusCoil, Temp)
... | python | def g_coil(FlowPlant, IDTube, RadiusCoil, Temp):
"""We need a reference for this.
Karen's thesis likely has this equation and the reference.
"""
return (g_straight(FlowPlant, IDTube).magnitude
* (1 + 0.033 *
np.log10(dean_number(FlowPlant, IDTube, RadiusCoil, Temp)
... | [
"def",
"g_coil",
"(",
"FlowPlant",
",",
"IDTube",
",",
"RadiusCoil",
",",
"Temp",
")",
":",
"return",
"(",
"g_straight",
"(",
"FlowPlant",
",",
"IDTube",
")",
".",
"magnitude",
"*",
"(",
"1",
"+",
"0.033",
"*",
"np",
".",
"log10",
"(",
"dean_number",
... | We need a reference for this.
Karen's thesis likely has this equation and the reference. | [
"We",
"need",
"a",
"reference",
"for",
"this",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L683-L693 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | g_time_res | def g_time_res(FlowPlant, IDTube, RadiusCoil, LengthTube, Temp):
"""G Residence Time calculated for a coiled tube flocculator."""
return (g_coil(FlowPlant, IDTube, RadiusCoil, Temp).magnitude
* time_res_tube(IDTube, LengthTube, FlowPlant).magnitude
) | python | def g_time_res(FlowPlant, IDTube, RadiusCoil, LengthTube, Temp):
"""G Residence Time calculated for a coiled tube flocculator."""
return (g_coil(FlowPlant, IDTube, RadiusCoil, Temp).magnitude
* time_res_tube(IDTube, LengthTube, FlowPlant).magnitude
) | [
"def",
"g_time_res",
"(",
"FlowPlant",
",",
"IDTube",
",",
"RadiusCoil",
",",
"LengthTube",
",",
"Temp",
")",
":",
"return",
"(",
"g_coil",
"(",
"FlowPlant",
",",
"IDTube",
",",
"RadiusCoil",
",",
"Temp",
")",
".",
"magnitude",
"*",
"time_res_tube",
"(",
... | G Residence Time calculated for a coiled tube flocculator. | [
"G",
"Residence",
"Time",
"calculated",
"for",
"a",
"coiled",
"tube",
"flocculator",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L703-L707 |
AguaClara/aguaclara | aguaclara/research/floc_model.py | Chemical.define_Precip | def define_Precip(self, diameter, density, molecweight, alumMPM):
"""Define a precipitate for the chemical.
:param diameter: Diameter of the precipitate in particulate form
:type diameter: float
:param density: Density of the material (mass/volume)
:type density: float
:... | python | def define_Precip(self, diameter, density, molecweight, alumMPM):
"""Define a precipitate for the chemical.
:param diameter: Diameter of the precipitate in particulate form
:type diameter: float
:param density: Density of the material (mass/volume)
:type density: float
:... | [
"def",
"define_Precip",
"(",
"self",
",",
"diameter",
",",
"density",
",",
"molecweight",
",",
"alumMPM",
")",
":",
"self",
".",
"PrecipDiameter",
"=",
"diameter",
"self",
".",
"PrecipDensity",
"=",
"density",
"self",
".",
"PrecipMolecWeight",
"=",
"molecweigh... | Define a precipitate for the chemical.
:param diameter: Diameter of the precipitate in particulate form
:type diameter: float
:param density: Density of the material (mass/volume)
:type density: float
:param molecWeight: Molecular weight of the material (mass/mole)
:type... | [
"Define",
"a",
"precipitate",
"for",
"the",
"chemical",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/research/floc_model.py#L59-L73 |
AguaClara/aguaclara | aguaclara/design/plant.py | Plant.ent_tank_a | def ent_tank_a(self):
"""Calculate the planview area of the entrance tank, given the volume of
the flocculator.
:returns: The planview area of the entrance tank.
:rtype: float * u.m ** 2
"""
# first guess planview area
a_new = 1 * u.m**2
a_ratio = 2 # se... | python | def ent_tank_a(self):
"""Calculate the planview area of the entrance tank, given the volume of
the flocculator.
:returns: The planview area of the entrance tank.
:rtype: float * u.m ** 2
"""
# first guess planview area
a_new = 1 * u.m**2
a_ratio = 2 # se... | [
"def",
"ent_tank_a",
"(",
"self",
")",
":",
"# first guess planview area",
"a_new",
"=",
"1",
"*",
"u",
".",
"m",
"**",
"2",
"a_ratio",
"=",
"2",
"# set to >1+tolerance to start while loop",
"tolerance",
"=",
"0.01",
"a_floc_pv",
"=",
"(",
"self",
".",
"floc",... | Calculate the planview area of the entrance tank, given the volume of
the flocculator.
:returns: The planview area of the entrance tank.
:rtype: float * u.m ** 2 | [
"Calculate",
"the",
"planview",
"area",
"of",
"the",
"entrance",
"tank",
"given",
"the",
"volume",
"of",
"the",
"flocculator",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/design/plant.py#L24-L47 |
AguaClara/aguaclara | aguaclara/unit_process_design/lfom.py | n_lfom_rows | def n_lfom_rows(FLOW,HL_LFOM):
"""This equation states that the open area corresponding to one row can be
set equal to two orifices of diameter=row height. If there are more than
two orifices per row at the top of the LFOM then there are more orifices
than are convenient to drill and more than necessary... | python | def n_lfom_rows(FLOW,HL_LFOM):
"""This equation states that the open area corresponding to one row can be
set equal to two orifices of diameter=row height. If there are more than
two orifices per row at the top of the LFOM then there are more orifices
than are convenient to drill and more than necessary... | [
"def",
"n_lfom_rows",
"(",
"FLOW",
",",
"HL_LFOM",
")",
":",
"N_estimated",
"=",
"(",
"HL_LFOM",
"*",
"np",
".",
"pi",
"/",
"(",
"2",
"*",
"width_stout",
"(",
"HL_LFOM",
",",
"HL_LFOM",
")",
"*",
"FLOW",
")",
")",
"variablerow",
"=",
"min",
"(",
"1... | This equation states that the open area corresponding to one row can be
set equal to two orifices of diameter=row height. If there are more than
two orifices per row at the top of the LFOM then there are more orifices
than are convenient to drill and more than necessary for good accuracy.
Thus this rela... | [
"This",
"equation",
"states",
"that",
"the",
"open",
"area",
"corresponding",
"to",
"one",
"row",
"can",
"be",
"set",
"equal",
"to",
"two",
"orifices",
"of",
"diameter",
"=",
"row",
"height",
".",
"If",
"there",
"are",
"more",
"than",
"two",
"orifices",
... | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/unit_process_design/lfom.py#L26-L51 |
AguaClara/aguaclara | aguaclara/unit_process_design/lfom.py | area_lfom_orifices_top | def area_lfom_orifices_top(FLOW,HL_LFOM):
"""Estimate the orifice area corresponding to the top row of orifices.
Another solution method is to use integration to solve this problem.
Here we use the width of the stout weir in the center of the top row
to estimate the area of the top orifice
"""
r... | python | def area_lfom_orifices_top(FLOW,HL_LFOM):
"""Estimate the orifice area corresponding to the top row of orifices.
Another solution method is to use integration to solve this problem.
Here we use the width of the stout weir in the center of the top row
to estimate the area of the top orifice
"""
r... | [
"def",
"area_lfom_orifices_top",
"(",
"FLOW",
",",
"HL_LFOM",
")",
":",
"return",
"(",
"(",
"FLOW",
"*",
"width_stout",
"(",
"HL_LFOM",
"*",
"u",
".",
"m",
",",
"HL_LFOM",
"*",
"u",
".",
"m",
"-",
"0.5",
"*",
"dist_center_lfom_rows",
"(",
"FLOW",
",",
... | Estimate the orifice area corresponding to the top row of orifices.
Another solution method is to use integration to solve this problem.
Here we use the width of the stout weir in the center of the top row
to estimate the area of the top orifice | [
"Estimate",
"the",
"orifice",
"area",
"corresponding",
"to",
"the",
"top",
"row",
"of",
"orifices",
".",
"Another",
"solution",
"method",
"is",
"to",
"use",
"integration",
"to",
"solve",
"this",
"problem",
".",
"Here",
"we",
"use",
"the",
"width",
"of",
"t... | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/unit_process_design/lfom.py#L76-L83 |
AguaClara/aguaclara | aguaclara/unit_process_design/lfom.py | n_lfom_orifices_per_row_max | def n_lfom_orifices_per_row_max(FLOW,HL_LFOM,drill_bits):
"""A bound on the number of orifices allowed in each row.
The distance between consecutive orifices must be enough to retain
structural integrity of the pipe.
"""
return math.floor(math.pi * (pipe.ID_SDR(
nom_diam_lfom_pipe(FLOW, HL_L... | python | def n_lfom_orifices_per_row_max(FLOW,HL_LFOM,drill_bits):
"""A bound on the number of orifices allowed in each row.
The distance between consecutive orifices must be enough to retain
structural integrity of the pipe.
"""
return math.floor(math.pi * (pipe.ID_SDR(
nom_diam_lfom_pipe(FLOW, HL_L... | [
"def",
"n_lfom_orifices_per_row_max",
"(",
"FLOW",
",",
"HL_LFOM",
",",
"drill_bits",
")",
":",
"return",
"math",
".",
"floor",
"(",
"math",
".",
"pi",
"*",
"(",
"pipe",
".",
"ID_SDR",
"(",
"nom_diam_lfom_pipe",
"(",
"FLOW",
",",
"HL_LFOM",
")",
",",
"de... | A bound on the number of orifices allowed in each row.
The distance between consecutive orifices must be enough to retain
structural integrity of the pipe. | [
"A",
"bound",
"on",
"the",
"number",
"of",
"orifices",
"allowed",
"in",
"each",
"row",
".",
"The",
"distance",
"between",
"consecutive",
"orifices",
"must",
"be",
"enough",
"to",
"retain",
"structural",
"integrity",
"of",
"the",
"pipe",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/unit_process_design/lfom.py#L99-L107 |
AguaClara/aguaclara | aguaclara/unit_process_design/lfom.py | height_lfom_orifices | def height_lfom_orifices(FLOW,HL_LFOM,drill_bits):
"""Calculates the height of the center of each row of orifices.
The bottom of the bottom row orifices is at the zero elevation
point of the LFOM so that the flow goes to zero when the water height
is at zero.
"""
return (np.arange((orifice_diame... | python | def height_lfom_orifices(FLOW,HL_LFOM,drill_bits):
"""Calculates the height of the center of each row of orifices.
The bottom of the bottom row orifices is at the zero elevation
point of the LFOM so that the flow goes to zero when the water height
is at zero.
"""
return (np.arange((orifice_diame... | [
"def",
"height_lfom_orifices",
"(",
"FLOW",
",",
"HL_LFOM",
",",
"drill_bits",
")",
":",
"return",
"(",
"np",
".",
"arange",
"(",
"(",
"orifice_diameter",
"(",
"FLOW",
",",
"HL_LFOM",
",",
"drill_bits",
")",
"*",
"0.5",
")",
",",
"HL_LFOM",
",",
"(",
"... | Calculates the height of the center of each row of orifices.
The bottom of the bottom row orifices is at the zero elevation
point of the LFOM so that the flow goes to zero when the water height
is at zero. | [
"Calculates",
"the",
"height",
"of",
"the",
"center",
"of",
"each",
"row",
"of",
"orifices",
".",
"The",
"bottom",
"of",
"the",
"bottom",
"row",
"orifices",
"is",
"at",
"the",
"zero",
"elevation",
"point",
"of",
"the",
"LFOM",
"so",
"that",
"the",
"flow"... | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/unit_process_design/lfom.py#L115-L123 |
AguaClara/aguaclara | aguaclara/unit_process_design/lfom.py | flow_lfom_actual | def flow_lfom_actual(FLOW,HL_LFOM,drill_bits,Row_Index_Submerged,N_LFOM_Orifices):
"""Calculates the flow for a given number of submerged rows of orifices
harray is the distance from the water level to the center of the orifices
when the water is at the max level
"""
D_LFOM_Orifices=orifice_diameter... | python | def flow_lfom_actual(FLOW,HL_LFOM,drill_bits,Row_Index_Submerged,N_LFOM_Orifices):
"""Calculates the flow for a given number of submerged rows of orifices
harray is the distance from the water level to the center of the orifices
when the water is at the max level
"""
D_LFOM_Orifices=orifice_diameter... | [
"def",
"flow_lfom_actual",
"(",
"FLOW",
",",
"HL_LFOM",
",",
"drill_bits",
",",
"Row_Index_Submerged",
",",
"N_LFOM_Orifices",
")",
":",
"D_LFOM_Orifices",
"=",
"orifice_diameter",
"(",
"FLOW",
",",
"HL_LFOM",
",",
"drill_bits",
")",
".",
"magnitude",
"row_height"... | Calculates the flow for a given number of submerged rows of orifices
harray is the distance from the water level to the center of the orifices
when the water is at the max level | [
"Calculates",
"the",
"flow",
"for",
"a",
"given",
"number",
"of",
"submerged",
"rows",
"of",
"orifices",
"harray",
"is",
"the",
"distance",
"from",
"the",
"water",
"level",
"to",
"the",
"center",
"of",
"the",
"orifices",
"when",
"the",
"water",
"is",
"at",... | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/unit_process_design/lfom.py#L126-L139 |
AguaClara/aguaclara | aguaclara/core/utility.py | round_sf | def round_sf(number, digits):
"""Returns inputted value rounded to number of significant figures desired.
:param number: Value to be rounded
:type number: float
:param digits: number of significant digits to be rounded to.
:type digits: int
"""
units = None
try:
num = number.mag... | python | def round_sf(number, digits):
"""Returns inputted value rounded to number of significant figures desired.
:param number: Value to be rounded
:type number: float
:param digits: number of significant digits to be rounded to.
:type digits: int
"""
units = None
try:
num = number.mag... | [
"def",
"round_sf",
"(",
"number",
",",
"digits",
")",
":",
"units",
"=",
"None",
"try",
":",
"num",
"=",
"number",
".",
"magnitude",
"units",
"=",
"number",
".",
"units",
"except",
"AttributeError",
":",
"num",
"=",
"number",
"try",
":",
"if",
"(",
"... | Returns inputted value rounded to number of significant figures desired.
:param number: Value to be rounded
:type number: float
:param digits: number of significant digits to be rounded to.
:type digits: int | [
"Returns",
"inputted",
"value",
"rounded",
"to",
"number",
"of",
"significant",
"figures",
"desired",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/core/utility.py#L12-L37 |
AguaClara/aguaclara | aguaclara/core/utility.py | stepceil_with_units | def stepceil_with_units(param, step, unit):
"""This function returns the smallest multiple of 'step' greater than or
equal to 'param' and outputs the result in Pint units.
This function is unit-aware and functions without requiring translation
so long as 'param' and 'unit' are of the same dimensionality... | python | def stepceil_with_units(param, step, unit):
"""This function returns the smallest multiple of 'step' greater than or
equal to 'param' and outputs the result in Pint units.
This function is unit-aware and functions without requiring translation
so long as 'param' and 'unit' are of the same dimensionality... | [
"def",
"stepceil_with_units",
"(",
"param",
",",
"step",
",",
"unit",
")",
":",
"counter",
"=",
"0",
"*",
"unit",
"while",
"counter",
"<",
"param",
".",
"to",
"(",
"unit",
")",
":",
"counter",
"+=",
"step",
"*",
"unit",
"return",
"counter"
] | This function returns the smallest multiple of 'step' greater than or
equal to 'param' and outputs the result in Pint units.
This function is unit-aware and functions without requiring translation
so long as 'param' and 'unit' are of the same dimensionality. | [
"This",
"function",
"returns",
"the",
"smallest",
"multiple",
"of",
"step",
"greater",
"than",
"or",
"equal",
"to",
"param",
"and",
"outputs",
"the",
"result",
"in",
"Pint",
"units",
".",
"This",
"function",
"is",
"unit",
"-",
"aware",
"and",
"functions",
... | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/core/utility.py#L40-L49 |
AguaClara/aguaclara | aguaclara/core/utility.py | list_handler | def list_handler(HandlerResult="nparray"):
"""Wraps a function to handle list inputs."""
def decorate(func):
def wrapper(*args, **kwargs):
"""Run through the wrapped function once for each array element.
:param HandlerResult: output type. Defaults to numpy arrays.
""... | python | def list_handler(HandlerResult="nparray"):
"""Wraps a function to handle list inputs."""
def decorate(func):
def wrapper(*args, **kwargs):
"""Run through the wrapped function once for each array element.
:param HandlerResult: output type. Defaults to numpy arrays.
""... | [
"def",
"list_handler",
"(",
"HandlerResult",
"=",
"\"nparray\"",
")",
":",
"def",
"decorate",
"(",
"func",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"\"\"\"Run through the wrapped function once for each array element.\n\n ... | Wraps a function to handle list inputs. | [
"Wraps",
"a",
"function",
"to",
"handle",
"list",
"inputs",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/core/utility.py#L64-L132 |
AguaClara/aguaclara | aguaclara/core/utility.py | check_range | def check_range(*args):
"""
Check whether passed paramters fall within approved ranges.
Does not return anything, but will raise an error if a parameter falls
outside of its defined range.
Input should be passed as an array of sequences, with each sequence
having three elements:
[0] is... | python | def check_range(*args):
"""
Check whether passed paramters fall within approved ranges.
Does not return anything, but will raise an error if a parameter falls
outside of its defined range.
Input should be passed as an array of sequences, with each sequence
having three elements:
[0] is... | [
"def",
"check_range",
"(",
"*",
"args",
")",
":",
"knownChecks",
"=",
"(",
"'>0'",
",",
"'>=0'",
",",
"'0-1'",
",",
"'<0'",
",",
"'<=0'",
",",
"'int'",
",",
"'boolean'",
")",
"for",
"arg",
"in",
"args",
":",
"#Converts arg to a mutable list",
"arg",
"=",... | Check whether passed paramters fall within approved ranges.
Does not return anything, but will raise an error if a parameter falls
outside of its defined range.
Input should be passed as an array of sequences, with each sequence
having three elements:
[0] is the value being checked,
[1... | [
"Check",
"whether",
"passed",
"paramters",
"fall",
"within",
"approved",
"ranges",
"."
] | train | https://github.com/AguaClara/aguaclara/blob/8dd4e734768b166a7fc2b60388a24df2f93783fc/aguaclara/core/utility.py#L135-L198 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | main | def main():
"""
Runs a clusterer from the command-line. Calls JVM start/stop automatically.
Use -h to see all options.
"""
parser = argparse.ArgumentParser(
description='Performs clustering from the command-line. Calls JVM start/stop automatically.')
parser.add_argument("-j", metavar="cl... | python | def main():
"""
Runs a clusterer from the command-line. Calls JVM start/stop automatically.
Use -h to see all options.
"""
parser = argparse.ArgumentParser(
description='Performs clustering from the command-line. Calls JVM start/stop automatically.')
parser.add_argument("-j", metavar="cl... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Performs clustering from the command-line. Calls JVM start/stop automatically.'",
")",
"parser",
".",
"add_argument",
"(",
"\"-j\"",
",",
"metavar",
"=",
"\"classp... | Runs a clusterer from the command-line. Calls JVM start/stop automatically.
Use -h to see all options. | [
"Runs",
"a",
"clusterer",
"from",
"the",
"command",
"-",
"line",
".",
"Calls",
"JVM",
"start",
"/",
"stop",
"automatically",
".",
"Use",
"-",
"h",
"to",
"see",
"all",
"options",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L383-L439 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | Clusterer.update_clusterer | def update_clusterer(self, inst):
"""
Updates the clusterer with the instance.
:param inst: the Instance to update the clusterer with
:type inst: Instance
"""
if self.is_updateable:
javabridge.call(self.jobject, "updateClusterer", "(Lweka/core/Instance;)V", i... | python | def update_clusterer(self, inst):
"""
Updates the clusterer with the instance.
:param inst: the Instance to update the clusterer with
:type inst: Instance
"""
if self.is_updateable:
javabridge.call(self.jobject, "updateClusterer", "(Lweka/core/Instance;)V", i... | [
"def",
"update_clusterer",
"(",
"self",
",",
"inst",
")",
":",
"if",
"self",
".",
"is_updateable",
":",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"updateClusterer\"",
",",
"\"(Lweka/core/Instance;)V\"",
",",
"inst",
".",
"jobject",
")",
... | Updates the clusterer with the instance.
:param inst: the Instance to update the clusterer with
:type inst: Instance | [
"Updates",
"the",
"clusterer",
"with",
"the",
"instance",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L78-L88 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | Clusterer.update_finished | def update_finished(self):
"""
Signals the clusterer that updating with new data has finished.
"""
if self.is_updateable:
javabridge.call(self.jobject, "updateFinished", "()V")
else:
logger.critical(classes.get_classname(self.jobject) + " is not updateable... | python | def update_finished(self):
"""
Signals the clusterer that updating with new data has finished.
"""
if self.is_updateable:
javabridge.call(self.jobject, "updateFinished", "()V")
else:
logger.critical(classes.get_classname(self.jobject) + " is not updateable... | [
"def",
"update_finished",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_updateable",
":",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"updateFinished\"",
",",
"\"()V\"",
")",
"else",
":",
"logger",
".",
"critical",
"(",
"classes",
".",
... | Signals the clusterer that updating with new data has finished. | [
"Signals",
"the",
"clusterer",
"that",
"updating",
"with",
"new",
"data",
"has",
"finished",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L90-L97 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | Clusterer.distribution_for_instance | def distribution_for_instance(self, inst):
"""
Peforms a prediction, returning the cluster distribution.
:param inst: the Instance to get the cluster distribution for
:type inst: Instance
:return: the cluster distribution
:rtype: float[]
"""
pred = self._... | python | def distribution_for_instance(self, inst):
"""
Peforms a prediction, returning the cluster distribution.
:param inst: the Instance to get the cluster distribution for
:type inst: Instance
:return: the cluster distribution
:rtype: float[]
"""
pred = self._... | [
"def",
"distribution_for_instance",
"(",
"self",
",",
"inst",
")",
":",
"pred",
"=",
"self",
".",
"__distribution",
"(",
"inst",
".",
"jobject",
")",
"return",
"javabridge",
".",
"get_env",
"(",
")",
".",
"get_double_array_elements",
"(",
"pred",
")"
] | Peforms a prediction, returning the cluster distribution.
:param inst: the Instance to get the cluster distribution for
:type inst: Instance
:return: the cluster distribution
:rtype: float[] | [
"Peforms",
"a",
"prediction",
"returning",
"the",
"cluster",
"distribution",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L110-L120 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | ClusterEvaluation.cluster_assignments | def cluster_assignments(self):
"""
Return an array of cluster assignments corresponding to the most recent set of instances clustered.
:return: the cluster assignments
:rtype: ndarray
"""
array = javabridge.call(self.jobject, "getClusterAssignments", "()[D")
if a... | python | def cluster_assignments(self):
"""
Return an array of cluster assignments corresponding to the most recent set of instances clustered.
:return: the cluster assignments
:rtype: ndarray
"""
array = javabridge.call(self.jobject, "getClusterAssignments", "()[D")
if a... | [
"def",
"cluster_assignments",
"(",
"self",
")",
":",
"array",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getClusterAssignments\"",
",",
"\"()[D\"",
")",
"if",
"array",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"j... | Return an array of cluster assignments corresponding to the most recent set of instances clustered.
:return: the cluster assignments
:rtype: ndarray | [
"Return",
"an",
"array",
"of",
"cluster",
"assignments",
"corresponding",
"to",
"the",
"most",
"recent",
"set",
"of",
"instances",
"clustered",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L297-L308 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | ClusterEvaluation.classes_to_clusters | def classes_to_clusters(self):
"""
Return the array (ordered by cluster number) of minimum error class to cluster mappings.
:return: the mappings
:rtype: ndarray
"""
array = javabridge.call(self.jobject, "getClassesToClusters", "()[I")
if array is None:
... | python | def classes_to_clusters(self):
"""
Return the array (ordered by cluster number) of minimum error class to cluster mappings.
:return: the mappings
:rtype: ndarray
"""
array = javabridge.call(self.jobject, "getClassesToClusters", "()[I")
if array is None:
... | [
"def",
"classes_to_clusters",
"(",
"self",
")",
":",
"array",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getClassesToClusters\"",
",",
"\"()[I\"",
")",
"if",
"array",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"ja... | Return the array (ordered by cluster number) of minimum error class to cluster mappings.
:return: the mappings
:rtype: ndarray | [
"Return",
"the",
"array",
"(",
"ordered",
"by",
"cluster",
"number",
")",
"of",
"minimum",
"error",
"class",
"to",
"cluster",
"mappings",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L331-L342 |
fracpete/python-weka-wrapper3 | python/weka/clusterers.py | ClusterEvaluation.crossvalidate_model | def crossvalidate_model(cls, clusterer, data, num_folds, rnd):
"""
Cross-validates the clusterer and returns the loglikelihood.
:param clusterer: the clusterer instance to evaluate
:type clusterer: Clusterer
:param data: the data to evaluate on
:type data: Instances
... | python | def crossvalidate_model(cls, clusterer, data, num_folds, rnd):
"""
Cross-validates the clusterer and returns the loglikelihood.
:param clusterer: the clusterer instance to evaluate
:type clusterer: Clusterer
:param data: the data to evaluate on
:type data: Instances
... | [
"def",
"crossvalidate_model",
"(",
"cls",
",",
"clusterer",
",",
"data",
",",
"num_folds",
",",
"rnd",
")",
":",
"return",
"javabridge",
".",
"static_call",
"(",
"\"Lweka/clusterers/ClusterEvaluation;\"",
",",
"\"crossValidateModel\"",
",",
"\"(Lweka/clusterers/DensityB... | Cross-validates the clusterer and returns the loglikelihood.
:param clusterer: the clusterer instance to evaluate
:type clusterer: Clusterer
:param data: the data to evaluate on
:type data: Instances
:param num_folds: the number of folds
:type num_folds: int
:par... | [
"Cross",
"-",
"validates",
"the",
"clusterer",
"and",
"returns",
"the",
"loglikelihood",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/clusterers.py#L362-L380 |
fracpete/python-weka-wrapper3 | python/weka/core/serialization.py | deepcopy | def deepcopy(obj):
"""
Creates a deep copy of the JavaObject (or derived class) or JB_Object.
:param obj: the object to create a copy of
:type obj: object
:return: the copy, None if failed to copy
:rtype: object
"""
if isinstance(obj, JavaObject):
wrapped = True
jobject ... | python | def deepcopy(obj):
"""
Creates a deep copy of the JavaObject (or derived class) or JB_Object.
:param obj: the object to create a copy of
:type obj: object
:return: the copy, None if failed to copy
:rtype: object
"""
if isinstance(obj, JavaObject):
wrapped = True
jobject ... | [
"def",
"deepcopy",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"JavaObject",
")",
":",
"wrapped",
"=",
"True",
"jobject",
"=",
"obj",
".",
"jobject",
"else",
":",
"wrapped",
"=",
"False",
"jobject",
"=",
"obj",
"try",
":",
"serialized",
... | Creates a deep copy of the JavaObject (or derived class) or JB_Object.
:param obj: the object to create a copy of
:type obj: object
:return: the copy, None if failed to copy
:rtype: object | [
"Creates",
"a",
"deep",
"copy",
"of",
"the",
"JavaObject",
"(",
"or",
"derived",
"class",
")",
"or",
"JB_Object",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/serialization.py#L27-L50 |
fracpete/python-weka-wrapper3 | python/weka/core/serialization.py | read_all | def read_all(filename):
"""
Reads the serialized objects from disk. Caller must wrap objects in appropriate Python wrapper classes.
:param filename: the file with the serialized objects
:type filename: str
:return: the list of JB_OBjects
:rtype: list
"""
array = javabridge.static_call(
... | python | def read_all(filename):
"""
Reads the serialized objects from disk. Caller must wrap objects in appropriate Python wrapper classes.
:param filename: the file with the serialized objects
:type filename: str
:return: the list of JB_OBjects
:rtype: list
"""
array = javabridge.static_call(
... | [
"def",
"read_all",
"(",
"filename",
")",
":",
"array",
"=",
"javabridge",
".",
"static_call",
"(",
"\"Lweka/core/SerializationHelper;\"",
",",
"\"readAll\"",
",",
"\"(Ljava/lang/String;)[Ljava/lang/Object;\"",
",",
"filename",
")",
"if",
"array",
"is",
"None",
":",
... | Reads the serialized objects from disk. Caller must wrap objects in appropriate Python wrapper classes.
:param filename: the file with the serialized objects
:type filename: str
:return: the list of JB_OBjects
:rtype: list | [
"Reads",
"the",
"serialized",
"objects",
"from",
"disk",
".",
"Caller",
"must",
"wrap",
"objects",
"in",
"appropriate",
"Python",
"wrapper",
"classes",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/serialization.py#L68-L84 |
fracpete/python-weka-wrapper3 | python/weka/core/serialization.py | write | def write(filename, jobject):
"""
Serializes the object to disk. JavaObject instances get automatically unwrapped.
:param filename: the file to serialize the object to
:type filename: str
:param jobject: the object to serialize
:type jobject: JB_Object or JavaObject
"""
if isinstance(jo... | python | def write(filename, jobject):
"""
Serializes the object to disk. JavaObject instances get automatically unwrapped.
:param filename: the file to serialize the object to
:type filename: str
:param jobject: the object to serialize
:type jobject: JB_Object or JavaObject
"""
if isinstance(jo... | [
"def",
"write",
"(",
"filename",
",",
"jobject",
")",
":",
"if",
"isinstance",
"(",
"jobject",
",",
"JavaObject",
")",
":",
"jobject",
"=",
"jobject",
".",
"jobject",
"javabridge",
".",
"static_call",
"(",
"\"Lweka/core/SerializationHelper;\"",
",",
"\"write\"",... | Serializes the object to disk. JavaObject instances get automatically unwrapped.
:param filename: the file to serialize the object to
:type filename: str
:param jobject: the object to serialize
:type jobject: JB_Object or JavaObject | [
"Serializes",
"the",
"object",
"to",
"disk",
".",
"JavaObject",
"instances",
"get",
"automatically",
"unwrapped",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/serialization.py#L87-L101 |
fracpete/python-weka-wrapper3 | python/weka/associations.py | Item.decrease_frequency | def decrease_frequency(self, frequency=None):
"""
Decreases the frequency.
:param frequency: the frequency to decrease by, 1 if None
:type frequency: int
"""
if frequency is None:
javabridge.call(self.jobject, "decreaseFrequency", "()V")
else:
... | python | def decrease_frequency(self, frequency=None):
"""
Decreases the frequency.
:param frequency: the frequency to decrease by, 1 if None
:type frequency: int
"""
if frequency is None:
javabridge.call(self.jobject, "decreaseFrequency", "()V")
else:
... | [
"def",
"decrease_frequency",
"(",
"self",
",",
"frequency",
"=",
"None",
")",
":",
"if",
"frequency",
"is",
"None",
":",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"decreaseFrequency\"",
",",
"\"()V\"",
")",
"else",
":",
"javabridge",
"... | Decreases the frequency.
:param frequency: the frequency to decrease by, 1 if None
:type frequency: int | [
"Decreases",
"the",
"frequency",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/associations.py#L84-L94 |
fracpete/python-weka-wrapper3 | python/weka/associations.py | Item.increase_frequency | def increase_frequency(self, frequency=None):
"""
Increases the frequency.
:param frequency: the frequency to increase by, 1 if None
:type frequency: int
"""
if frequency is None:
javabridge.call(self.jobject, "increaseFrequency", "()V")
else:
... | python | def increase_frequency(self, frequency=None):
"""
Increases the frequency.
:param frequency: the frequency to increase by, 1 if None
:type frequency: int
"""
if frequency is None:
javabridge.call(self.jobject, "increaseFrequency", "()V")
else:
... | [
"def",
"increase_frequency",
"(",
"self",
",",
"frequency",
"=",
"None",
")",
":",
"if",
"frequency",
"is",
"None",
":",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"increaseFrequency\"",
",",
"\"()V\"",
")",
"else",
":",
"javabridge",
"... | Increases the frequency.
:param frequency: the frequency to increase by, 1 if None
:type frequency: int | [
"Increases",
"the",
"frequency",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/associations.py#L96-L106 |
fracpete/python-weka-wrapper3 | python/weka/associations.py | AssociationRule.consequence | def consequence(self):
"""
Get the the consequence.
:return: the consequence, list of Item objects
:rtype: list
"""
items = javabridge.get_collection_wrapper(
javabridge.call(self.jobject, "getConsequence", "()Ljava/util/Collection;"))
result = []
... | python | def consequence(self):
"""
Get the the consequence.
:return: the consequence, list of Item objects
:rtype: list
"""
items = javabridge.get_collection_wrapper(
javabridge.call(self.jobject, "getConsequence", "()Ljava/util/Collection;"))
result = []
... | [
"def",
"consequence",
"(",
"self",
")",
":",
"items",
"=",
"javabridge",
".",
"get_collection_wrapper",
"(",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getConsequence\"",
",",
"\"()Ljava/util/Collection;\"",
")",
")",
"result",
"=",
"[",
"... | Get the the consequence.
:return: the consequence, list of Item objects
:rtype: list | [
"Get",
"the",
"the",
"consequence",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/associations.py#L275-L287 |
fracpete/python-weka-wrapper3 | python/weka/associations.py | Associator.can_produce_rules | def can_produce_rules(self):
"""
Checks whether association rules can be generated.
:return: whether scheme implements AssociationRulesProducer interface and
association rules can be generated
:rtype: bool
"""
if not self.check_type(self.jobject, "weka.associatio... | python | def can_produce_rules(self):
"""
Checks whether association rules can be generated.
:return: whether scheme implements AssociationRulesProducer interface and
association rules can be generated
:rtype: bool
"""
if not self.check_type(self.jobject, "weka.associatio... | [
"def",
"can_produce_rules",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"check_type",
"(",
"self",
".",
"jobject",
",",
"\"weka.associations.AssociationRulesProducer\"",
")",
":",
"return",
"False",
"return",
"javabridge",
".",
"call",
"(",
"self",
".",
"... | Checks whether association rules can be generated.
:return: whether scheme implements AssociationRulesProducer interface and
association rules can be generated
:rtype: bool | [
"Checks",
"whether",
"association",
"rules",
"can",
"be",
"generated",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/associations.py#L552-L562 |
fracpete/python-weka-wrapper3 | python/weka/associations.py | Associator.association_rules | def association_rules(self):
"""
Returns association rules that were generated. Only if implements AssociationRulesProducer.
:return: the association rules that were generated
:rtype: AssociationRules
"""
if not self.check_type(self.jobject, "weka.associations.Associatio... | python | def association_rules(self):
"""
Returns association rules that were generated. Only if implements AssociationRulesProducer.
:return: the association rules that were generated
:rtype: AssociationRules
"""
if not self.check_type(self.jobject, "weka.associations.Associatio... | [
"def",
"association_rules",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"check_type",
"(",
"self",
".",
"jobject",
",",
"\"weka.associations.AssociationRulesProducer\"",
")",
":",
"return",
"None",
"return",
"AssociationRules",
"(",
"javabridge",
".",
"call",... | Returns association rules that were generated. Only if implements AssociationRulesProducer.
:return: the association rules that were generated
:rtype: AssociationRules | [
"Returns",
"association",
"rules",
"that",
"were",
"generated",
".",
"Only",
"if",
"implements",
"AssociationRulesProducer",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/associations.py#L564-L574 |
fracpete/python-weka-wrapper3 | python/weka/associations.py | Associator.rule_metric_names | def rule_metric_names(self):
"""
Returns the rule metric names of the association rules. Only if implements AssociationRulesProducer.
:return: the metric names
:rtype: list
"""
if not self.check_type(self.jobject, "weka.associations.AssociationRulesProducer"):
... | python | def rule_metric_names(self):
"""
Returns the rule metric names of the association rules. Only if implements AssociationRulesProducer.
:return: the metric names
:rtype: list
"""
if not self.check_type(self.jobject, "weka.associations.AssociationRulesProducer"):
... | [
"def",
"rule_metric_names",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"check_type",
"(",
"self",
".",
"jobject",
",",
"\"weka.associations.AssociationRulesProducer\"",
")",
":",
"return",
"None",
"return",
"string_array_to_list",
"(",
"javabridge",
".",
"ca... | Returns the rule metric names of the association rules. Only if implements AssociationRulesProducer.
:return: the metric names
:rtype: list | [
"Returns",
"the",
"rule",
"metric",
"names",
"of",
"the",
"association",
"rules",
".",
"Only",
"if",
"implements",
"AssociationRulesProducer",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/associations.py#L577-L587 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | loader_for_file | def loader_for_file(filename):
"""
Returns a Loader that can load the specified file, based on the file extension. None if failed to determine.
:param filename: the filename to get the loader for
:type filename: str
:return: the assoicated loader instance or None if none found
:rtype: Loader
... | python | def loader_for_file(filename):
"""
Returns a Loader that can load the specified file, based on the file extension. None if failed to determine.
:param filename: the filename to get the loader for
:type filename: str
:return: the assoicated loader instance or None if none found
:rtype: Loader
... | [
"def",
"loader_for_file",
"(",
"filename",
")",
":",
"loader",
"=",
"javabridge",
".",
"static_call",
"(",
"\"weka/core/converters/ConverterUtils\"",
",",
"\"getLoaderForFile\"",
",",
"\"(Ljava/lang/String;)Lweka/core/converters/AbstractFileLoader;\"",
",",
"filename",
")",
"... | Returns a Loader that can load the specified file, based on the file extension. None if failed to determine.
:param filename: the filename to get the loader for
:type filename: str
:return: the assoicated loader instance or None if none found
:rtype: Loader | [
"Returns",
"a",
"Loader",
"that",
"can",
"load",
"the",
"specified",
"file",
"based",
"on",
"the",
"file",
"extension",
".",
"None",
"if",
"failed",
"to",
"determine",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L228-L243 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | saver_for_file | def saver_for_file(filename):
"""
Returns a Saver that can load the specified file, based on the file extension. None if failed to determine.
:param filename: the filename to get the saver for
:type filename: str
:return: the associated saver instance or None if none found
:rtype: Saver
"""... | python | def saver_for_file(filename):
"""
Returns a Saver that can load the specified file, based on the file extension. None if failed to determine.
:param filename: the filename to get the saver for
:type filename: str
:return: the associated saver instance or None if none found
:rtype: Saver
"""... | [
"def",
"saver_for_file",
"(",
"filename",
")",
":",
"saver",
"=",
"javabridge",
".",
"static_call",
"(",
"\"weka/core/converters/ConverterUtils\"",
",",
"\"getSaverForFile\"",
",",
"\"(Ljava/lang/String;)Lweka/core/converters/AbstractFileSaver;\"",
",",
"filename",
")",
"if",... | Returns a Saver that can load the specified file, based on the file extension. None if failed to determine.
:param filename: the filename to get the saver for
:type filename: str
:return: the associated saver instance or None if none found
:rtype: Saver | [
"Returns",
"a",
"Saver",
"that",
"can",
"load",
"the",
"specified",
"file",
"based",
"on",
"the",
"file",
"extension",
".",
"None",
"if",
"failed",
"to",
"determine",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L262-L277 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | save_any_file | def save_any_file(data, filename):
"""
Determines a Saver based on the the file extension. Returns whether successfully saved.
:param filename: the name of the file to save
:type filename: str
:param data: the data to save
:type data: Instances
:return: whether successfully saved
:rtype... | python | def save_any_file(data, filename):
"""
Determines a Saver based on the the file extension. Returns whether successfully saved.
:param filename: the name of the file to save
:type filename: str
:param data: the data to save
:type data: Instances
:return: whether successfully saved
:rtype... | [
"def",
"save_any_file",
"(",
"data",
",",
"filename",
")",
":",
"saver",
"=",
"saver_for_file",
"(",
"filename",
")",
"if",
"saver",
"is",
"None",
":",
"return",
"False",
"else",
":",
"saver",
".",
"save_file",
"(",
"data",
",",
"filename",
")",
"return"... | Determines a Saver based on the the file extension. Returns whether successfully saved.
:param filename: the name of the file to save
:type filename: str
:param data: the data to save
:type data: Instances
:return: whether successfully saved
:rtype: bool | [
"Determines",
"a",
"Saver",
"based",
"on",
"the",
"the",
"file",
"extension",
".",
"Returns",
"whether",
"successfully",
"saved",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L280-L296 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | ndarray_to_instances | def ndarray_to_instances(array, relation, att_template="Att-#", att_list=None):
"""
Converts the numpy matrix into an Instances object and returns it.
:param array: the numpy ndarray to convert
:type array: numpy.darray
:param relation: the name of the dataset
:type relation: str
:param att... | python | def ndarray_to_instances(array, relation, att_template="Att-#", att_list=None):
"""
Converts the numpy matrix into an Instances object and returns it.
:param array: the numpy ndarray to convert
:type array: numpy.darray
:param relation: the name of the dataset
:type relation: str
:param att... | [
"def",
"ndarray_to_instances",
"(",
"array",
",",
"relation",
",",
"att_template",
"=",
"\"Att-#\"",
",",
"att_list",
"=",
"None",
")",
":",
"if",
"len",
"(",
"numpy",
".",
"shape",
"(",
"array",
")",
")",
"!=",
"2",
":",
"raise",
"Exception",
"(",
"\"... | Converts the numpy matrix into an Instances object and returns it.
:param array: the numpy ndarray to convert
:type array: numpy.darray
:param relation: the name of the dataset
:type relation: str
:param att_template: the prefix to use for the attribute names, "#" is the 1-based index,
... | [
"Converts",
"the",
"numpy",
"matrix",
"into",
"an",
"Instances",
"object",
"and",
"returns",
"it",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L299-L340 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | Loader.load_file | def load_file(self, dfile, incremental=False):
"""
Loads the specified file and returns the Instances object.
In case of incremental loading, only the structure.
:param dfile: the file to load
:type dfile: str
:param incremental: whether to load the dataset incrementally... | python | def load_file(self, dfile, incremental=False):
"""
Loads the specified file and returns the Instances object.
In case of incremental loading, only the structure.
:param dfile: the file to load
:type dfile: str
:param incremental: whether to load the dataset incrementally... | [
"def",
"load_file",
"(",
"self",
",",
"dfile",
",",
"incremental",
"=",
"False",
")",
":",
"self",
".",
"enforce_type",
"(",
"self",
".",
"jobject",
",",
"\"weka.core.converters.FileSourcedConverter\"",
")",
"self",
".",
"incremental",
"=",
"incremental",
"if",
... | Loads the specified file and returns the Instances object.
In case of incremental loading, only the structure.
:param dfile: the file to load
:type dfile: str
:param incremental: whether to load the dataset incrementally
:type incremental: bool
:return: the full dataset ... | [
"Loads",
"the",
"specified",
"file",
"and",
"returns",
"the",
"Instances",
"object",
".",
"In",
"case",
"of",
"incremental",
"loading",
"only",
"the",
"structure",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L60-L88 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | Loader.load_url | def load_url(self, url, incremental=False):
"""
Loads the specified URL and returns the Instances object.
In case of incremental loading, only the structure.
:param url: the URL to load the data from
:type url: str
:param incremental: whether to load the dataset incremen... | python | def load_url(self, url, incremental=False):
"""
Loads the specified URL and returns the Instances object.
In case of incremental loading, only the structure.
:param url: the URL to load the data from
:type url: str
:param incremental: whether to load the dataset incremen... | [
"def",
"load_url",
"(",
"self",
",",
"url",
",",
"incremental",
"=",
"False",
")",
":",
"self",
".",
"enforce_type",
"(",
"self",
".",
"jobject",
",",
"\"weka.core.converters.URLSourcedLoader\"",
")",
"self",
".",
"incremental",
"=",
"incremental",
"javabridge",... | Loads the specified URL and returns the Instances object.
In case of incremental loading, only the structure.
:param url: the URL to load the data from
:type url: str
:param incremental: whether to load the dataset incrementally
:type incremental: bool
:return: the full ... | [
"Loads",
"the",
"specified",
"URL",
"and",
"returns",
"the",
"Instances",
"object",
".",
"In",
"case",
"of",
"incremental",
"loading",
"only",
"the",
"structure",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L90-L110 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | TextDirectoryLoader.load | def load(self):
"""
Loads the text files from the specified directory and returns the Instances object.
In case of incremental loading, only the structure.
:return: the full dataset or the header (if incremental)
:rtype: Instances
"""
javabridge.call(self.jobject... | python | def load(self):
"""
Loads the text files from the specified directory and returns the Instances object.
In case of incremental loading, only the structure.
:return: the full dataset or the header (if incremental)
:rtype: Instances
"""
javabridge.call(self.jobject... | [
"def",
"load",
"(",
"self",
")",
":",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"reset\"",
",",
"\"()V\"",
")",
"return",
"Instances",
"(",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getDataSet\"",
",",
"\"()Lwek... | Loads the text files from the specified directory and returns the Instances object.
In case of incremental loading, only the structure.
:return: the full dataset or the header (if incremental)
:rtype: Instances | [
"Loads",
"the",
"text",
"files",
"from",
"the",
"specified",
"directory",
"and",
"returns",
"the",
"Instances",
"object",
".",
"In",
"case",
"of",
"incremental",
"loading",
"only",
"the",
"structure",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L168-L177 |
fracpete/python-weka-wrapper3 | python/weka/core/converters.py | Saver.save_file | def save_file(self, data, dfile):
"""
Saves the Instances object in the specified file.
:param data: the data to save
:type data: Instances
:param dfile: the file to save the data to
:type dfile: str
"""
self.enforce_type(self.jobject, "weka.core.converte... | python | def save_file(self, data, dfile):
"""
Saves the Instances object in the specified file.
:param data: the data to save
:type data: Instances
:param dfile: the file to save the data to
:type dfile: str
"""
self.enforce_type(self.jobject, "weka.core.converte... | [
"def",
"save_file",
"(",
"self",
",",
"data",
",",
"dfile",
")",
":",
"self",
".",
"enforce_type",
"(",
"self",
".",
"jobject",
",",
"\"weka.core.converters.FileSourcedConverter\"",
")",
"if",
"not",
"javabridge",
".",
"is_instance_of",
"(",
"dfile",
",",
"\"L... | Saves the Instances object in the specified file.
:param data: the data to save
:type data: Instances
:param dfile: the file to save the data to
:type dfile: str | [
"Saves",
"the",
"Instances",
"object",
"in",
"the",
"specified",
"file",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/converters.py#L210-L225 |
fracpete/python-weka-wrapper3 | python/weka/core/typeconv.py | string_array_to_list | def string_array_to_list(a):
"""
Turns the Java string array into Python unicode string list.
:param a: the string array to convert
:type a: JB_Object
:return: the string list
:rtype: list
"""
result = []
length = javabridge.get_env().get_array_length(a)
wrapped = javabridge.get... | python | def string_array_to_list(a):
"""
Turns the Java string array into Python unicode string list.
:param a: the string array to convert
:type a: JB_Object
:return: the string list
:rtype: list
"""
result = []
length = javabridge.get_env().get_array_length(a)
wrapped = javabridge.get... | [
"def",
"string_array_to_list",
"(",
"a",
")",
":",
"result",
"=",
"[",
"]",
"length",
"=",
"javabridge",
".",
"get_env",
"(",
")",
".",
"get_array_length",
"(",
"a",
")",
"wrapped",
"=",
"javabridge",
".",
"get_env",
"(",
")",
".",
"get_object_array_elemen... | Turns the Java string array into Python unicode string list.
:param a: the string array to convert
:type a: JB_Object
:return: the string list
:rtype: list | [
"Turns",
"the",
"Java",
"string",
"array",
"into",
"Python",
"unicode",
"string",
"list",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/typeconv.py#L25-L39 |
fracpete/python-weka-wrapper3 | python/weka/core/typeconv.py | string_list_to_array | def string_list_to_array(l):
"""
Turns a Python unicode string list into a Java String array.
:param l: the string list
:type: list
:rtype: java string array
:return: JB_Object
"""
result = javabridge.get_env().make_object_array(len(l), javabridge.get_env().find_class("java/lang/String"... | python | def string_list_to_array(l):
"""
Turns a Python unicode string list into a Java String array.
:param l: the string list
:type: list
:rtype: java string array
:return: JB_Object
"""
result = javabridge.get_env().make_object_array(len(l), javabridge.get_env().find_class("java/lang/String"... | [
"def",
"string_list_to_array",
"(",
"l",
")",
":",
"result",
"=",
"javabridge",
".",
"get_env",
"(",
")",
".",
"make_object_array",
"(",
"len",
"(",
"l",
")",
",",
"javabridge",
".",
"get_env",
"(",
")",
".",
"find_class",
"(",
"\"java/lang/String\"",
")",... | Turns a Python unicode string list into a Java String array.
:param l: the string list
:type: list
:rtype: java string array
:return: JB_Object | [
"Turns",
"a",
"Python",
"unicode",
"string",
"list",
"into",
"a",
"Java",
"String",
"array",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/typeconv.py#L42-L54 |
fracpete/python-weka-wrapper3 | python/weka/core/typeconv.py | double_matrix_to_ndarray | def double_matrix_to_ndarray(m):
"""
Turns the Java matrix (2-dim array) of doubles into a numpy 2-dim array.
:param m: the double matrix
:type: JB_Object
:return: Numpy array
:rtype: numpy.darray
"""
rows = javabridge.get_env().get_object_array_elements(m)
num_rows = len(rows)
... | python | def double_matrix_to_ndarray(m):
"""
Turns the Java matrix (2-dim array) of doubles into a numpy 2-dim array.
:param m: the double matrix
:type: JB_Object
:return: Numpy array
:rtype: numpy.darray
"""
rows = javabridge.get_env().get_object_array_elements(m)
num_rows = len(rows)
... | [
"def",
"double_matrix_to_ndarray",
"(",
"m",
")",
":",
"rows",
"=",
"javabridge",
".",
"get_env",
"(",
")",
".",
"get_object_array_elements",
"(",
"m",
")",
"num_rows",
"=",
"len",
"(",
"rows",
")",
"num_cols",
"=",
"javabridge",
".",
"get_env",
"(",
")",
... | Turns the Java matrix (2-dim array) of doubles into a numpy 2-dim array.
:param m: the double matrix
:type: JB_Object
:return: Numpy array
:rtype: numpy.darray | [
"Turns",
"the",
"Java",
"matrix",
"(",
"2",
"-",
"dim",
"array",
")",
"of",
"doubles",
"into",
"a",
"numpy",
"2",
"-",
"dim",
"array",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/typeconv.py#L57-L78 |
fracpete/python-weka-wrapper3 | python/weka/core/typeconv.py | enumeration_to_list | def enumeration_to_list(enm):
"""
Turns the java.util.Enumeration into a list.
:param enm: the enumeration to convert
:type enm: JB_Object
:return: the list
:rtype: list
"""
result = []
while javabridge.call(enm, "hasMoreElements", "()Z"):
result.append(javabridge.call(enm, ... | python | def enumeration_to_list(enm):
"""
Turns the java.util.Enumeration into a list.
:param enm: the enumeration to convert
:type enm: JB_Object
:return: the list
:rtype: list
"""
result = []
while javabridge.call(enm, "hasMoreElements", "()Z"):
result.append(javabridge.call(enm, ... | [
"def",
"enumeration_to_list",
"(",
"enm",
")",
":",
"result",
"=",
"[",
"]",
"while",
"javabridge",
".",
"call",
"(",
"enm",
",",
"\"hasMoreElements\"",
",",
"\"()Z\"",
")",
":",
"result",
".",
"append",
"(",
"javabridge",
".",
"call",
"(",
"enm",
",",
... | Turns the java.util.Enumeration into a list.
:param enm: the enumeration to convert
:type enm: JB_Object
:return: the list
:rtype: list | [
"Turns",
"the",
"java",
".",
"util",
".",
"Enumeration",
"into",
"a",
"list",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/typeconv.py#L81-L93 |
fracpete/python-weka-wrapper3 | python/weka/attribute_selection.py | main | def main():
"""
Runs attribute selection from the command-line. Calls JVM start/stop automatically.
Use -h to see all options.
"""
parser = argparse.ArgumentParser(
description='Performs attribute selection from the command-line. Calls JVM start/stop automatically.')
parser.add_argument(... | python | def main():
"""
Runs attribute selection from the command-line. Calls JVM start/stop automatically.
Use -h to see all options.
"""
parser = argparse.ArgumentParser(
description='Performs attribute selection from the command-line. Calls JVM start/stop automatically.')
parser.add_argument(... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Performs attribute selection from the command-line. Calls JVM start/stop automatically.'",
")",
"parser",
".",
"add_argument",
"(",
"\"-j\"",
",",
"metavar",
"=",
... | Runs attribute selection from the command-line. Calls JVM start/stop automatically.
Use -h to see all options. | [
"Runs",
"attribute",
"selection",
"from",
"the",
"command",
"-",
"line",
".",
"Calls",
"JVM",
"start",
"/",
"stop",
"automatically",
".",
"Use",
"-",
"h",
"to",
"see",
"all",
"options",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/attribute_selection.py#L310-L354 |
fracpete/python-weka-wrapper3 | python/weka/attribute_selection.py | ASSearch.search | def search(self, evaluation, data):
"""
Performs the search and returns the indices of the selected attributes.
:param evaluation: the evaluation algorithm to use
:type evaluation: ASEvaluation
:param data: the data to use
:type data: Instances
:return: the selec... | python | def search(self, evaluation, data):
"""
Performs the search and returns the indices of the selected attributes.
:param evaluation: the evaluation algorithm to use
:type evaluation: ASEvaluation
:param data: the data to use
:type data: Instances
:return: the selec... | [
"def",
"search",
"(",
"self",
",",
"evaluation",
",",
"data",
")",
":",
"array",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"search\"",
",",
"\"(Lweka/attributeSelection/ASEvaluation;Lweka/core/Instances;)[I\"",
",",
"evaluation",
".",
"jo... | Performs the search and returns the indices of the selected attributes.
:param evaluation: the evaluation algorithm to use
:type evaluation: ASEvaluation
:param data: the data to use
:type data: Instances
:return: the selected attributes (0-based indices)
:rtype: ndarray | [
"Performs",
"the",
"search",
"and",
"returns",
"the",
"indices",
"of",
"the",
"selected",
"attributes",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/attribute_selection.py#L54-L71 |
fracpete/python-weka-wrapper3 | python/weka/attribute_selection.py | ASEvaluation.post_process | def post_process(self, indices):
"""
Post-processes the evaluator with the selected attribute indices.
:param indices: the attribute indices list to use
:type indices: ndarray
:return: the processed indices
:rtype: ndarray
"""
array = javabridge.call(self... | python | def post_process(self, indices):
"""
Post-processes the evaluator with the selected attribute indices.
:param indices: the attribute indices list to use
:type indices: ndarray
:return: the processed indices
:rtype: ndarray
"""
array = javabridge.call(self... | [
"def",
"post_process",
"(",
"self",
",",
"indices",
")",
":",
"array",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"postProcess\"",
",",
"\"([I)[I\"",
",",
"indices",
")",
"if",
"array",
"is",
"None",
":",
"return",
"None",
"else"... | Post-processes the evaluator with the selected attribute indices.
:param indices: the attribute indices list to use
:type indices: ndarray
:return: the processed indices
:rtype: ndarray | [
"Post",
"-",
"processes",
"the",
"evaluator",
"with",
"the",
"selected",
"attribute",
"indices",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/attribute_selection.py#L114-L127 |
fracpete/python-weka-wrapper3 | python/weka/attribute_selection.py | AttributeSelection.selected_attributes | def selected_attributes(self):
"""
Returns the selected attributes from the last run.
:return: the Numpy array of 0-based indices
:rtype: ndarray
"""
array = javabridge.call(self.jobject, "selectedAttributes", "()[I")
if array is None:
return None
... | python | def selected_attributes(self):
"""
Returns the selected attributes from the last run.
:return: the Numpy array of 0-based indices
:rtype: ndarray
"""
array = javabridge.call(self.jobject, "selectedAttributes", "()[I")
if array is None:
return None
... | [
"def",
"selected_attributes",
"(",
"self",
")",
":",
"array",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"selectedAttributes\"",
",",
"\"()[I\"",
")",
"if",
"array",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"java... | Returns the selected attributes from the last run.
:return: the Numpy array of 0-based indices
:rtype: ndarray | [
"Returns",
"the",
"selected",
"attributes",
"from",
"the",
"last",
"run",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/attribute_selection.py#L215-L226 |
fracpete/python-weka-wrapper3 | python/weka/attribute_selection.py | AttributeSelection.ranked_attributes | def ranked_attributes(self):
"""
Returns the matrix of ranked attributes from the last run.
:return: the Numpy matrix
:rtype: ndarray
"""
matrix = javabridge.call(self.jobject, "rankedAttributes", "()[[D")
if matrix is None:
return None
else:
... | python | def ranked_attributes(self):
"""
Returns the matrix of ranked attributes from the last run.
:return: the Numpy matrix
:rtype: ndarray
"""
matrix = javabridge.call(self.jobject, "rankedAttributes", "()[[D")
if matrix is None:
return None
else:
... | [
"def",
"ranked_attributes",
"(",
"self",
")",
":",
"matrix",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"rankedAttributes\"",
",",
"\"()[[D\"",
")",
"if",
"matrix",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"typec... | Returns the matrix of ranked attributes from the last run.
:return: the Numpy matrix
:rtype: ndarray | [
"Returns",
"the",
"matrix",
"of",
"ranked",
"attributes",
"from",
"the",
"last",
"run",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/attribute_selection.py#L259-L270 |
fracpete/python-weka-wrapper3 | python/weka/attribute_selection.py | AttributeSelection.reduce_dimensionality | def reduce_dimensionality(self, data):
"""
Reduces the dimensionality of the provided Instance or Instances object.
:param data: the data to process
:type data: Instances
:return: the reduced dataset
:rtype: Instances
"""
if type(data) is Instance:
... | python | def reduce_dimensionality(self, data):
"""
Reduces the dimensionality of the provided Instance or Instances object.
:param data: the data to process
:type data: Instances
:return: the reduced dataset
:rtype: Instances
"""
if type(data) is Instance:
... | [
"def",
"reduce_dimensionality",
"(",
"self",
",",
"data",
")",
":",
"if",
"type",
"(",
"data",
")",
"is",
"Instance",
":",
"return",
"Instance",
"(",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"reduceDimensionality\"",
",",
"\"(Lweka/core... | Reduces the dimensionality of the provided Instance or Instances object.
:param data: the data to process
:type data: Instances
:return: the reduced dataset
:rtype: Instances | [
"Reduces",
"the",
"dimensionality",
"of",
"the",
"provided",
"Instance",
"or",
"Instances",
"object",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/attribute_selection.py#L272-L290 |
fracpete/python-weka-wrapper3 | python/weka/plot/classifiers.py | generate_thresholdcurve_data | def generate_thresholdcurve_data(evaluation, class_index):
"""
Generates the threshold curve data from the evaluation object's predictions.
:param evaluation: the evaluation to obtain the predictions from
:type evaluation: Evaluation
:param class_index: the 0-based index of the class-label to creat... | python | def generate_thresholdcurve_data(evaluation, class_index):
"""
Generates the threshold curve data from the evaluation object's predictions.
:param evaluation: the evaluation to obtain the predictions from
:type evaluation: Evaluation
:param class_index: the 0-based index of the class-label to creat... | [
"def",
"generate_thresholdcurve_data",
"(",
"evaluation",
",",
"class_index",
")",
":",
"jtc",
"=",
"JavaObject",
".",
"new_instance",
"(",
"\"weka.classifiers.evaluation.ThresholdCurve\"",
")",
"pred",
"=",
"javabridge",
".",
"call",
"(",
"evaluation",
".",
"jobject"... | Generates the threshold curve data from the evaluation object's predictions.
:param evaluation: the evaluation to obtain the predictions from
:type evaluation: Evaluation
:param class_index: the 0-based index of the class-label to create the plot for
:type class_index: int
:return: the generated th... | [
"Generates",
"the",
"threshold",
"curve",
"data",
"from",
"the",
"evaluation",
"object",
"s",
"predictions",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/classifiers.py#L101-L116 |
fracpete/python-weka-wrapper3 | python/weka/plot/classifiers.py | get_thresholdcurve_data | def get_thresholdcurve_data(data, xname, yname):
"""
Retrieves x and y columns from of the data generated by the weka.classifiers.evaluation.ThresholdCurve
class.
:param data: the threshold curve data
:type data: Instances
:param xname: the name of the X column
:type xname: str
:param ... | python | def get_thresholdcurve_data(data, xname, yname):
"""
Retrieves x and y columns from of the data generated by the weka.classifiers.evaluation.ThresholdCurve
class.
:param data: the threshold curve data
:type data: Instances
:param xname: the name of the X column
:type xname: str
:param ... | [
"def",
"get_thresholdcurve_data",
"(",
"data",
",",
"xname",
",",
"yname",
")",
":",
"xi",
"=",
"data",
".",
"attribute_by_name",
"(",
"xname",
")",
".",
"index",
"yi",
"=",
"data",
".",
"attribute_by_name",
"(",
"yname",
")",
".",
"index",
"x",
"=",
"... | Retrieves x and y columns from of the data generated by the weka.classifiers.evaluation.ThresholdCurve
class.
:param data: the threshold curve data
:type data: Instances
:param xname: the name of the X column
:type xname: str
:param yname: the name of the Y column
:type yname: str
:ret... | [
"Retrieves",
"x",
"and",
"y",
"columns",
"from",
"of",
"the",
"data",
"generated",
"by",
"the",
"weka",
".",
"classifiers",
".",
"evaluation",
".",
"ThresholdCurve",
"class",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/classifiers.py#L119-L141 |
fracpete/python-weka-wrapper3 | python/weka/plot/classifiers.py | plot_roc | def plot_roc(evaluation, class_index=None, title=None, key_loc="lower right", outfile=None, wait=True):
"""
Plots the ROC (receiver operator characteristics) curve for the given predictions.
TODO: click events http://matplotlib.org/examples/event_handling/data_browser.html
:param evaluation: the evalu... | python | def plot_roc(evaluation, class_index=None, title=None, key_loc="lower right", outfile=None, wait=True):
"""
Plots the ROC (receiver operator characteristics) curve for the given predictions.
TODO: click events http://matplotlib.org/examples/event_handling/data_browser.html
:param evaluation: the evalu... | [
"def",
"plot_roc",
"(",
"evaluation",
",",
"class_index",
"=",
"None",
",",
"title",
"=",
"None",
",",
"key_loc",
"=",
"\"lower right\"",
",",
"outfile",
"=",
"None",
",",
"wait",
"=",
"True",
")",
":",
"if",
"not",
"plot",
".",
"matplotlib_available",
"... | Plots the ROC (receiver operator characteristics) curve for the given predictions.
TODO: click events http://matplotlib.org/examples/event_handling/data_browser.html
:param evaluation: the evaluation to obtain the predictions from
:type evaluation: Evaluation
:param class_index: the list of 0-based in... | [
"Plots",
"the",
"ROC",
"(",
"receiver",
"operator",
"characteristics",
")",
"curve",
"for",
"the",
"given",
"predictions",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/classifiers.py#L170-L219 |
fracpete/python-weka-wrapper3 | python/weka/plot/classifiers.py | plot_learning_curve | def plot_learning_curve(classifiers, train, test=None, increments=100, metric="percent_correct",
title="Learning curve", label_template="[#] @ $", key_loc="lower right",
outfile=None, wait=True):
"""
Plots a learning curve.
:param classifiers: list of Classif... | python | def plot_learning_curve(classifiers, train, test=None, increments=100, metric="percent_correct",
title="Learning curve", label_template="[#] @ $", key_loc="lower right",
outfile=None, wait=True):
"""
Plots a learning curve.
:param classifiers: list of Classif... | [
"def",
"plot_learning_curve",
"(",
"classifiers",
",",
"train",
",",
"test",
"=",
"None",
",",
"increments",
"=",
"100",
",",
"metric",
"=",
"\"percent_correct\"",
",",
"title",
"=",
"\"Learning curve\"",
",",
"label_template",
"=",
"\"[#] @ $\"",
",",
"key_loc"... | Plots a learning curve.
:param classifiers: list of Classifier template objects
:type classifiers: list of Classifier
:param train: dataset to use for the building the classifier, used for evaluating it test set None
:type train: Instances
:param test: optional dataset (or list of datasets) to use ... | [
"Plots",
"a",
"learning",
"curve",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/classifiers.py#L274-L388 |
fracpete/python-weka-wrapper3 | python/weka/core/packages.py | all_packages | def all_packages():
"""
Returns a list of all packages.
:return: the list of packages
:rtype: list
"""
establish_cache()
result = []
pkgs = javabridge.get_collection_wrapper(
javabridge.static_call(
"weka/core/WekaPackageManager", "getAllPackages", "()Ljava/util/List... | python | def all_packages():
"""
Returns a list of all packages.
:return: the list of packages
:rtype: list
"""
establish_cache()
result = []
pkgs = javabridge.get_collection_wrapper(
javabridge.static_call(
"weka/core/WekaPackageManager", "getAllPackages", "()Ljava/util/List... | [
"def",
"all_packages",
"(",
")",
":",
"establish_cache",
"(",
")",
"result",
"=",
"[",
"]",
"pkgs",
"=",
"javabridge",
".",
"get_collection_wrapper",
"(",
"javabridge",
".",
"static_call",
"(",
"\"weka/core/WekaPackageManager\"",
",",
"\"getAllPackages\"",
",",
"\... | Returns a list of all packages.
:return: the list of packages
:rtype: list | [
"Returns",
"a",
"list",
"of",
"all",
"packages",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/packages.py#L228-L242 |
fracpete/python-weka-wrapper3 | python/weka/core/packages.py | install_package | def install_package(pkge, version="Latest"):
"""
The list of packages to install.
:param pkge: the name of the repository package, a URL (http/https) or a zip file
:type pkge: str
:param version: in case of the repository packages, the version
:type version: str
:return: whether successfull... | python | def install_package(pkge, version="Latest"):
"""
The list of packages to install.
:param pkge: the name of the repository package, a URL (http/https) or a zip file
:type pkge: str
:param version: in case of the repository packages, the version
:type version: str
:return: whether successfull... | [
"def",
"install_package",
"(",
"pkge",
",",
"version",
"=",
"\"Latest\"",
")",
":",
"establish_cache",
"(",
")",
"if",
"pkge",
".",
"startswith",
"(",
"\"http://\"",
")",
"or",
"pkge",
".",
"startswith",
"(",
"\"https://\"",
")",
":",
"url",
"=",
"javabrid... | The list of packages to install.
:param pkge: the name of the repository package, a URL (http/https) or a zip file
:type pkge: str
:param version: in case of the repository packages, the version
:type version: str
:return: whether successfully installed
:rtype: bool | [
"The",
"list",
"of",
"packages",
"to",
"install",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/packages.py#L279-L304 |
fracpete/python-weka-wrapper3 | python/weka/core/packages.py | is_installed | def is_installed(name):
"""
Checks whether a package with the name is already installed.
:param name: the name of the package
:type name: str
:return: whether the package is installed
:rtype: bool
"""
pkgs = installed_packages()
for pkge in pkgs:
if pkge.name == name:
... | python | def is_installed(name):
"""
Checks whether a package with the name is already installed.
:param name: the name of the package
:type name: str
:return: whether the package is installed
:rtype: bool
"""
pkgs = installed_packages()
for pkge in pkgs:
if pkge.name == name:
... | [
"def",
"is_installed",
"(",
"name",
")",
":",
"pkgs",
"=",
"installed_packages",
"(",
")",
"for",
"pkge",
"in",
"pkgs",
":",
"if",
"pkge",
".",
"name",
"==",
"name",
":",
"return",
"True",
"return",
"False"
] | Checks whether a package with the name is already installed.
:param name: the name of the package
:type name: str
:return: whether the package is installed
:rtype: bool | [
"Checks",
"whether",
"a",
"package",
"with",
"the",
"name",
"is",
"already",
"installed",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/packages.py#L322-L335 |
fracpete/python-weka-wrapper3 | python/weka/core/packages.py | Package.dependencies | def dependencies(self):
"""
Returns the dependencies of the package.
:return: the list of Dependency objects
:rtype: list of Dependency
"""
result = []
dependencies = javabridge.get_collection_wrapper(
javabridge.call(self.jobject, "getDependencies", ... | python | def dependencies(self):
"""
Returns the dependencies of the package.
:return: the list of Dependency objects
:rtype: list of Dependency
"""
result = []
dependencies = javabridge.get_collection_wrapper(
javabridge.call(self.jobject, "getDependencies", ... | [
"def",
"dependencies",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"dependencies",
"=",
"javabridge",
".",
"get_collection_wrapper",
"(",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getDependencies\"",
",",
"\"()Ljava/util/List;\"",
")",
... | Returns the dependencies of the package.
:return: the list of Dependency objects
:rtype: list of Dependency | [
"Returns",
"the",
"dependencies",
"of",
"the",
"package",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/packages.py#L58-L70 |
fracpete/python-weka-wrapper3 | python/weka/core/packages.py | PackageConstraint.check_constraint | def check_constraint(self, pkge=None, constr=None):
"""
Checks the constraints.
:param pkge: the package to check
:type pkge: Package
:param constr: the package constraint to check
:type constr: PackageConstraint
"""
if not pkge is None:
retur... | python | def check_constraint(self, pkge=None, constr=None):
"""
Checks the constraints.
:param pkge: the package to check
:type pkge: Package
:param constr: the package constraint to check
:type constr: PackageConstraint
"""
if not pkge is None:
retur... | [
"def",
"check_constraint",
"(",
"self",
",",
"pkge",
"=",
"None",
",",
"constr",
"=",
"None",
")",
":",
"if",
"not",
"pkge",
"is",
"None",
":",
"return",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"checkConstraint\"",
",",
"\"(Lweka/c... | Checks the constraints.
:param pkge: the package to check
:type pkge: Package
:param constr: the package constraint to check
:type constr: PackageConstraint | [
"Checks",
"the",
"constraints",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/packages.py#L133-L148 |
fracpete/python-weka-wrapper3 | python/weka/core/database.py | InstanceQuery.custom_properties | def custom_properties(self, props):
"""
Sets the custom properties file to use.
:param props: the props file
:type props: str
"""
fprops = javabridge.make_instance("java/io/File", "(Ljava/lang/String;)V", props)
javabridge.call(self.jobject, "setCustomPropsFile",... | python | def custom_properties(self, props):
"""
Sets the custom properties file to use.
:param props: the props file
:type props: str
"""
fprops = javabridge.make_instance("java/io/File", "(Ljava/lang/String;)V", props)
javabridge.call(self.jobject, "setCustomPropsFile",... | [
"def",
"custom_properties",
"(",
"self",
",",
"props",
")",
":",
"fprops",
"=",
"javabridge",
".",
"make_instance",
"(",
"\"java/io/File\"",
",",
"\"(Ljava/lang/String;)V\"",
",",
"props",
")",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"se... | Sets the custom properties file to use.
:param props: the props file
:type props: str | [
"Sets",
"the",
"custom",
"properties",
"file",
"to",
"use",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/database.py#L132-L140 |
fracpete/python-weka-wrapper3 | python/weka/core/database.py | InstanceQuery.retrieve_instances | def retrieve_instances(self, query=None):
"""
Executes either the supplied query or the one set via options (or the 'query' property).
:param query: query to execute if not the currently set one
:type query: str
:return: the generated dataq
:rtype: Instances
"""
... | python | def retrieve_instances(self, query=None):
"""
Executes either the supplied query or the one set via options (or the 'query' property).
:param query: query to execute if not the currently set one
:type query: str
:return: the generated dataq
:rtype: Instances
"""
... | [
"def",
"retrieve_instances",
"(",
"self",
",",
"query",
"=",
"None",
")",
":",
"if",
"query",
"is",
"None",
":",
"data",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"retrieveInstances\"",
",",
"\"()Lweka/core/Instances;\"",
")",
"else... | Executes either the supplied query or the one set via options (or the 'query' property).
:param query: query to execute if not the currently set one
:type query: str
:return: the generated dataq
:rtype: Instances | [
"Executes",
"either",
"the",
"supplied",
"query",
"or",
"the",
"one",
"set",
"via",
"options",
"(",
"or",
"the",
"query",
"property",
")",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/database.py#L182-L195 |
fracpete/python-weka-wrapper3 | python/weka/core/capabilities.py | Capabilities.owner | def owner(self):
"""
Returns the owner of these capabilities, if any.
:return: the owner, can be None
:rtype: JavaObject
"""
obj = javabridge.call(self.jobject, "getOwner", "()Lweka/core/CapabilitiesHandler;")
if obj is None:
return None
else:... | python | def owner(self):
"""
Returns the owner of these capabilities, if any.
:return: the owner, can be None
:rtype: JavaObject
"""
obj = javabridge.call(self.jobject, "getOwner", "()Lweka/core/CapabilitiesHandler;")
if obj is None:
return None
else:... | [
"def",
"owner",
"(",
"self",
")",
":",
"obj",
"=",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getOwner\"",
",",
"\"()Lweka/core/CapabilitiesHandler;\"",
")",
"if",
"obj",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"Jav... | Returns the owner of these capabilities, if any.
:return: the owner, can be None
:rtype: JavaObject | [
"Returns",
"the",
"owner",
"of",
"these",
"capabilities",
"if",
"any",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/capabilities.py#L113-L124 |
fracpete/python-weka-wrapper3 | python/weka/core/capabilities.py | Capabilities.dependencies | def dependencies(self):
"""
Returns all the dependencies.
:return: the dependency list
:rtype: list
"""
result = []
iterator = javabridge.iterate_java(javabridge.call(self.jobject, "dependencies", "()Ljava/util/Iterator;"))
for c in iterator:
... | python | def dependencies(self):
"""
Returns all the dependencies.
:return: the dependency list
:rtype: list
"""
result = []
iterator = javabridge.iterate_java(javabridge.call(self.jobject, "dependencies", "()Ljava/util/Iterator;"))
for c in iterator:
... | [
"def",
"dependencies",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"iterator",
"=",
"javabridge",
".",
"iterate_java",
"(",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"dependencies\"",
",",
"\"()Ljava/util/Iterator;\"",
")",
")",
"for... | Returns all the dependencies.
:return: the dependency list
:rtype: list | [
"Returns",
"all",
"the",
"dependencies",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/capabilities.py#L181-L192 |
fracpete/python-weka-wrapper3 | python/weka/core/capabilities.py | Capabilities.for_instances | def for_instances(cls, data, multi=None):
"""
returns a Capabilities object specific for this data. The minimum number of instances is not set, the check
for multi-instance data is optional.
:param data: the data to generate the capabilities for
:type data: Instances
:pa... | python | def for_instances(cls, data, multi=None):
"""
returns a Capabilities object specific for this data. The minimum number of instances is not set, the check
for multi-instance data is optional.
:param data: the data to generate the capabilities for
:type data: Instances
:pa... | [
"def",
"for_instances",
"(",
"cls",
",",
"data",
",",
"multi",
"=",
"None",
")",
":",
"if",
"multi",
"is",
"None",
":",
"return",
"Capabilities",
"(",
"javabridge",
".",
"static_call",
"(",
"\"weka/core/Capabilities\"",
",",
"\"forInstances\"",
",",
"\"(Lweka/... | returns a Capabilities object specific for this data. The minimum number of instances is not set, the check
for multi-instance data is optional.
:param data: the data to generate the capabilities for
:type data: Instances
:param multi: whether to check the structure, too
:type m... | [
"returns",
"a",
"Capabilities",
"object",
"specific",
"for",
"this",
"data",
".",
"The",
"minimum",
"number",
"of",
"instances",
"is",
"not",
"set",
"the",
"check",
"for",
"multi",
"-",
"instance",
"data",
"is",
"optional",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/capabilities.py#L428-L447 |
fracpete/python-weka-wrapper3 | python/weka/plot/dataset.py | scatter_plot | def scatter_plot(data, index_x, index_y, percent=100.0, seed=1, size=50, title=None, outfile=None, wait=True):
"""
Plots two attributes against each other.
TODO: click events http://matplotlib.org/examples/event_handling/data_browser.html
:param data: the dataset
:type data: Instances
:param i... | python | def scatter_plot(data, index_x, index_y, percent=100.0, seed=1, size=50, title=None, outfile=None, wait=True):
"""
Plots two attributes against each other.
TODO: click events http://matplotlib.org/examples/event_handling/data_browser.html
:param data: the dataset
:type data: Instances
:param i... | [
"def",
"scatter_plot",
"(",
"data",
",",
"index_x",
",",
"index_y",
",",
"percent",
"=",
"100.0",
",",
"seed",
"=",
"1",
",",
"size",
"=",
"50",
",",
"title",
"=",
"None",
",",
"outfile",
"=",
"None",
",",
"wait",
"=",
"True",
")",
":",
"if",
"no... | Plots two attributes against each other.
TODO: click events http://matplotlib.org/examples/event_handling/data_browser.html
:param data: the dataset
:type data: Instances
:param index_x: the 0-based index of the attribute on the x axis
:type index_x: int
:param index_y: the 0-based index of th... | [
"Plots",
"two",
"attributes",
"against",
"each",
"other",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/dataset.py#L27-L93 |
fracpete/python-weka-wrapper3 | python/weka/plot/dataset.py | line_plot | def line_plot(data, atts=None, percent=100.0, seed=1, title=None, outfile=None, wait=True):
"""
Uses the internal format to plot the dataset, one line per instance.
:param data: the dataset
:type data: Instances
:param atts: the list of 0-based attribute indices of attributes to plot
:type atts... | python | def line_plot(data, atts=None, percent=100.0, seed=1, title=None, outfile=None, wait=True):
"""
Uses the internal format to plot the dataset, one line per instance.
:param data: the dataset
:type data: Instances
:param atts: the list of 0-based attribute indices of attributes to plot
:type atts... | [
"def",
"line_plot",
"(",
"data",
",",
"atts",
"=",
"None",
",",
"percent",
"=",
"100.0",
",",
"seed",
"=",
"1",
",",
"title",
"=",
"None",
",",
"outfile",
"=",
"None",
",",
"wait",
"=",
"True",
")",
":",
"if",
"not",
"plot",
".",
"matplotlib_availa... | Uses the internal format to plot the dataset, one line per instance.
:param data: the dataset
:type data: Instances
:param atts: the list of 0-based attribute indices of attributes to plot
:type atts: list
:param percent: the percentage of the dataset to use for plotting
:type percent: float
... | [
"Uses",
"the",
"internal",
"format",
"to",
"plot",
"the",
"dataset",
"one",
"line",
"per",
"instance",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/dataset.py#L168-L221 |
fracpete/python-weka-wrapper3 | python/weka/filters.py | Filter.filter | def filter(self, data):
"""
Filters the dataset(s). When providing a list, this can be used to create compatible train/test sets,
since the filter only gets initialized with the first dataset and all subsequent datasets get transformed
using the same setup.
NB: inputformat(Insta... | python | def filter(self, data):
"""
Filters the dataset(s). When providing a list, this can be used to create compatible train/test sets,
since the filter only gets initialized with the first dataset and all subsequent datasets get transformed
using the same setup.
NB: inputformat(Insta... | [
"def",
"filter",
"(",
"self",
",",
"data",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"list",
")",
":",
"result",
"=",
"[",
"]",
"for",
"d",
"in",
"data",
":",
"result",
".",
"append",
"(",
"Instances",
"(",
"javabridge",
".",
"static_call",
"... | Filters the dataset(s). When providing a list, this can be used to create compatible train/test sets,
since the filter only gets initialized with the first dataset and all subsequent datasets get transformed
using the same setup.
NB: inputformat(Instances) must have been called beforehand.
... | [
"Filters",
"the",
"dataset",
"(",
"s",
")",
".",
"When",
"providing",
"a",
"list",
"this",
"can",
"be",
"used",
"to",
"create",
"compatible",
"train",
"/",
"test",
"sets",
"since",
"the",
"filter",
"only",
"gets",
"initialized",
"with",
"the",
"first",
"... | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/filters.py#L122-L147 |
fracpete/python-weka-wrapper3 | python/weka/filters.py | MultiFilter.filters | def filters(self):
"""
Returns the list of base filters.
:return: the filter list
:rtype: list
"""
objects = javabridge.get_env().get_object_array_elements(
javabridge.call(self.jobject, "getFilters", "()[Lweka/filters/Filter;"))
result = []
f... | python | def filters(self):
"""
Returns the list of base filters.
:return: the filter list
:rtype: list
"""
objects = javabridge.get_env().get_object_array_elements(
javabridge.call(self.jobject, "getFilters", "()[Lweka/filters/Filter;"))
result = []
f... | [
"def",
"filters",
"(",
"self",
")",
":",
"objects",
"=",
"javabridge",
".",
"get_env",
"(",
")",
".",
"get_object_array_elements",
"(",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"getFilters\"",
",",
"\"()[Lweka/filters/Filter;\"",
")",
")"... | Returns the list of base filters.
:return: the filter list
:rtype: list | [
"Returns",
"the",
"list",
"of",
"base",
"filters",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/filters.py#L201-L213 |
fracpete/python-weka-wrapper3 | python/weka/filters.py | MultiFilter.filters | def filters(self, filters):
"""
Sets the base filters.
:param filters: the list of base filters to use
:type filters: list
"""
obj = []
for fltr in filters:
obj.append(fltr.jobject)
javabridge.call(self.jobject, "setFilters", "([Lweka/filters/... | python | def filters(self, filters):
"""
Sets the base filters.
:param filters: the list of base filters to use
:type filters: list
"""
obj = []
for fltr in filters:
obj.append(fltr.jobject)
javabridge.call(self.jobject, "setFilters", "([Lweka/filters/... | [
"def",
"filters",
"(",
"self",
",",
"filters",
")",
":",
"obj",
"=",
"[",
"]",
"for",
"fltr",
"in",
"filters",
":",
"obj",
".",
"append",
"(",
"fltr",
".",
"jobject",
")",
"javabridge",
".",
"call",
"(",
"self",
".",
"jobject",
",",
"\"setFilters\"",... | Sets the base filters.
:param filters: the list of base filters to use
:type filters: list | [
"Sets",
"the",
"base",
"filters",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/filters.py#L216-L226 |
fracpete/python-weka-wrapper3 | python/weka/flow/container.py | Container.generate_help | def generate_help(self):
"""
Generates a help string for this container.
:return: the help string
:rtype: str
"""
result = []
result.append(self.__class__.__name__)
result.append(re.sub(r'.', '=', self.__class__.__name__))
result.append("")
... | python | def generate_help(self):
"""
Generates a help string for this container.
:return: the help string
:rtype: str
"""
result = []
result.append(self.__class__.__name__)
result.append(re.sub(r'.', '=', self.__class__.__name__))
result.append("")
... | [
"def",
"generate_help",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"result",
".",
"append",
"(",
"self",
".",
"__class__",
".",
"__name__",
")",
"result",
".",
"append",
"(",
"re",
".",
"sub",
"(",
"r'.'",
",",
"'='",
",",
"self",
".",
"__clas... | Generates a help string for this container.
:return: the help string
:rtype: str | [
"Generates",
"a",
"help",
"string",
"for",
"this",
"container",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/container.py#L84-L98 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | Transformer.post_execute | def post_execute(self):
"""
Gets executed after the actual execution.
:return: None if successful, otherwise error message
:rtype: str
"""
result = super(Transformer, self).post_execute()
if result is None:
self._input = None
return result | python | def post_execute(self):
"""
Gets executed after the actual execution.
:return: None if successful, otherwise error message
:rtype: str
"""
result = super(Transformer, self).post_execute()
if result is None:
self._input = None
return result | [
"def",
"post_execute",
"(",
"self",
")",
":",
"result",
"=",
"super",
"(",
"Transformer",
",",
"self",
")",
".",
"post_execute",
"(",
")",
"if",
"result",
"is",
"None",
":",
"self",
".",
"_input",
"=",
"None",
"return",
"result"
] | Gets executed after the actual execution.
:return: None if successful, otherwise error message
:rtype: str | [
"Gets",
"executed",
"after",
"the",
"actual",
"execution",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L55-L65 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.quickinfo | def quickinfo(self):
"""
Returns a short string describing some of the options of the actor.
:return: the info, None if not available
:rtype: str
"""
return "incremental: " + str(self.config["incremental"]) \
+ ", custom: " + str(self.config["use_custom_lo... | python | def quickinfo(self):
"""
Returns a short string describing some of the options of the actor.
:return: the info, None if not available
:rtype: str
"""
return "incremental: " + str(self.config["incremental"]) \
+ ", custom: " + str(self.config["use_custom_lo... | [
"def",
"quickinfo",
"(",
"self",
")",
":",
"return",
"\"incremental: \"",
"+",
"str",
"(",
"self",
".",
"config",
"[",
"\"incremental\"",
"]",
")",
"+",
"\", custom: \"",
"+",
"str",
"(",
"self",
".",
"config",
"[",
"\"use_custom_loader\"",
"]",
")",
"+",
... | Returns a short string describing some of the options of the actor.
:return: the info, None if not available
:rtype: str | [
"Returns",
"a",
"short",
"string",
"describing",
"some",
"of",
"the",
"options",
"of",
"the",
"actor",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L131-L140 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
opt = "incremental"... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
opt = "incremental"... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"opt",
"=",
"\"incremental\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
"[",
"opt",
"]",
"=",
"False",
"if",
"opt",
"not",
"in",
"self",
".",
"help",
":",
"self",
".",
"help",
... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L142-L169 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.check_input | def check_input(self, token):
"""
Performs checks on the input token. Raises an exception if unsupported.
:param token: the token to check
:type token: Token
"""
if token is None:
raise Exception(self.full_name + ": No token provided!")
if isinstance(... | python | def check_input(self, token):
"""
Performs checks on the input token. Raises an exception if unsupported.
:param token: the token to check
:type token: Token
"""
if token is None:
raise Exception(self.full_name + ": No token provided!")
if isinstance(... | [
"def",
"check_input",
"(",
"self",
",",
"token",
")",
":",
"if",
"token",
"is",
"None",
":",
"raise",
"Exception",
"(",
"self",
".",
"full_name",
"+",
"\": No token provided!\"",
")",
"if",
"isinstance",
"(",
"token",
".",
"payload",
",",
"str",
")",
":"... | Performs checks on the input token. Raises an exception if unsupported.
:param token: the token to check
:type token: Token | [
"Performs",
"checks",
"on",
"the",
"input",
"token",
".",
"Raises",
"an",
"exception",
"if",
"unsupported",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L171-L182 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.do_execute | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
fname = str(self.input.payload)
if not os.path.exists(fname):
return "File '" + fname + "' does not exist!"
if no... | python | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
fname = str(self.input.payload)
if not os.path.exists(fname):
return "File '" + fname + "' does not exist!"
if no... | [
"def",
"do_execute",
"(",
"self",
")",
":",
"fname",
"=",
"str",
"(",
"self",
".",
"input",
".",
"payload",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"fname",
")",
":",
"return",
"\"File '\"",
"+",
"fname",
"+",
"\"' does not exist!\"",
... | The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"The",
"actual",
"execution",
"of",
"the",
"actor",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L184-L205 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.output | def output(self):
"""
Returns the next available output token.
:return: the next token, None if none available
:rtype: Token
"""
if self._iterator is not None:
try:
inst = self._iterator.next()
result = Token(inst)
... | python | def output(self):
"""
Returns the next available output token.
:return: the next token, None if none available
:rtype: Token
"""
if self._iterator is not None:
try:
inst = self._iterator.next()
result = Token(inst)
... | [
"def",
"output",
"(",
"self",
")",
":",
"if",
"self",
".",
"_iterator",
"is",
"not",
"None",
":",
"try",
":",
"inst",
"=",
"self",
".",
"_iterator",
".",
"next",
"(",
")",
"result",
"=",
"Token",
"(",
"inst",
")",
"except",
"Exception",
"as",
"e",
... | Returns the next available output token.
:return: the next token, None if none available
:rtype: Token | [
"Returns",
"the",
"next",
"available",
"output",
"token",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L216-L232 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.stop_execution | def stop_execution(self):
"""
Triggers the stopping of the object.
"""
super(LoadDataset, self).stop_execution()
self._loader = None
self._iterator = None | python | def stop_execution(self):
"""
Triggers the stopping of the object.
"""
super(LoadDataset, self).stop_execution()
self._loader = None
self._iterator = None | [
"def",
"stop_execution",
"(",
"self",
")",
":",
"super",
"(",
"LoadDataset",
",",
"self",
")",
".",
"stop_execution",
"(",
")",
"self",
".",
"_loader",
"=",
"None",
"self",
".",
"_iterator",
"=",
"None"
] | Triggers the stopping of the object. | [
"Triggers",
"the",
"stopping",
"of",
"the",
"object",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L234-L240 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | LoadDataset.wrapup | def wrapup(self):
"""
Finishes up after execution finishes, does not remove any graphical output.
"""
self._loader = None
self._iterator = None
super(LoadDataset, self).wrapup() | python | def wrapup(self):
"""
Finishes up after execution finishes, does not remove any graphical output.
"""
self._loader = None
self._iterator = None
super(LoadDataset, self).wrapup() | [
"def",
"wrapup",
"(",
"self",
")",
":",
"self",
".",
"_loader",
"=",
"None",
"self",
".",
"_iterator",
"=",
"None",
"super",
"(",
"LoadDataset",
",",
"self",
")",
".",
"wrapup",
"(",
")"
] | Finishes up after execution finishes, does not remove any graphical output. | [
"Finishes",
"up",
"after",
"execution",
"finishes",
"does",
"not",
"remove",
"any",
"graphical",
"output",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L242-L248 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | SetStorageValue.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Set... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Set... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"options",
"=",
"super",
"(",
"SetStorageValue",
",",
"self",
")",
".",
"fix_config",
"(",
"options",
")",
"opt",
"=",
"\"storage_name\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
"[... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L286-L303 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | SetStorageValue.do_execute | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
if self.storagehandler is None:
return "No storage handler available!"
self.storagehandler.storage[self.resolve_option("s... | python | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
if self.storagehandler is None:
return "No storage handler available!"
self.storagehandler.storage[self.resolve_option("s... | [
"def",
"do_execute",
"(",
"self",
")",
":",
"if",
"self",
".",
"storagehandler",
"is",
"None",
":",
"return",
"\"No storage handler available!\"",
"self",
".",
"storagehandler",
".",
"storage",
"[",
"self",
".",
"resolve_option",
"(",
"\"storage_name\"",
")",
"]... | The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"The",
"actual",
"execution",
"of",
"the",
"actor",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L305-L316 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | DeleteStorageValue.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Del... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Del... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"options",
"=",
"super",
"(",
"DeleteStorageValue",
",",
"self",
")",
".",
"fix_config",
"(",
"options",
")",
"opt",
"=",
"\"storage_name\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L354-L371 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | InitStorageValue.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Ini... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Ini... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"options",
"=",
"super",
"(",
"InitStorageValue",
",",
"self",
")",
".",
"fix_config",
"(",
"options",
")",
"opt",
"=",
"\"storage_name\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
"... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L422-L445 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | InitStorageValue.do_execute | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
if self.storagehandler is None:
return "No storage handler available!"
self.storagehandler.storage[self.resolve_option("s... | python | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
if self.storagehandler is None:
return "No storage handler available!"
self.storagehandler.storage[self.resolve_option("s... | [
"def",
"do_execute",
"(",
"self",
")",
":",
"if",
"self",
".",
"storagehandler",
"is",
"None",
":",
"return",
"\"No storage handler available!\"",
"self",
".",
"storagehandler",
".",
"storage",
"[",
"self",
".",
"resolve_option",
"(",
"\"storage_name\"",
")",
"]... | The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"The",
"actual",
"execution",
"of",
"the",
"actor",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L447-L458 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | UpdateStorageValue.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Upd... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Upd... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"options",
"=",
"super",
"(",
"UpdateStorageValue",
",",
"self",
")",
".",
"fix_config",
"(",
"options",
")",
"opt",
"=",
"\"storage_name\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L499-L522 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | UpdateStorageValue.do_execute | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
if self.storagehandler is None:
return "No storage handler available!"
expr = str(self.resolve_option("expression")).repl... | python | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
if self.storagehandler is None:
return "No storage handler available!"
expr = str(self.resolve_option("expression")).repl... | [
"def",
"do_execute",
"(",
"self",
")",
":",
"if",
"self",
".",
"storagehandler",
"is",
"None",
":",
"return",
"\"No storage handler available!\"",
"expr",
"=",
"str",
"(",
"self",
".",
"resolve_option",
"(",
"\"expression\"",
")",
")",
".",
"replace",
"(",
"... | The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"The",
"actual",
"execution",
"of",
"the",
"actor",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L524-L538 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | MathExpression.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Mat... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Mat... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"options",
"=",
"super",
"(",
"MathExpression",
",",
"self",
")",
".",
"fix_config",
"(",
"options",
")",
"opt",
"=",
"\"expression\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
"[",
... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L581-L598 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | MathExpression.do_execute | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
expr = str(self.resolve_option("expression"))
expr = expr.replace("{X}", str(self.input.payload))
self._output.append(Token(e... | python | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
expr = str(self.resolve_option("expression"))
expr = expr.replace("{X}", str(self.input.payload))
self._output.append(Token(e... | [
"def",
"do_execute",
"(",
"self",
")",
":",
"expr",
"=",
"str",
"(",
"self",
".",
"resolve_option",
"(",
"\"expression\"",
")",
")",
"expr",
"=",
"expr",
".",
"replace",
"(",
"\"{X}\"",
",",
"str",
"(",
"self",
".",
"input",
".",
"payload",
")",
")",... | The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str | [
"The",
"actual",
"execution",
"of",
"the",
"actor",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L600-L610 |
fracpete/python-weka-wrapper3 | python/weka/flow/transformer.py | ClassSelector.fix_config | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Cla... | python | def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Cla... | [
"def",
"fix_config",
"(",
"self",
",",
"options",
")",
":",
"options",
"=",
"super",
"(",
"ClassSelector",
",",
"self",
")",
".",
"fix_config",
"(",
"options",
")",
"opt",
"=",
"\"index\"",
"if",
"opt",
"not",
"in",
"options",
":",
"options",
"[",
"opt... | Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict | [
"Fixes",
"the",
"options",
"if",
"necessary",
".",
"I",
".",
"e",
".",
"it",
"adds",
"all",
"required",
"elements",
"to",
"the",
"dictionary",
"."
] | train | https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/transformer.py#L649-L672 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.